Compare commits

..

25 commits

Author SHA1 Message Date
Alex Pyrgiotis
95ead58cf2
FIXUP: Use always the correct manifest
Some checks failed
Tests / macOS (arch64) (push) Has been cancelled
Tests / macOS (x86_64) (push) Has been cancelled
Build dev environments / build-container-image (push) Has been cancelled
Tests / run-lint (push) Has been cancelled
Tests / build-container-image (push) Has been cancelled
Tests / Download and cache Tesseract data (push) Has been cancelled
Release multi-arch container image / build-push-image (push) Has been cancelled
Tests / windows (push) Has been cancelled
Tests / build-deb (debian bookworm) (push) Has been cancelled
Tests / build-deb (debian bullseye) (push) Has been cancelled
Tests / build-deb (debian trixie) (push) Has been cancelled
Tests / build-deb (ubuntu 22.04) (push) Has been cancelled
Tests / build-deb (ubuntu 24.04) (push) Has been cancelled
Tests / build-deb (ubuntu 24.10) (push) Has been cancelled
Tests / install-deb (debian bookworm) (push) Has been cancelled
Tests / install-deb (debian bullseye) (push) Has been cancelled
Tests / install-deb (debian trixie) (push) Has been cancelled
Tests / install-deb (ubuntu 22.04) (push) Has been cancelled
Tests / install-deb (ubuntu 24.04) (push) Has been cancelled
Tests / install-deb (ubuntu 24.10) (push) Has been cancelled
Tests / build-install-rpm (fedora 40) (push) Has been cancelled
Tests / build-install-rpm (fedora 41) (push) Has been cancelled
Tests / run tests (debian bookworm) (push) Has been cancelled
Tests / run tests (debian bullseye) (push) Has been cancelled
Tests / run tests (debian trixie) (push) Has been cancelled
Tests / run tests (fedora 40) (push) Has been cancelled
Tests / run tests (fedora 41) (push) Has been cancelled
Tests / run tests (ubuntu 22.04) (push) Has been cancelled
Tests / run tests (ubuntu 24.04) (push) Has been cancelled
Tests / run tests (ubuntu 24.10) (push) Has been cancelled
2025-03-19 16:16:34 +02:00
Alex Pyrgiotis
2b6736f978
FIXUP: Proxy job outputs
Some checks are pending
Build dev environments / build-container-image (push) Waiting to run
Tests / run-lint (push) Waiting to run
Tests / build-container-image (push) Waiting to run
Tests / Download and cache Tesseract data (push) Waiting to run
Tests / windows (push) Blocked by required conditions
Tests / macOS (arch64) (push) Blocked by required conditions
Tests / macOS (x86_64) (push) Blocked by required conditions
Tests / build-deb (debian bookworm) (push) Blocked by required conditions
Tests / build-deb (debian bullseye) (push) Blocked by required conditions
Tests / build-deb (debian trixie) (push) Blocked by required conditions
Tests / build-deb (ubuntu 22.04) (push) Blocked by required conditions
Tests / build-deb (ubuntu 24.04) (push) Blocked by required conditions
Tests / build-deb (ubuntu 24.10) (push) Blocked by required conditions
Tests / install-deb (debian bookworm) (push) Blocked by required conditions
Tests / install-deb (debian bullseye) (push) Blocked by required conditions
Tests / install-deb (debian trixie) (push) Blocked by required conditions
Tests / install-deb (ubuntu 22.04) (push) Blocked by required conditions
Tests / install-deb (ubuntu 24.04) (push) Blocked by required conditions
Tests / install-deb (ubuntu 24.10) (push) Blocked by required conditions
Tests / build-install-rpm (fedora 40) (push) Blocked by required conditions
Tests / build-install-rpm (fedora 41) (push) Blocked by required conditions
Tests / run tests (debian bookworm) (push) Blocked by required conditions
Tests / run tests (debian bullseye) (push) Blocked by required conditions
Tests / run tests (debian trixie) (push) Blocked by required conditions
Tests / run tests (fedora 40) (push) Blocked by required conditions
Tests / run tests (fedora 41) (push) Blocked by required conditions
Tests / run tests (ubuntu 22.04) (push) Blocked by required conditions
Tests / run tests (ubuntu 24.04) (push) Blocked by required conditions
Tests / run tests (ubuntu 24.10) (push) Blocked by required conditions
Release multi-arch container image / build-push-image (push) Waiting to run
2025-03-19 12:14:25 +02:00
Alex Pyrgiotis
b301bf07ea
fixup! FIXUP: Change digest with manifest_type 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
c4bd9b3701
FIXUP: Make tests work after 'podman load -i' 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
9d92fa1f12
FIXUP: Rename XXX to NOTE 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
606fbb7abb
FIXUP: Add comment for needs: prepare 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
410fb754ea
FIXUP: Remove extraneous comments 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
635c4433e4
FIXUP: Specify platform by full name 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
d5ffbbbe93
FIXUP: Handle tarballs with ./ prefix 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
44f0ea5149
FIXUP: Rename repro-build to repro-build.py 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
29cb046f17
FIXUP: Rename compressed_container_path envvar 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
e903cf377f
FIXUP: Use 'load -i' 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
a7006287cc
FIXUP: Document removal of resolv.conf 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
ba621d3bea
FIXUP: Change digest with manifest_type 2025-03-19 11:44:20 +02:00
Alex Pyrgiotis
eafbf98ca8
FIXUP: Move buildkit image alongw with other envvars 2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
167379790c
FIXUP: Remove command that checks github token 2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
e7576fe78b
FIXUP: Make release image job reusable 2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
67092b87e5
ci: Create a CI job that does the following
1. Create a multi-architecture container image for Dangerzone, instead
   of having two different tarballs (or no option at all)
