Commit graph

113 commits

Author SHA1 Message Date
Alex Pyrgiotis
ffcf664a48
Update build instructions 2024-10-17 15:50:10 +03:00
Alex Pyrgiotis
13f5658947
Improve instructions for Fedora 41
Update our changelog and release instructions, and add a note for
Fedora 41 users in our build instructions to install Python 3.12.

Fixes #947
2024-10-15 19:43:28 +03:00
Alex Pyrgiotis
f3fbc33fcd
dev_scripts: Allow building a Fedora 41 dev env
Use Python 3.12 in Fedora 41 dev environments, since Python 3.13
(default in Fedora 41) does not work with PySide6 from PyPI yet.
2024-10-15 19:43:14 +03:00
Alexis Métaireau
49c3c2c6bb
Add support for 24.10 (oracular)
Refs #947
2024-10-15 19:41:49 +03:00
Alex Pyrgiotis
8ad95981ea
dev_scripts: Add user fix for Ubuntu 24.10
It seems that the container image for Ubuntu 24.10 also ships with a
default Ubuntu user with UID 1000, so we need to remove it when creating
our dev environment.
2024-10-15 19:41:49 +03:00
Alex Pyrgiotis
8f5ae9d6ad
dev_scripts: Make user networking work in an Ubuntu 24.10 dev environment
Try installing `passt`, which is responsible for user networking in
later Podman releases. If not installed, building the container image
within an Ubuntu 24.10 environment fails with:

    setup network: could not find pasta, the network namespace can't be
    configured: exec: "pasta": executable file not found in $PATH

Note that this package is not available in older Ubuntu versions. In
these cases, we should swallow installation failures and continue.
2024-10-15 15:47:58 +03:00
Alex Pyrgiotis
44a6cc0017
dev_scripts: Install pip in dev environments
Install pip in dev environments, so that we can use it to vendor
PyMuPDf in subsequent commits.
2024-10-15 13:09:52 +03:00
Alexis Métaireau
025e5dda51
Switch from CircleCI runners to Github actions.
As part of this change, the dev (build) and end-user test images names
changed from `dangerzone.rocks/*` to `ghcr.io`.

A new `--sync` option is provided in the `env.py` command, in order to
retrieve the images from the registry, or build and upload otherwise.
2024-10-02 16:47:58 +02:00
Alexis Métaireau
b375a7e96e
dev_scripts: store env data in the user's data dir.
Previously, these files where stored inside the repository (under
`dev_scripts/env/`), which could lead to conflicts with some tooling
(black, debian-helper).

(Linux only): as a convenience, here is how to move data to the new
location:

```bash
mkdir -p ~/.local/share/dangerzone-dev
mv dev_scripts/envs/ ~/.local/share/dangerzone-dev/.
```
2024-09-11 16:20:27 +02:00
Alexis Métaireau
396c3b56c8
packaging: replace stdeb by pybuild
As a result, a new `debian` folder is now living in the repository.
Debian packaging is now done manually rather than using tools that do
the heavy-lifting for us.

The `build-deb.py` script has also been updated to use `dpkg-buildpackage`
2024-09-11 16:20:27 +02:00
Alex Pyrgiotis
3002849b7f
Install Thunar in our Dangerzone environments
Install Thunar in our Dangerzone Linux environments, so that we can use
it for our drag-and-drop QA test.
2024-09-10 22:28:31 +03:00
Alex Pyrgiotis
f739761405
dev_scripts: Download FPF's PySide6 RPM only for Fedora 39
Download the FPF-maintained python3-pyside6 RPM [1] only when we build
an end-user environment for Fedora 39. Else, from Fedora 40 onwards, we
can use the official `python3-pyside6` RPM.

Refs freedomofpress/maint-dangerzone-pyside6#5

[1]: https://packages.freedom.press/yum-tools-prod/dangerzone/f39/python3-pyside6-6.7.1-1.fc39.x86_64.rpm
2024-08-09 14:40:12 +03:00
Alex Pyrgiotis
c1dbe9c3e3
dev_scripts: Handle Dangerzone packages with patch level != 1
Update our `env.py` script to auto-detect the correct Dangerzone package
name. This is useful when building an end-user environment, i.e., a
container image where we copy the respective Dangerzone .deb/.rpm
package and install it via a package manager.

To achieve this, we replace the hardcoded patch level (`-1`) in the
package name with a glob character (`*`). Then, we check in the
respective build directory if there's exactly one match for this
pattern. If yes, we return the full path. If not, we raise an exception.

