diff --git a/.github/ISSUE_TEMPLATE/bug_report_linux.yml b/.github/ISSUE_TEMPLATE/bug_report_linux.yml index 1ab1ea9..89de676 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_linux.yml +++ b/.github/ISSUE_TEMPLATE/bug_report_linux.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - Hi, and thanks for taking the time to open this bug report. + Hi, and thanks for taking the time to open this bug report. - type: textarea id: what-happened attributes: @@ -21,7 +21,7 @@ body: label: Linux distribution description: | What is the name and version of your Linux distribution? You can find it out with `cat /etc/os-release` - placeholder: Ubuntu 20.04.6 LTS + placeholder: Ubuntu 22.04.5 LTS validations: required: true - type: textarea diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 108cb37..cd888a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,8 +33,6 @@ jobs: strategy: matrix: include: - - distro: ubuntu - version: "20.04" - distro: ubuntu version: "22.04" - distro: ubuntu diff --git a/.github/workflows/check_repos.yml b/.github/workflows/check_repos.yml index a6ef5e9..1992449 100644 --- a/.github/workflows/check_repos.yml +++ b/.github/workflows/check_repos.yml @@ -25,8 +25,6 @@ jobs: version: "24.04" # noble - distro: ubuntu version: "22.04" # jammy - - distro: ubuntu - version: "20.04" # focal - distro: debian version: "trixie" # 13 - distro: debian @@ -34,18 +32,6 @@ jobs: - distro: debian version: "11" # bullseye steps: - - name: Add Podman repo for Ubuntu Focal - if: matrix.distro == 'ubuntu' && matrix.version == 20.04 - run: | - apt-get update && apt-get -y install curl wget gnupg2 - . /etc/os-release - sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' \ - > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" - wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- \ - | apt-key add - - apt update - apt-get install python-all -y - - name: Add packages.freedom.press PGP key (gpg) if: matrix.version != 'trixie' run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c2d0ad..fc89978 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,8 +186,6 @@ jobs: strategy: matrix: include: - - distro: ubuntu - version: "20.04" - distro: ubuntu version: "22.04" - distro: ubuntu @@ -255,8 +253,6 @@ jobs: strategy: matrix: include: - - distro: ubuntu - version: "20.04" - distro: ubuntu version: "22.04" - distro: ubuntu @@ -383,8 +379,6 @@ jobs: strategy: matrix: include: - - distro: ubuntu - version: "20.04" - distro: ubuntu version: "22.04" - distro: ubuntu diff --git a/BUILD.md b/BUILD.md index 6fc817a..4a7c51e 100644 --- a/BUILD.md +++ b/BUILD.md @@ -34,29 +34,6 @@ Install dependencies: - - - - -
-
- :memo: Expand this section if you are on Ubuntu 20.04 (Focal). -
- - The default Python version that ships with Ubuntu Focal (3.8) is not - compatible with PySide6, which requires Python 3.9 or greater. - - You can install Python 3.9 using the `python3.9` package. - - ```bash - sudo apt install -y python3.9 - ``` - - Poetry will automatically pick up the correct version when running. -
-
- - ```sh sudo apt install -y podman dh-python build-essential make libqt6gui6 \ pipx python3 python3-dev diff --git a/CHANGELOG.md b/CHANGELOG.md index 28aa945..791abcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ 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)) ## [0.8.1](https://github.com/freedomofpress/dangerzone/compare/v0.8.1...0.8.0) diff --git a/INSTALL.md b/INSTALL.md index a8e5d2e..3784e0e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -25,7 +25,6 @@ Dangerzone is available for: - Ubuntu 24.10 (oracular) - Ubuntu 24.04 (noble) - Ubuntu 22.04 (jammy) -- Ubuntu 20.04 (focal) - Debian 13 (trixie) - Debian 12 (bookworm) - Debian 11 (bullseye) @@ -36,34 +35,6 @@ Dangerzone is available for: ### Ubuntu, Debian - - - - -
-
- :memo: Expand this section if you are on Ubuntu 20.04 (Focal). -
- - Dangerzone requires [Podman](https://podman.io/), which is not available - through the official Ubuntu Focal repos. To proceed with the Dangerzone - installation, you need to add an extra OpenSUSE repo that provides Podman to - Ubuntu Focal users. You can follow the instructions below, which have been - copied from the [official Podman blog](https://podman.io/new/2021/06/16/new.html): - - ```bash - sudo apt-get update && sudo apt-get install curl wget gnupg2 -y - . /etc/os-release - sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' \ - > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" - wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- \ - | sudo apt-key add - - sudo apt update - ``` - -
-
-
diff --git a/dangerzone/gui/main_window.py b/dangerzone/gui/main_window.py index 80301e1..bb87371 100644 --- a/dangerzone/gui/main_window.py +++ b/dangerzone/gui/main_window.py @@ -55,13 +55,6 @@ about updates.