2. Build the Dangerzone container image on our supported architectures
   (linux/amd64 and linux/arm64). It so happens that GitHub also offers
   ARM machine runners, which speeds up the build.
3. Combine the images from these two architectures into one, multi-arch
   image.
4. Generate provenance info for each manifest, and the root manifest
   list.
5. Check the image's reproduciblity.

Also, remove an older CI action, that is now obsolete.

Fixes #1035
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
2e59d889b8
Completely overhaul the reproduce-image.py script
Make a major change to the `reproduce-image.py` script: drop `diffoci`,
build the container image, and ensure it has the exact same hash as the
source image.

We can drop the `diffoci` script when comparing the two images, because
we are now able build bit-for-bit reproducible images.
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
ad70d3b1d5
Fix a Podman regression regarding Buildkit images
Loading an image built with Buildkit in Podman 3.4 messes up its name.
The tag somehow becomes the name of the loaded image.

We know that older Podman versions are not generally affected, since
Podman v3.0.1 on Debian Bullseye works properly. Also, Podman v4.0 is
not affected, so it makes sense to target only Podman v3.4 for a fix.

The fix is simple, tag the image properly based on the expected tag from
`share/image-id.txt` and delete the incorrect tag.

Refs containers/podman/#16490
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
c6c7c14f12
Fix references to container.tar.gz
Find all references to the `container.tar.gz` file, and replace them
with references to `container.tar`. Moreover, remove the `--no-save`
argument of `build-image.py` since we now always save the image.

Finally, fix some stale references to Poetry, which are not necessary
anymore.
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
12a87617b5
Build container image using repro-build
Invoke the `repro-build` script when building a container image, instead
of the underlying Docker/Podman commands. The `repro-build` script
handles the underlying complexity to call Docker/Podman in a manner that
makes the image reproducible.

Moreover, mirror some arguments from the `repro-build` script, so that
consumers of `build-image.py` can pass them to it.

Important: the resulting image will be in .tar format, not .tar.gz,
starting from this commit. This means that our tests will be broken for
the next few commits.

Fixes #1074
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
6074bb6a36
Vendor repro-build script
Vendor the `repro-build` script in our codebase, which will be used to
build our container image in a reproducible manner. We prefer to copy it
verbatim for the time-being, since its interface is not stable enough,
and the repro-build repo is not reviewed after all.