Note that this limitation was triggered when we were building RPM
packages for the 0.7.0 hotfix release.

Refs #880
2024-07-30 18:36:53 +03:00
Alexis Métaireau
df3f8f7cb5
Do not allow uploading the token as an asset 2024-07-24 15:04:09 +03:00
Alex Pyrgiotis
f476102ee9
dev_scripts: Properly skip QA scenarios on Linux
With the addition of the drag-and-drop QA scenario, the numbering of the
QA steps has changed. Mirror this numbering change in the qa.py script
as well, which tracks which QA scenarios do not apply to Linux
platforms.
2024-06-27 21:47:51 +03:00
Alex Pyrgiotis
58bc9950c5
Remove an errand whitespace character 2024-06-27 21:47:16 +03:00
deeplow
d0e1df5546
Add drag and drop support for document selection 2024-06-27 11:51:41 +02:00
Alexis Métaireau
92ae942661
Use python 3.12 for Windows and macOS builds
Fixes #848
2024-06-26 19:42:54 +02:00
Alexis Métaireau
c2a47ec46b
Drop support for Fedora 38
Fedora 38 is EOL since 21 May 2024, so this removes the specific branches
we had checking for it, and updates the related instructions.
2024-06-20 17:08:27 +02:00
Alex Pyrgiotis
0019f0d3d3
docs: Move dev_scripts docs under docs/ dir
Move the documentation on how to create and use containerized Dangerzone
environments under `docs/developer`, which seems like a more natural
place than a README under `dev_scripts/`.
2024-06-12 13:22:45 +03:00
Alexis Métaireau
99f1e15fd2
chore: Do not use fstrings without placeholders
> f-strings are a convenient way to format strings, but they are not
> necessary if there are no placeholder expressions to format. In this
> case, a regular string should be used instead, as an f-string without
> placeholders can be confusing for readers, who may expect such a
> placeholder to be present.
>
> — [ruff docs](https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/)
2024-06-05 14:19:31 +02:00
Alexis Métaireau
5aa4863b52
chore(imports): remove useless imports
As detected by [ruff](https://github.com/astral-sh/ruff)

Related to #254, although it doesn't provide the command to lint the
codebase itself.
2024-06-05 14:19:30 +02:00
Alexis Métaireau
c01515b775
Bump the minimum python version to 3.9
The minimum python version when installing from source is now python
3.9, as Pyside6 6.7.1 dropped support for python 3.8 (see #780 for more
information).

On Debian-derivatives distributions, the minimum Python version is now
set to 3.8. In practice, because Pyside6 is not packaged for Debian, we
use Pyside2 [0], which is why we can relax the python version requirement.

In practice, when installing from source on an environment where
python3.9 is not the default python, poetry will look for it and use it
if available

> For various reasons, this Python version might not be compatible with
> the python range supported by the project. In this case, Poetry will
> try to find one that is and use it.
>
> [Poetry docs](https://python-poetry.org/docs/managing-environments/)

On Ubuntu Focal (20.04) where Python 3.9 is not installed by default,
it is possible to install it using the `python3.9` package.

Additionally, In version 1.24.3, PyMuPDF changed its package name from `fitz`
to `pymupdf` [2], resulting in a breakage on how it is installed in our
container. This is now fixed.

[0] More information on how Pyside6 packaging affects dangerzone on #221
[1] See [the current status of Pyside6 packaging](https://repology.org/
project/python:pyside6/packages)
[2] PyMuPDF changelog: https://pymupdf.readthedocs.io/en/latest/changes.html#change-log
2024-06-04 19:57:40 +02:00
Alex Pyrgiotis
aebc091400
Explain how to create, sign, and verify source tarballs
Update our docs and scripts to be able to create a source tarball for a
Dangerzone version, sign it, and explain how can users verify it.

Closes #822
2024-06-03 12:59:22 +03:00
Alex Pyrgiotis
5320b33d17
dev_scripts: Bump PySide6 version to 6.7.1
Bump the PySide6 version used in our user environments to 6.7.1, to
mirror the one we ship to our users, and also fix a segfault issue in
our CI tests.

Refs #801
2024-05-29 19:28:59 +03:00
178f94e612
docs: fix a typo, it's dev_scripts 2024-05-24 11:54:44 +02:00
Alex Pyrgiotis
8c59589be1
Inform users about Pyside6 and conmon packages
Inform users that for specific distros and versions, we install some
extra packages (PySide6, conmon), in order to fix some incompatibilities
between Dangerzone and the base system. Provide also a link to the
source / build instructions for the package, as well as any relevant
issues.

Fixes #767
2024-05-09 17:36:04 +03:00
Alex Pyrgiotis
83c165ae33
dev_scripts: Sign our assets and calculate their hashes
Add a new script called `sign-assets.py`, which produces the hash of all
the Dangerzone assets for a release (Windows/macOS installers, container
image), and signs them individually.

Also update our RELEASE.md document, to incorporate this script into our
release workflow.
2024-05-09 17:32:07 +03:00
Alex Pyrgiotis
549ed23193
dev_scripts: Fix bug during env build
Create the build directory first, and then add the PySide6 package in
it.
2024-05-09 16:46:16 +03:00
Alex Pyrgiotis
b97e9540c1
Fix minor typos in RELEASE.md 2024-05-09 16:46:16 +03:00
Alex Pyrgiotis
e11aaec3ac
Always use sys.exit when exiting the application
The `exit()` [1] function is not necessarily present in every Python
environment, as it's added by the `site` module. Also, this function is
"[...] useful for the interactive interpreter shell and should not be
used in programs"

For this reason, we replace all such occurrences with `sys.exit()` [2],
which is the canonical function to exit Python programs.

[1]: https://docs.python.org/3/library/constants.html#exit
[2]: https://docs.python.org/3/library/sys.html#sys.exit
2024-05-09 15:57:42 +03:00
Alex Pyrgiotis
b920de36d1
Announce our Ubuntu Noble / Fedora 40 support
Closes #762
2024-04-24 14:30:40 +03:00
Alex Pyrgiotis
7a9facb3c1
dev_scripts: Add Ubuntu Noble / Fedora 40 in our QA scripts 2024-04-23 18:00:48 +03:00
Alex Pyrgiotis
7cd73cab0e
ci: Bump PySide6 version in Fedora end-user envs
Our end-user Fedora environments, that we create for testing how
Dangerzone would operate on a clean Fedora system, require PySide6 to be
installed. This package is not available from the official Fedora repos
yet.

We have a way instead to check the poetry.lock file, grab the latest
PySide6 version from there, and install it from a URL. This is no longer
necessary, now that PySide6 6.7.0 will soon be available in all stable
Fedora releases. Since the last release maintained by FPF will be
6.6.3.1, we should pin this version in our env.py script. This way, we
can bump poetry.lock independently, and let Windows/macOS users get
different versions.

Refs freedomofpress/maint-dangerzone-pyside6#5
2024-04-19 00:54:07 +03:00
deeplow
5c86927269
Change "external state" QA scenario to only win/mac
The previous scenario 10 tested the handling of state upon Dangerzone
updates. This, however was particularly difficult to do on Linux due to
the need to add a repository and install, especially in our
semi-automated QA environment.

For this reason this commits removes Linux from this scenario and moves
it closer to the top of the scenarios list to reduce the change of
state "contamination". In other words, before testing the new version,
the tester now installs a previous version and then the new one, thus
guaranteeing that there is no inconsistent state due to installing an
earlier version later in QA.

Fixes #719
2024-04-01 18:18:40 +03:00
Naglis Jonaitis
b284a55dc6
Fix typos 2024-03-28 13:23:36 +02:00
Alex Pyrgiotis
f75d471ec8
Fix OCR bug in Qubes Fedora 38 templates
Provide a fix for an OCR bug that affected Fedora 38 templates of Qubes
OS. In that specific configuration, the PyMuPDF version accepts the
Tesseract data directory only from the `TESSDATA_PREFIX` environment
variable. Our mistake was that we were setting this environment variable
in a dev script, instead of setting it for all configurations.

In this commit, we set an attribute in the fitz.fitz module, so that
both dev scripts and end-user installations can work. This is hacky, but
it targets an old PyMuPDF release after all, so we don't expect things
to break in the long run.

Fixes #737
2024-03-04 16:53:04 +02:00
Alex Pyrgiotis
aeb8c33b6e
Update expected output for a QA scenario
Inform testers that the container code no longer returns "UNTRUSTED >"
strings in its output. Every string is trusted now, and the output will
be similar for container and Qubes isolation providers alike.
2024-02-20 16:00:35 +02:00
Alex Pyrgiotis
bc55a64864
Appease lint checker 2024-02-20 15:55:46 +02:00
Alex Pyrgiotis
531a5bc96f
qa: Add extra actions in the Windows QA script 2024-02-19 17:13:57 +02:00
Alex Pyrgiotis
fd241e5964
qa: Consume stdin on Windows platforms
On Windows platforms, we can't consume the stdin using select(), because
it's not available for pipes [1]. We can instead consume it using some
native Windows calls.

[1]: From https://docs.python.org/3/library/select.html#select.select:

     "File objects on Windows are not acceptable, but sockets are. On
     Windows, the underlying select() function is provided by the
     WinSock library, and does not handle file descriptors that don’t
     originate from WinSock."
2024-02-19 17:13:57 +02:00
deeplow
e375624fdc
Bump Qubes Fedora on RELEASE.md
Fixes #712
2024-02-15 14:42:01 +00:00
deeplow
8f11156ce4
Deprecate Ubuntu Lunar Lobster (EOL)
Fixes #705
2024-02-13 11:07:11 +00:00
Alex Pyrgiotis
2703448d60
Update Jammy build instructions regarding conmon
Update the build instructions for Ubuntu Jammy regarding conmon, now
that oldstable-proposed-updates no longer offers a patched conmon
package. Propose instead to install conmon from our apt-tools-prod repo.
2024-02-13 12:33:57 +02:00
Alex Pyrgiotis
42c64569af
dev_scripts: Install conmon from our apt-tools-prod repo
Instead of installing a patched conmon version from the
oldstable-proposed-updates repo, install it from our apt-tools-prod
repo. This applies to just Ubuntu Jammy, since the rest of the platforms
don't have this problem.
2024-02-13 11:55:32 +02:00
Alex Pyrgiotis
0d7b6e8533
dev_scripts: Do not backport conmon in Bullseye
Now that the conmon package with version 2.0.25+ds1-1.1+deb11u1 has been
released [1] for Debian Bullseye, there is no need to install it from
the oldstable-proposed-updates repo any more.

[1]: https://tracker.debian.org/pkg/conmon
2024-02-13 11:26:15 +02:00
deeplow
6006beeb03
Fix OCR on Qubes: PyMuPDF required TESSDATA_PREFIX
PyMuPDF versions lower than 1.22.5 pass the tesseract data path as
an argument to `pixmap.pdfocr_tobytes()` [1], but lower versions require
setting instead the TESSDATA_PREFIX environment variable [2].

Because on Qubes the pixels to pdf conversion happens on the host and
Qubes has a lower PyMuPDF package version, we need to pass instead via
environment variable.

NOTE: the TESSDATA_PREFIX env. variable was set in dangerzone-cli
instead of closer to the calling method in `doc_to_pixels.py` since
PyMuPDF reads this variable as soon as the fitz module is imported
[3][4].

[1]: https://pymupdf.readthedocs.io/en/latest/pixmap.html#Pixmap.pdfocr_tobytes
[2]: https://pymupdf.readthedocs.io/en/latest/installation.html#enabling-integrated-ocr-support
[3]: https://github.com/pymupdf/PyMuPDF/discussions/2439
[4]: https://github.com/pymupdf/PyMuPDF/blob/5d6a7db/src/__init__.py#L159

Fixes #682
2024-02-07 13:13:10 +00:00
Alex Pyrgiotis
d1afe4c30a
Fix Podman crashes due to old conmon version
Switching from mounting files to writing to stdout has introduced some
Podman crashes in specific environments (Ubuntu Jammy / Debian Bullseye)
due to a conmon bug that affects version 2.0.25.

Fixing it for various permutations of the environments we support
requires the following:

1. CI tests: Install conmon from the oldstable-proposed-updates in
   our Debian Bullseye / Ubuntu Jammy dev/end-user environments.
2. Developers: Add a line in BUILD.md that suggests users to install
   conmon from the oldstable-proposed-updates repo, or some other repo
   they prefer.
3. End-user installations: We will build conmon for Ubuntu Jammy, and
   wait until the proposed updates repo gets merged in Debian Bullseye.

Fixes #685
2024-02-07 12:53:15 +00:00
Alex Pyrgiotis
3e10fd1df4
Explain what happens when PySide6 gets updated
Explain what happens when we bump our `poetry.lock`, and a new
Pyside6 version. Also, have a step-by-step guide on how the maintainer
should create a new PySide6 RPM and update FPF's repo, so that
Dangerzone can be released.
2024-01-31 17:11:31 +02:00
Alex Pyrgiotis
d54ef875a6
Add official support for Fedora 39
Now that we can create a Dangerzone RPM that depends on PySide6, we can
officially support Fedora 39 as a platform. Add this platform in our CI
tests, as well as our install/release notes.

Fixes #606
2024-01-31 17:11:30 +02:00