Commit graph

1543 commits

Author SHA1 Message Date
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
1eff14539f
debian: Vendor PyMuPDf when building Debian package
Install PyMuPDF under ./dangerzone/vendor, right before we build the
.deb package. We vendor PyMuPDF just for Debian, since the provided
versions don't have OCR support enabled.

Currently, we don't use PyMuPDf on the host, but this will change once
we fully implement the on-host conversion feature.

Refs #625
2024-10-15 14:58:06 +03:00
Alex Pyrgiotis
91fbc466c5
Add an import preference for vendored packages
Prefer importing packages from ./dangerzone/vendor, if there is one
there, instead of using the system ones.
2024-10-15 14:58:06 +03:00
Alex Pyrgiotis
266d6c70a7
install: Add script for vendoring PyMuPDF
Add a script that installs PyMuPDF under ./dangerzone/vendor. This will
be useful in subsequent commits, for vendoring PyMuPDF when building
Debian packages.
2024-10-15 13:24:17 +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
Alex Pyrgiotis
8f71df56d9
Handle PyMuPDF 1.24.11 wheels in our Dockerfile
The PyMuPDF wheels for version 1.24.11 have changed the way they are
being built, which means we have to adapt our Dockerfile in order to
install them properly.
2024-10-15 13:08:33 +03:00
Alex Pyrgiotis
eebf10ca3d
Bump our Poetry dependencies 2024-10-15 13:04:09 +03:00
Alex Pyrgiotis
fed5e35e97
Add missing .pybuild dir in .gitignore 2024-10-15 13:04:09 +03:00
Alex Pyrgiotis
fd5aafdde9
ci: Start an Xvfb server in our CI tests
Remove the installation steps for Xvfb, since it's already included in
GitHub actions, and fire up an Xvfb server with disabled host-based
access control.

Initially, we tried to wrap our CI tests with `xvfb-run`, but any
X11 client within our Podman container failed with the following error
message:

    Authorization required, but no authorization protocol specified.

This error message is usually thrown when the X11 client does not
provide the magic cookie in the Xauthority file back to the X11 server.
In our case though, we can verify that commands in our Podman container
read the Xauthority file successfully:

    socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
    connect(3, {sa_family=AF_UNIX, sun_path=@"/tmp/.X11-unix/X99"}, 21) = -1 ECONNREFUSED (Connection refused)
    close(3)                                = 0
    socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
    getsockopt(3, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
    connect(3, {sa_family=AF_UNIX, sun_path="/tmp/.X11-unix/X99"}, 110) = 0
    getpeername(3, {sa_family=AF_UNIX, sun_path="/tmp/.X11-unix/X99"}, [124->21]) = 0
    uname({sysname="Linux", nodename="dangerzone-dev", ...}) = 0
    access("/home/runner/work/dangerzone/dangerzone/cookie", R_OK) = 0
    openat(AT_FDCWD, "/home/runner/work/dangerzone/dangerzone/cookie", O_RDONLY) = 4
    fstat(4, {st_mode=S_IFREG|0600, st_size=59, ...}) = 0
    read(4, "\1\0\0\rfv-az1915-957\0\299\0\22MIT-MAGIC"..., 4096) = 59
    read(4, "", 4096)                       = 0
    close(4)                                = 0
    fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
    fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
    fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
    poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
    writev(3, [{iov_base="l\0\v\0\0\0\0\0\0\0\0\0", iov_len=12}, {iov_base="", iov_len=0}], 2) = 12
    recvfrom(3, 0x55a5635c0050, 8, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
    poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN}])
    recvfrom(3, "\0@\v\0\0\0\20\0", 8, 0, NULL, NULL) = 8
    recvfrom(3, "Authorization required, but no a"..., 64, 0, NULL, NULL) = 64
    write(2, "Authorization required, but no a"..., 64Authorization required, but no authorization protocol specified
    ) = 64

The line with the magic cookie is:

    read(4, "\1\0\0\rfv-az1915-957\0\299\0\22MIT-MAGIC"..., 4096) = 59

Since we are not sure why we are not allowed access to the X11 server
from the Podman container, we decided to disable host-based access
controls altogether. This is not a security concern, since this X11
session is a remote one. However, we shouldn't run tests this way in dev
machines.