In the future, we want to store this script in a separate place, and
pull it when necessary.

Refs #1085
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
ddf1c27bcd
Remove sources of non-determinism from our image
Make our container image more reproducible, by changing the following in
our Dockerfile:
1. Touch `/etc/apt/sources.list` with a UTC timestamp. Else, builds on
   different countries (!?) may result to different Unix epochs for the
   same date, and therefore different modification time for the
   file.
2. Turn the third column of `/etc/shadow` (date of last password change)
   for the `dangerzone` user into a constant number.
3. Fix r-s file permissions in some copied files, due to inconsistent
   COPY behavior in containerized vs non-containerized Buildkit. This
   requires creating a full file hierarchy in a separate directory (see
   new_root/).
4. Set a specific modification time for the entrypoint script, because
   rewrite-timestamp=true does not overwrite it.
2025-03-19 11:44:19 +02:00
Alex Pyrgiotis
0bae29a265
Bump container image parameters
Bump all the values in Dockerfile.env, since there are new releases out
for all of them.
2025-03-19 11:44:19 +02:00
9 changed files with 56 additions and 34 deletions

View file

@ -39,8 +39,6 @@ jobs:
version: "24.04"
- distro: ubuntu
version: "24.10"
- distro: ubuntu
version: "25.04"
- distro: debian
version: bullseye
- distro: debian
@ -51,8 +49,6 @@ jobs:
version: "40"
- distro: fedora
version: "41"
- distro: fedora
version: "42"
steps:
- name: Checkout

View file

@ -192,8 +192,6 @@ jobs:
version: "24.04"
- distro: ubuntu
version: "24.10"
- distro: ubuntu
version: "25.04"
- distro: debian
version: bullseye
- distro: debian
@ -261,8 +259,6 @@ jobs:
version: "24.04"
- distro: ubuntu
version: "24.10"
- distro: ubuntu
version: "25.04"
- distro: debian
version: bullseye
- distro: debian
@ -310,7 +306,7 @@ jobs:
strategy:
matrix:
distro: ["fedora"]
version: ["40", "41", "42"]
version: ["40", "41"]
steps:
- name: Checkout
uses: actions/checkout@v4
@ -389,8 +385,6 @@ jobs:
version: "24.04"
- distro: ubuntu
version: "24.10"
- distro: ubuntu
version: "25.04"
- distro: debian
version: bullseye
- distro: debian
@ -401,8 +395,6 @@ jobs:
version: "40"
- distro: fedora
version: "41"
- distro: fedora
version: "42"
steps:
- name: Checkout

View file

@ -109,6 +109,28 @@ sudo dnf install -y rpm-build podman python3 python3-devel python3-poetry-core \
pipx qt6-qtbase-gui
```
<table>
<tr>
<td>
<details>
<summary><i>:memo: Expand this section if you are on Fedora 41.</i></summary>
</br>
The default Python version that ships with Fedora 41 (3.13) is not
compatible with PySide6, which requires Python 3.12 or earlier.
You can install Python 3.12 using the `python3.12` package.
```bash
sudo dnf install -y python3.12
```
Poetry will automatically pick up the correct version when running.
</details>
</td>
</tr>
</table>
Install Poetry using `pipx`:
```sh

View file