HAMBURGER_MENU_SIZE = 30 -WARNING_MESSAGE = """\ -

Warning: Ubuntu Focal systems and their derivatives will -stop being supported in subsequent Dangerzone releases. We encourage you to upgrade to a -more recent version of your operating system in order to get security updates.

-""" - - def load_svg_image(filename: str, width: int, height: int) -> QtGui.QPixmap: """Load an SVG image from a filename. @@ -192,6 +185,9 @@ class MainWindow(QtWidgets.QMainWindow): header_layout.addWidget(self.hamburger_button) header_layout.addSpacing(15) + # Content widget, contains all the window content except waiting widget + self.content_widget = ContentWidget(self.dangerzone) + if self.dangerzone.isolation_provider.should_wait_install(): # Waiting widget replaces content widget while container runtime isn't available self.waiting_widget: WaitingWidget = WaitingWidgetContainer(self.dangerzone) @@ -201,9 +197,6 @@ class MainWindow(QtWidgets.QMainWindow): self.waiting_widget = WaitingWidget() self.dangerzone.is_waiting_finished = True - # Content widget, contains all the window content except waiting widget - self.content_widget = ContentWidget(self.dangerzone) - # Only use the waiting widget if container runtime isn't available if self.dangerzone.is_waiting_finished: self.waiting_widget.hide() @@ -626,17 +619,6 @@ class ContentWidget(QtWidgets.QWidget): self.dangerzone = dangerzone self.conversion_started = False - self.warning_label = None - if platform.system() == "Linux": - # Add the warning message only for ubuntu focal - os_release_path = Path("/etc/os-release") - if os_release_path.exists(): - os_release = os_release_path.read_text() - if "Ubuntu 20.04" in os_release or "focal" in os_release: - self.warning_label = QtWidgets.QLabel(WARNING_MESSAGE) - self.warning_label.setWordWrap(True) - self.warning_label.setProperty("style", "warning") - # Doc selection widget self.doc_selection_widget = DocSelectionWidget(self.dangerzone) self.doc_selection_widget.documents_selected.connect(self.documents_selected) @@ -662,8 +644,6 @@ class ContentWidget(QtWidgets.QWidget): # Layout layout = QtWidgets.QVBoxLayout() - if self.warning_label: - layout.addWidget(self.warning_label) # Add warning at the top layout.addWidget(self.settings_widget, stretch=1) layout.addWidget(self.documents_list, stretch=1) layout.addWidget(self.doc_selection_wrapper, stretch=1) @@ -894,22 +874,16 @@ class SettingsWidget(QtWidgets.QWidget): self.safe_extension_name_layout.setSpacing(0) self.safe_extension_name_layout.addWidget(self.safe_extension_filename) self.safe_extension_name_layout.addWidget(self.safe_extension) - # FIXME: Workaround for https://github.com/freedomofpress/dangerzone/issues/339. - # We should drop this once we drop Ubuntu Focal support. - if hasattr(QtGui, "QRegularExpressionValidator"): - QRegEx = QtCore.QRegularExpression - QRegExValidator = QtGui.QRegularExpressionValidator - else: - QRegEx = QtCore.QRegExp # type: ignore [assignment] - QRegExValidator = QtGui.QRegExpValidator # type: ignore [assignment] - self.dot_pdf_validator = QRegExValidator(QRegEx(r".*\.[Pp][Dd][Ff]")) + self.dot_pdf_validator = QtGui.QRegularExpressionValidator( + QtCore.QRegularExpression(r".*\.[Pp][Dd][Ff]") + ) if platform.system() == "Linux": illegal_chars_regex = r"[/]" elif platform.system() == "Darwin": illegal_chars_regex = r"[\\]" else: illegal_chars_regex = r"[\"*/:<>?\\|]" - self.illegal_chars_regex = QRegEx(illegal_chars_regex) + self.illegal_chars_regex = QtCore.QRegularExpression(illegal_chars_regex) self.safe_extension_layout = QtWidgets.QHBoxLayout() self.safe_extension_layout.addWidget(self.save_checkbox) self.safe_extension_layout.addWidget(self.safe_extension_label) diff --git a/dangerzone/util.py b/dangerzone/util.py index bcad701..1fa3025 100644 --- a/dangerzone/util.py +++ b/dangerzone/util.py @@ -58,7 +58,7 @@ def get_tessdata_dir() -> pathlib.Path: pathlib.Path("/usr/share/tessdata/"), # on some Debian pathlib.Path("/usr/share/tesseract/tessdata/"), # on Fedora pathlib.Path("/usr/share/tesseract-ocr/tessdata/"), # ? (documented) - pathlib.Path("/usr/share/tesseract-ocr/4.00/tessdata/"), # on Ubuntu Focal + pathlib.Path("/usr/share/tesseract-ocr/4.00/tessdata/"), # on Debian Bullseye pathlib.Path("/usr/share/tesseract-ocr/5/tessdata/"), # on Debian Trixie ] diff --git a/dev_scripts/env.py b/dev_scripts/env.py index ff4e489..a739004 100755 --- a/dev_scripts/env.py +++ b/dev_scripts/env.py @@ -60,24 +60,6 @@ Run Dangerzone in the end-user environment: """ -# NOTE: For Ubuntu 20.04 specifically, we need to install some extra deps, mainly for -# Podman. This needs to take place both in our dev and end-user environment. See the -# corresponding note in our Installation section: -# -# https://github.com/freedomofpress/dangerzone/blob/main/INSTALL.md#ubuntu-debian -DOCKERFILE_UBUNTU_2004_DEPS = r""" -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get install -y python-all python3.9 curl wget gnupg2 \ - && rm -rf /var/lib/apt/lists/* -RUN . /etc/os-release \ - && sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$VERSION_ID/ /' \ - > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" \ - && wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_$VERSION_ID/Release.key -O- \ - | apt-key add - -""" - # XXX: overcome the fact that ubuntu images (starting on 23.04) ship with the 'ubuntu' # user by default https://bugs.launchpad.net/cloud-images/+bug/2005129 # Related issue https://github.com/freedomofpress/dangerzone/pull/461 @@ -115,15 +97,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends dh-python make build-essential \ git {qt_deps} pipx python3 python3-pip python3-venv dpkg-dev debhelper python3-setuptools \ && rm -rf /var/lib/apt/lists/* -# NOTE: `pipx install poetry` fails on Ubuntu Focal, when installed through APT. By -# installing the latest version, we sidestep this issue. -RUN bash -c 'if [[ "$(pipx --version)" < "1" ]]; then \ - apt-get update \ - && apt-get remove -y pipx \ - && apt-get install -y --no-install-recommends python3-pip \ - && pip install pipx \ - && rm -rf /var/lib/apt/lists/*; \ - else true; fi' +RUN pipx install poetry RUN apt-get update \ && apt-get install -y --no-install-recommends mupdf thunar \ && rm -rf /var/lib/apt/lists/* @@ -573,12 +547,7 @@ class Env: # See https://github.com/freedomofpress/dangerzone/issues/482 qt_deps = "libqt6gui6 libxcb-cursor0" install_deps = DOCKERFILE_BUILD_DEV_DEBIAN_DEPS - if self.distro == "ubuntu" and self.version in ("20.04", "focal"): - qt_deps = "libqt5gui5 libxcb-cursor0" # Ubuntu Focal has only Qt5. - install_deps = ( - DOCKERFILE_UBUNTU_2004_DEPS + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS - ) - elif self.distro == "ubuntu" and self.version in ("22.04", "jammy"): + if self.distro == "ubuntu" and self.version in ("22.04", "jammy"): # Ubuntu Jammy misses a dependency to `libxkbcommon-x11-0`, which we can # install indirectly via `qt6-qpa-plugins`. qt_deps += " qt6-qpa-plugins" @@ -642,11 +611,7 @@ class Env: install_cmd = "dnf install -y" else: install_deps = DOCKERFILE_BUILD_DEBIAN_DEPS - if self.distro == "ubuntu" and self.version in ("20.04", "focal"): - install_deps = ( - DOCKERFILE_UBUNTU_2004_DEPS + DOCKERFILE_BUILD_DEBIAN_DEPS - ) - elif self.distro == "ubuntu" and self.version in ("22.04", "jammy"): + if self.distro == "ubuntu" and self.version in ("22.04", "jammy"): # Ubuntu Jammy requires a more up-to-date conmon # package (see https://github.com/freedomofpress/dangerzone/issues/685) install_deps = DOCKERFILE_CONMON_UPDATE + DOCKERFILE_BUILD_DEBIAN_DEPS diff --git a/dev_scripts/qa.py b/dev_scripts/qa.py index ef2b321..12526a2 100755 --- a/dev_scripts/qa.py +++ b/dev_scripts/qa.py @@ -251,29 +251,6 @@ Install dependencies:
- - - - -
-
- :memo: Expand this section if you are on Ubuntu 20.04 (Focal). -
- - The default Python version that ships with Ubuntu Focal (3.8) is not - compatible with PySide6, which requires Python 3.9 or greater. - - You can install Python 3.9 using the `python3.9` package. - - ```bash - sudo apt install -y python3.9 - ``` - - Poetry will automatically pick up the correct version when running. -
-
- - ```sh sudo apt install -y podman dh-python build-essential make libqt6gui6 \ pipx python3 python3-dev @@ -1035,11 +1012,6 @@ class QADebianTrixie(QADebianBased): VERSION = "trixie" -class QAUbuntu2004(QADebianBased): - DISTRO = "ubuntu" - VERSION = "20.04" - - class QAUbuntu2204(QADebianBased): DISTRO = "ubuntu" VERSION = "22.04" diff --git a/dodo.py b/dodo.py index 2022ffa..4584b74 100644 --- a/dodo.py +++ b/dodo.py @@ -9,7 +9,7 @@ from doit.action import CmdAction ARCH = "arm64" if platform.machine() == "arm64" else "i686" VERSION = open("share/version.txt").read().strip() FEDORA_VERSIONS = ["40", "41"] -DEBIAN_VERSIONS = ["bullseye", "focal", "jammy", "mantic", "noble", "trixie"] +DEBIAN_VERSIONS = ["bullseye", "jammy", "mantic", "noble", "trixie"] ### Global parameters diff --git a/install/linux/debian-vendor-pymupdf.py b/install/linux/debian-vendor-pymupdf.py index 9cb5ccc..8cdd66c 100755 --- a/install/linux/debian-vendor-pymupdf.py +++ b/install/linux/debian-vendor-pymupdf.py @@ -31,23 +31,6 @@ def main(): cmd = ["poetry", "export", "--only", "debian"] container_requirements_txt = subprocess.check_output(cmd) - # XXX: Hack for Ubuntu Focal. - # - # The `requirements.txt` file is generated from our `pyproject.toml` file, and thus - # specifies that the minimum Python version is 3.9. This was to accommodate to - # PySide6, which is installed in macOS / Windows via `poetry` and works with Python - # 3.9+. [1] - # - # The Python version in Ubuntu Focal though is 3.8. This generally was not much of - # an issue, since we used the package manager to install dependencies. However, it - # becomes an issue when we want to vendor the PyMuPDF package, using `pip`. In order - # to sidestep this virtual limitation, we can just change the Python version in the - # generated `requirements.txt` file in Ubuntu Focal from 3.9 to 3.8. - # - # [1] https://github.com/freedomofpress/dangerzone/pull/818 - if sys.version.startswith("3.8"): - container_requirements_txt = container_requirements_txt.replace(b"3.9", b"3.8") - logger.info(f"Vendoring PyMuPDF under '{args.dest}'") # We prefer to call the CLI version of `pip`, instead of importing it directly, as # instructed here: diff --git a/install/linux/install-podman-ubuntu-focal.sh b/install/linux/install-podman-ubuntu-focal.sh deleted file mode 100755 index 34351ec..0000000 --- a/install/linux/install-podman-ubuntu-focal.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Development script for installing Podman on Ubuntu Focal. Mainly to be used as -# part of our CI pipelines, where we may install Podman on environments that -# don't have sudo. - -set -e - -if [[ "$EUID" -ne 0 ]]; then - SUDO=sudo -else - SUDO= -fi - -provide() { - $SUDO apt-get update - $SUDO apt-get install curl wget gnupg2 -y - source /etc/os-release - $SUDO sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' \ - > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" - wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- \ - | $SUDO apt-key add - - $SUDO apt-get update -qq -y -} - -install() { - $SUDO apt-get -qq --yes install podman - podman --version -} - -if [[ "$1" == "--repo-only" ]]; then - provide -elif [[ "$1" == "" ]]; then - provide - install -else - echo "Unexpected argument: $1" - echo "Usage: $0 [--repo-only]" - exit 1 -fi