Fixes #949
2024-10-14 17:02:43 +03:00
Alexis Métaireau
ee991cab6b
Use github issue templates
Fixes #920
2024-10-10 09:57:38 +02:00
Alexis Métaireau
5d98f802ea
CI: Replace set-output by environment variables
Fixes #944
2024-10-09 18:16:28 +02:00
Alex Pyrgiotis
93b960cd23
Bump H2ORestart to version 0.6.6
Follow Debian's lead [1] and bump this version to 0.6.6. This change
should bring some stability improvements to our CI tests as well.

[1]: https://packages.debian.org/unstable/text/libreoffice-h2orestart
2024-10-07 18:36:06 +03:00
bnewc
752eff02d8
Prevent user from using illegal characters in output filename
Add some checks in the Dangerzone GUI and CLI that will prevent a user
from mistakenly adding illegal characters in the output filename.
2024-10-07 18:04:47 +03:00
Alex Pyrgiotis
275189587e
tests: Test termination logic under default conditions
Do not use the `provider_wait` fixture in our termination logic tests,
and switch instead to the `provider` fixture, which instantiates a
typical isolation provider.

The `provider_wait` fixture's goal was to emulate how would the process
behave if it had fully spawned. In practice, this masked some
termination logic issues that became apparent in the WIP on-host
conversion PR. Now that we kill the spawned process via its process
group, we can just use the default isolation provider in our tests.

In practice, in this PR we just do `s/provider_wait/provider`, and
remove some stale code.
2024-10-07 17:37:57 +03:00
Alex Pyrgiotis
b5130b08b6
tests: Improve Dummy provider tests
Add a fixture that returns our stock Dummy provider. Also, explicitly
use a blocking Dummy provider (`DummyWait`) for a specific test case.
This will prove useful when we stop using the `provider_wait` variant of
our isolation providers in the next commits.
2024-10-07 17:37:42 +03:00
Alex Pyrgiotis
dc8a22c8e7
Fix the dummy provider
Make the dummy provider behave a bit more like the other providers, with
a proper function and termination logic. This will be helpful soon in
the tests.
2024-10-07 17:37:42 +03:00
Alex Pyrgiotis
d6410652cb
Kill the process group when conversion terminates
Instead of killing just the invoked Podman/Docker/qrexec process, kill
the whole process group, to make sure that other components that have
been spawned die as well. In the case of Podman, conmon is one of the
processes that lingers, so that's one way to kill it.
2024-10-07 17:37:39 +03:00
Alex Pyrgiotis
b9a3dd63ad
Always start conversion process in new session
Start the conversion process in a new session, so that we can later on
kill the process group, without killing the controlling script (i.e.,
the Dangezone UI). This should not affect the conversion process in any
other way.
2024-10-07 17:27:38 +03:00
Alex Pyrgiotis
8d856ff4c3
ci: Add Intel macOS runner
GitHub provides an Intel macOS runner as `macos-13`. Add it alongside
our M1 macOS runner (`macos-latest`), in order to cover all of our
target environments.
2024-10-07 12:48:03 +03:00
Alex Pyrgiotis
95660c3ec7
Make dummy tests faster
Remove the unnecessary sleep command in our dummy tests, which made them
run much slower.
2024-10-07 12:48:03 +03:00
Alex Pyrgiotis
58b4659ffd
Improve .gitattributes
It seems that we need to specify that Python files have LF line endings
on Windows environments, else they will get converted to CRLF. If this
happens, then the container image we build in this environment will have
Python files with wrong endings, and tests will break.

Refs #838 for previous attempt.
2024-10-07 12:48:02 +03:00
Alex Pyrgiotis
a001b5497c
Add release note for Debian packages 2024-10-02 16:49:46 +02:00
Alex Pyrgiotis
eb2d114ea7
install: Catch version errors when building DEBs
Make sure that the Debian package we build conforms to the expected
naming scheme else, it's possible that something is off. A scenario
we've encountered is bumping `share/version.txt`, but not
`debian/changelog`, which would create a Debian package with an older
version.
2024-10-02 16:49:46 +02:00
Alex Pyrgiotis
a32522f6c8
debian: Bump version to 0.7.1
Add a dummy entry in debian/changelog, to signal that the latest
Dangerzone version is 0.7.1.
2024-10-02 16:49:46 +02: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
3e434d08d1
Always use our own seccomp policy as a default.
As per Etienne Perot's comment on #908:

> Then it seems to me like it would be easy to simply apply this seccomp
profile under all container runtimes (since there's no reason why the
same image and the same command-line would call different syscalls under
different container runtimes).
2024-10-02 14:12:48 +02:00
Alexis Métaireau
eb10082a62
Merge branch 'hotfix-0.7.1' into main 2024-10-01 15:16:25 +02:00
Alexis Métaireau
eee405e29e
Update download links to use 0.7.1 2024-10-01 12:58:11 +02:00
Alex Pyrgiotis
2371d1c23c
Add release note for containerd graph driver
Fixes #933
2024-09-30 15:45:15 +03:00
Alexis Métaireau
9117ba5d6c
Bump version to 0.7.1 2024-09-30 12:40:06 +02:00
Alexis Métaireau
fb2f4ce695
Add 0.7.1 to the CHANGELOG 2024-09-30 12:38:41 +02:00
Alex Pyrgiotis
4423fc6232
Handle multiple image IDs in the image-ids.txt file.
Docker Desktop 4.30.0 uses the containerd image store by default, which
generates different IDs for the images, and as a result breaks the logic
we are using when verifying the images IDs are present.

Now, multiple IDs can be stored in the `image-id.txt` file.

Fixes #933
2024-09-30 12:34:34 +02:00
Alex Pyrgiotis
bd2dc0ea3c
Pin gVisor to the last working release
Temporarily pin gVisor to the latest working version
(`release-20240826.0`), since the latest one breaks our container image.

Refs #928
2024-09-27 12:55:59 +03:00
Alex Pyrgiotis
27d201a95b
container: Avoid pop-ups on Windows
Avoid window pop-ups on Windows systems, by using the `startupinfo`
argument of `subprocess.run`.
2024-09-27 12:55:46 +03:00
JKarasti
791444cd5d
Windows installer: Allow choosing installation directory during install
Switch to using `WixUI_InstallDir` dialog set in the windows installer and add the `WIXUI_INSTALLDIR` property it needs to let user choose where Dangerzone is installed.

resolves #148
2024-09-24 15:04:43 +03:00
Dustin Alandzes
830e551567
Fix broken link in the README.md (/about.html is now /about/) 2024-09-24 15:01:54 +03:00
Alex Pyrgiotis
1e30767278
docs: Update gVisor design doc
Update the gVisor design doc, to better reflect the current state of the
gVisor integration. More specifically, the following have changed since
this design doc was merged:

* We have dropped the need for the `SETFCAP` capability.
* We have added the SELinux label `container_engine_t` to the outer
  container.
2024-09-23 12:15:28 +03:00
Alexis Métaireau
c3c7fbbc20
Fix wrong container-runtime detection on Linux
Use "podman" when on Linux, and "docker" otherwise.

This commit also adds a text widget to the interface, showing the actual
content fo the error that happened, to help debug further if needed.

Fixes #212
2024-09-18 15:04:57 +02:00
amnak613
9b9e265b11
Added try excepts for unhandled exceptions
Fixes #776
2024-09-17 16:26:46 +03:00
Alexis Métaireau
d7f80965b1
Remove useless imports and fstrings from build-rpm.py 2024-09-11 16:20:28 +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
d90f81e772
Ensure that the expected Python version is used 2024-09-10 22:28:31 +03:00
Alex Pyrgiotis
2e3ec0cece
Always bust builder cache building the container image
Do not use by default the builder cache, when we build the Dangerzone
container image. This way, we can always have the most fresh result when
we run the `./install/common/build-image.py` command.

If a dev wants to speed up non-release builds, we add the `--use-cache`
flag to use the builder cache.
2024-09-10 22:28:31 +03:00
Etienne Perot
73b0f8b7d4
Disable gVisor's DirectFS feature.
DirectFS is enabled by default in gVisor to improve I/O performance,
but comes at the cost of enabling the `openat(2)` syscall (with severe
restrictions, but still). As Dangerzone is not performance-sensitive,
and that it is desirable to guarantee for the document conversion
process to not open any files (to mimic some of what SELinux provides),
might as well disable it by default.

See #226.
2024-09-10 17:32:31 +03:00
Alexis Métaireau
2237f76219
Rename make lint-apply to make format 2024-09-10 15:55:16 +02:00
Alexis Métaireau
0c9f426b68
Do not throw on malformed Desktop Entries on Linux.
This just skips the malformed entry when it's found.

Fixes #899
2024-09-10 15:25:45 +02:00