@ -8,8 +8,6 @@ since 0.4.1, and this project adheres to [Semantic Versioning](https://semver.or
## [Unreleased](https://github.com/freedomofpress/dangerzone/compare/v0.8.1...HEAD)
- Platform support: Drop support for Ubuntu Focal, since it's nearing end-of-life ([#1018](https://github.com/freedomofpress/dangerzone/issues/1018))
- Platform support: Add support for Fedora 42 ([#1091](https://github.com/freedomofpress/dangerzone/issues/1091))
- Platform support: Add support for Ubuntu 25.04 (Plucky Puffin)([#1090](https://github.com/freedomofpress/dangerzone/issues/1090))
## [0.8.1](https://github.com/freedomofpress/dangerzone/compare/v0.8.1...0.8.0)

View file

@ -22,7 +22,6 @@ On Linux, Dangerzone uses [Podman](https://podman.io/) instead of Docker Desktop
an isolated environment. It will be installed automatically when installing Dangerzone.
Dangerzone is available for:
- Ubuntu 25.04 (plucky)
- Ubuntu 24.10 (oracular)
- Ubuntu 24.04 (noble)
- Ubuntu 22.04 (jammy)

View file

@ -3,7 +3,6 @@ import os
import platform
import tempfile
import typing
from multiprocessing import freeze_support
from multiprocessing.pool import ThreadPool
from pathlib import Path
from typing import List, Optional
@ -1221,9 +1220,6 @@ class DocumentsListWidget(QtWidgets.QListWidget):
def start_conversion(self) -> None:
if not self.thread_pool_initized:
max_jobs = self.dangerzone.isolation_provider.get_max_parallel_conversions()
# Call freeze_support() to avoid passing unknown options to the subprocess.
# See https://github.com/freedomofpress/dangerzone/issues/873
freeze_support()
self.thread_pool = ThreadPool(max_jobs)
for doc in self.docs_list:

View file

@ -103,6 +103,14 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*
"""
# NOTE: Fedora 41 comes with Python 3.13 installed. Our Python project is not compatible
# yet with Python 3.13, because PySide6 cannot work with this Python version. To
# sidestep this, install Python 3.12 *only* in dev environments.
DOCKERFILE_BUILD_DEV_FEDORA_41_DEPS = r"""
# Install Python 3.12 since our project is not compatible yet with Python 3.13.
RUN dnf install -y python3.12
"""
# FIXME: Install Poetry on Fedora via package manager.
DOCKERFILE_BUILD_DEV_FEDORA_DEPS = r"""
RUN dnf install -y git rpm-build podman python3 python3-devel python3-poetry-core \
@ -530,6 +538,8 @@ class Env:
if self.distro == "fedora":
install_deps = DOCKERFILE_BUILD_DEV_FEDORA_DEPS
if self.version == "41":
install_deps += DOCKERFILE_BUILD_DEV_FEDORA_41_DEPS
else:
# Use Qt6 in all of our Linux dev environments, and add a missing
# libxcb-cursor0 dependency
@ -551,8 +561,6 @@ class Env:
"noble",
"24.10",
"ocular",
"25.04",
"plucky",
):
install_deps = (
DOCKERFILE_UBUNTU_REM_USER + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
@ -612,8 +620,6 @@ class Env:
"noble",
"24.10",
"ocular",
"25.04",
"plucky",
):
install_deps = DOCKERFILE_UBUNTU_REM_USER + DOCKERFILE_BUILD_DEBIAN_DEPS
package_pattern = f"dangerzone_{version}-*_*.deb"

View file

@ -327,6 +327,28 @@ sudo dnf install -y rpm-build podman python3 python3-devel python3-poetry-core \
pipx qt6-qtbase-gui
```
<table>
<tr>
<td>
<details>
<summary><i>:memo: Expand this section if you are on Fedora 41.</i></summary>
</br>
The default Python version that ships with Fedora 41 (3.13) is not
compatible with PySide6, which requires Python 3.12 or earlier.
You can install Python 3.12 using the `python3.12` package.
```bash
sudo dnf install -y python3.12
```
Poetry will automatically pick up the correct version when running.
</details>
</td>
</tr>
</table>
Install Poetry using `pipx`:
```sh
@ -1005,11 +1027,6 @@ class QAUbuntu2410(QADebianBased):
VERSION = "24.10"
class QAUbuntu2504(QADebianBased):
DISTRO = "ubuntu"
VERSION = "25.04"
class QAFedora(QALinux):
"""Base class for Fedora distros.
@ -1027,10 +1044,6 @@ class QAFedora(QALinux):
)
class QAFedora42(QAFedora):
VERSION = "42"
class QAFedora41(QAFedora):
VERSION = "41"

@ -1 +1 @@
Subproject commit 0068ffcb67f45fe9e3a082649493b7c8db5d1473
Subproject commit 0faa21eb4e33ec1a3212468dcb6db3a668cf8fc8