mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-07 05:51:50 +02:00
Compare commits
7 commits
784f94d896
...
b6bdf43983
Author | SHA1 | Date | |
---|---|---|---|
b6bdf43983 | |||
![]() |
68f8338d20 | ||
![]() |
d561878e03 | ||
![]() |
59e1666c28 | ||
![]() |
95d7d8a4d9 | ||
![]() |
ed2791bbbc | ||
![]() |
2ba247e09c |
11 changed files with 56 additions and 35 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Build dev environments
|
name: Build dev environments
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *" # Run every day at 00:00 UTC.
|
- cron: "0 0 * * *" # Run every day at 00:00 UTC.
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ jobs:
|
||||||
version: "20.04"
|
version: "20.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "22.04"
|
version: "22.04"
|
||||||
- distro: ubuntu
|
|
||||||
version: "23.10"
|
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "24.04"
|
version: "24.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
|
|
2
.github/workflows/check_push.yml
vendored
2
.github/workflows/check_push.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Check branch conformity
|
name: Check branch conformity
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prevent-fixup-commits:
|
prevent-fixup-commits:
|
||||||
|
|
2
.github/workflows/check_repos.yml
vendored
2
.github/workflows/check_repos.yml
vendored
|
@ -23,8 +23,6 @@ jobs:
|
||||||
version: "24.10" # oracular
|
version: "24.10" # oracular
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "24.04" # noble
|
version: "24.04" # noble
|
||||||
- distro: ubuntu
|
|
||||||
version: "23.10" # mantic
|
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "22.04" # jammy
|
version: "22.04" # jammy
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
|
|
57
.github/workflows/ci.yml
vendored
57
.github/workflows/ci.yml
vendored
|
@ -1,8 +1,9 @@
|
||||||
name: Tests
|
name: Tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "2 0 * * *" # Run every day at 02:00 UTC.
|
- cron: "2 0 * * *" # Run every day at 02:00 UTC.
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -24,7 +25,24 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
should-run:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
run-workflow: ${{ steps.check.outputs.run-workflow }}
|
||||||
|
steps:
|
||||||
|
- id: check
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
echo "run-workflow=true" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" != "refs/heads/main" ]]; then
|
||||||
|
echo "run-workflow=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "run-workflow=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
run-lint:
|
run-lint:
|
||||||
|
needs: should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: debian:bookworm
|
image: debian:bookworm
|
||||||
|
@ -43,6 +61,8 @@ jobs:
|
||||||
# This is already built daily by the "build.yml" file
|
# This is already built daily by the "build.yml" file
|
||||||
# But we also want to include this in the checks that run on each push.
|
# But we also want to include this in the checks that run on each push.
|
||||||
build-container-image:
|
build-container-image:
|
||||||
|
needs: should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -67,6 +87,8 @@ jobs:
|
||||||
python3 ./install/common/build-image.py
|
python3 ./install/common/build-image.py
|
||||||
|
|
||||||
download-tessdata:
|
download-tessdata:
|
||||||
|
needs: should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
name: Download and cache Tesseract data
|
name: Download and cache Tesseract data
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -91,7 +113,10 @@ jobs:
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: download-tessdata
|
needs:
|
||||||
|
- download-tessdata
|
||||||
|
- should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
env:
|
env:
|
||||||
DUMMY_CONVERSION: 1
|
DUMMY_CONVERSION: 1
|
||||||
steps:
|
steps:
|
||||||
|
@ -121,7 +146,10 @@ jobs:
|
||||||
macOS:
|
macOS:
|
||||||
name: "macOS (${{ matrix.arch }})"
|
name: "macOS (${{ matrix.arch }})"
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
needs: download-tessdata
|
needs:
|
||||||
|
- download-tessdata
|
||||||
|
- should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -149,9 +177,12 @@ jobs:
|
||||||
run: poetry run make test
|
run: poetry run make test
|
||||||
|
|
||||||
build-deb:
|
build-deb:
|
||||||
|
needs:
|
||||||
|
- should-run
|
||||||
|
- build-container-image
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
name: "build-deb (${{ matrix.distro }} ${{ matrix.version }})"
|
name: "build-deb (${{ matrix.distro }} ${{ matrix.version }})"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build-container-image
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -159,8 +190,6 @@ jobs:
|
||||||
version: "20.04"
|
version: "20.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "22.04"
|
version: "22.04"
|
||||||
- distro: ubuntu
|
|
||||||
version: "23.10"
|
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "24.04"
|
version: "24.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
|
@ -221,7 +250,10 @@ jobs:
|
||||||
install-deb:
|
install-deb:
|
||||||
name: "install-deb (${{ matrix.distro }} ${{ matrix.version }})"
|
name: "install-deb (${{ matrix.distro }} ${{ matrix.version }})"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build-deb
|
needs:
|
||||||
|
- build-deb
|
||||||
|
- should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -229,8 +261,6 @@ jobs:
|
||||||
version: "20.04"
|
version: "20.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "22.04"
|
version: "22.04"
|
||||||
- distro: ubuntu
|
|
||||||
version: "23.10"
|
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "24.04"
|
version: "24.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
|
@ -277,7 +307,10 @@ jobs:
|
||||||
build-install-rpm:
|
build-install-rpm:
|
||||||
name: "build-install-rpm (${{ matrix.distro }} ${{matrix.version}})"
|
name: "build-install-rpm (${{ matrix.distro }} ${{matrix.version}})"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build-container-image
|
needs:
|
||||||
|
- build-container-image
|
||||||
|
- should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
distro: ["fedora"]
|
distro: ["fedora"]
|
||||||
|
@ -343,6 +376,8 @@ jobs:
|
||||||
needs:
|
needs:
|
||||||
- build-container-image
|
- build-container-image
|
||||||
- download-tessdata
|
- download-tessdata
|
||||||
|
- should-run
|
||||||
|
if: needs.should-run.outputs.run-workflow == 'true'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -350,8 +385,6 @@ jobs:
|
||||||
version: "20.04"
|
version: "20.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "22.04"
|
version: "22.04"
|
||||||
- distro: ubuntu
|
|
||||||
version: "23.10"
|
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
version: "24.04"
|
version: "24.04"
|
||||||
- distro: ubuntu
|
- distro: ubuntu
|
||||||
|
|
3
.github/workflows/scan.yml
vendored
3
.github/workflows/scan.yml
vendored
|
@ -1,8 +1,9 @@
|
||||||
name: Scan latest app and container
|
name: Scan latest app and container
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *' # Run every day at 00:00 UTC.
|
- cron: '0 0 * * *' # Run every day at 00:00 UTC.
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
|
@ -11,7 +11,6 @@ an isolated environment. It will be installed automatically when installing Dang
|
||||||
Dangerzone is available for:
|
Dangerzone is available for:
|
||||||
- Ubuntu 24.10 (oracular)
|
- Ubuntu 24.10 (oracular)
|
||||||
- Ubuntu 24.04 (noble)
|
- Ubuntu 24.04 (noble)
|
||||||
- Ubuntu 23.10 (mantic)
|
|
||||||
- Ubuntu 22.04 (jammy)
|
- Ubuntu 22.04 (jammy)
|
||||||
- Ubuntu 20.04 (focal)
|
- Ubuntu 20.04 (focal)
|
||||||
- Debian 13 (trixie)
|
- Debian 13 (trixie)
|
||||||
|
|
|
@ -142,9 +142,6 @@ runsc_argv = [
|
||||||
"--rootless=true",
|
"--rootless=true",
|
||||||
"--network=none",
|
"--network=none",
|
||||||
"--root=/home/dangerzone/.containers",
|
"--root=/home/dangerzone/.containers",
|
||||||
# Disable DirectFS for to make the seccomp filter even stricter,
|
|
||||||
# at some performance cost.
|
|
||||||
"--directfs=false",
|
|
||||||
]
|
]
|
||||||
if os.environ.get("RUNSC_DEBUG"):
|
if os.environ.get("RUNSC_DEBUG"):
|
||||||
runsc_argv += ["--debug=true", "--alsologtostderr=true"]
|
runsc_argv += ["--debug=true", "--alsologtostderr=true"]
|
||||||
|
|
|
@ -696,8 +696,6 @@ class Env:
|
||||||
DOCKERFILE_CONMON_UPDATE + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
DOCKERFILE_CONMON_UPDATE + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
||||||
)
|
)
|
||||||
elif self.distro == "ubuntu" and self.version in (
|
elif self.distro == "ubuntu" and self.version in (
|
||||||
"23.10",
|
|
||||||
"mantic",
|
|
||||||
"24.04",
|
"24.04",
|
||||||
"noble",
|
"noble",
|
||||||
"24.10",
|
"24.10",
|
||||||
|
@ -784,8 +782,6 @@ class Env:
|
||||||
# package (see https://github.com/freedomofpress/dangerzone/issues/685)
|
# package (see https://github.com/freedomofpress/dangerzone/issues/685)
|
||||||
install_deps = DOCKERFILE_CONMON_UPDATE + DOCKERFILE_BUILD_DEBIAN_DEPS
|
install_deps = DOCKERFILE_CONMON_UPDATE + DOCKERFILE_BUILD_DEBIAN_DEPS
|
||||||
elif self.distro == "ubuntu" and self.version in (
|
elif self.distro == "ubuntu" and self.version in (
|
||||||
"23.10",
|
|
||||||
"mantic",
|
|
||||||
"24.04",
|
"24.04",
|
||||||
"noble",
|
"noble",
|
||||||
"24.10",
|
"24.10",
|
||||||
|
|
|
@ -978,11 +978,6 @@ class QAUbuntu2204(QADebianBased):
|
||||||
VERSION = "22.04"
|
VERSION = "22.04"
|
||||||
|
|
||||||
|
|
||||||
class QAUbuntu2310(QADebianBased):
|
|
||||||
DISTRO = "ubuntu"
|
|
||||||
VERSION = "23.10"
|
|
||||||
|
|
||||||
|
|
||||||
class QAUbuntu2404(QADebianBased):
|
class QAUbuntu2404(QADebianBased):
|
||||||
DISTRO = "ubuntu"
|
DISTRO = "ubuntu"
|
||||||
VERSION = "24.04"
|
VERSION = "24.04"
|
||||||
|
|
|
@ -4,7 +4,6 @@ from cx_Freeze import Executable, setup
|
||||||
with open("share/version.txt") as f:
|
with open("share/version.txt") as f:
|
||||||
version = f.read().strip()
|
version = f.read().strip()
|
||||||
|
|
||||||
packages = ["dangerzone", "dangerzone.gui"]
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="dangerzone",
|
name="dangerzone",
|
||||||
|
@ -12,10 +11,13 @@ setup(
|
||||||
# On Windows description will show as the app's name in the "Open With" menu. See:
|
# On Windows description will show as the app's name in the "Open With" menu. See:
|
||||||
# https://github.com/freedomofpress/dangerzone/issues/283#issuecomment-1365148805
|
# https://github.com/freedomofpress/dangerzone/issues/283#issuecomment-1365148805
|
||||||
description="Dangerzone",
|
description="Dangerzone",
|
||||||
packages=packages,
|
|
||||||
options={
|
options={
|
||||||
"build_exe": {
|
"build_exe": {
|
||||||
"packages": packages,
|
# Explicitly specify pymupdf.util module to fix building the executables
|
||||||
|
# with cx_freeze. See https://github.com/marcelotduarte/cx_Freeze/issues/2653
|
||||||
|
# for more details.
|
||||||
|
# TODO: Upgrade to cx_freeze 7.3.0 which should include a fix.
|
||||||
|
"packages": ["dangerzone", "dangerzone.gui", "pymupdf.utils"],
|
||||||
"excludes": ["test", "tkinter"],
|
"excludes": ["test", "tkinter"],
|
||||||
"include_files": [("share", "share"), ("LICENSE", "LICENSE")],
|
"include_files": [("share", "share"), ("LICENSE", "LICENSE")],
|
||||||
"include_msvcr": True,
|
"include_msvcr": True,
|
||||||
|
|
|
@ -164,6 +164,7 @@ class IsolationProviderTermination:
|
||||||
terminate_proc_mock = mocker.patch.object(
|
terminate_proc_mock = mocker.patch.object(
|
||||||
provider, "terminate_doc_to_pixels_proc", return_value=None
|
provider, "terminate_doc_to_pixels_proc", return_value=None
|
||||||
)
|
)
|
||||||
|
kill_pg_orig = base.kill_process_group
|
||||||
kill_pg_mock = mocker.patch(
|
kill_pg_mock = mocker.patch(
|
||||||
"dangerzone.isolation_provider.base.kill_process_group", return_value=None
|
"dangerzone.isolation_provider.base.kill_process_group", return_value=None
|
||||||
)
|
)
|
||||||
|
@ -178,6 +179,7 @@ class IsolationProviderTermination:
|
||||||
|
|
||||||
# Reset the function to the original state.
|
# Reset the function to the original state.
|
||||||
provider.terminate_doc_to_pixels_proc = terminate_proc_orig # type: ignore [method-assign]
|
provider.terminate_doc_to_pixels_proc = terminate_proc_orig # type: ignore [method-assign]
|
||||||
|
base.kill_process_group = kill_pg_orig
|
||||||
|
|
||||||
# Really kill the spawned process, so that it doesn't linger after the tests
|
# Really kill the spawned process, so that it doesn't linger after the tests
|
||||||
# complete.
|
# complete.
|
||||||
|
|
Loading…
Reference in a new issue