Commit graph

1078 commits

Author SHA1 Message Date
deeplow
ed298ec5b0
BUILD.md fix typo: dz-dvm is not a template 2023-08-29 19:29:43 +01:00
deeplow
ab3293ff70
BUILD.md replace deprecated cmd qvm-copy-to-vm
qvm-copy-to-vm since a long time doesn't respect the qube name
provided. Instead it is enforced by the dom0 policy prompt. This is
probably a leftover from a command ran in dom0, where this command
actually works.
2023-08-29 19:29:41 +01:00
deeplow
688bfe056b
BUILD.md: cd into dangerzone/ after cloning 2023-08-29 19:29:31 +01:00
deeplow
831c3250c2
Add overview table of qubes 2023-08-29 19:20:36 +01:00
deeplow
4f2de90f93
Add overview table of qubes 2023-08-24 14:50:53 +01:00
deeplow
c3cdca977f
Qubes alpha: bump fedora version (37 -> 38) 2023-08-24 14:42:54 +01:00
deeplow
8ae88eb10a
Ensure updates checkbox updated after updates accepted
Ensure the status of the toggle updates checkbox is updated, after the user is
prompted to enable updates.
2023-08-23 16:46:45 +01:00
deeplow
8221a56c7d
Revert "Propagate "update check" prompt to UI checkbox"
This reverts commit 3915a86642502b673aa0e47931823acbe66f1043.
2023-08-23 16:46:44 +01:00
deeplow
1695cc7a6c
Propagate "update check" prompt to UI checkbox
The "check for updates" button wasn't showing up immediately as checked
as soon as the user is prompted for checking updates. This fixes that.

Fixes #513
2023-08-23 16:46:33 +01:00
deeplow
89365b585c
Add tests documentation 2023-08-22 16:11:44 +01:00
deeplow
9ec9cc5f87
Replace armor guards that indicate isolated output 2023-08-22 16:11:41 +01:00
deeplow
a0bcd12635
Large test run: hide traceback to avoid spam
Some tests are expected to fail. To avoid having potentially thousands
of tracebacks of the failed docs at the end, we're deactivating that
reporting.
2023-08-22 16:11:39 +01:00
deeplow
fa215063ee
Add logging for second container 2023-08-22 16:11:38 +01:00
deeplow
75369cf621
Adapt code so it works for reporting script
Reporting script now parses JunitXML instead of a series of
".container_log" files. The script in in changed submodule.

Additionally it makes failed tests actually fail so that this is
recorded in the JunitXML report.
2023-08-22 16:11:36 +01:00
deeplow
eb16285790
Replace container output command prefix ">>>"
In the junitxml this prefix would look ugly ("&gt&gt&gt") because it has
to escape any non-xml tags.
2023-08-22 16:11:35 +01:00
deeplow
48b2e7bc3c
Log command to debug log for traceback purposes
Log commands so we can trace back which errors / outputs are from each
command.
2023-08-22 16:11:34 +01:00
deeplow
b73ce5bf6a
Add large test logic and documentation
Adds a large pool of document that can and should be used prior to a
release to understand effects of the new release over a real-world
scenario.

Documents are stored in an external git LFS repo under
`tests/test_docs_large` and currently it's about 11K documents gathered
from multiple PDF readers and office suite's test sets.

Documentation on how to run the tests is under
`docs/developer/TESTING.md`
2023-08-22 16:11:31 +01:00
deeplow
f41cefde1d
Add "armor" around conversion log
Add GPG-styled "armor" around conversion logs

    -----CONVERSION LOG START-----
    Creator:         Writer
    Producer:        LibreOffice 6.4
    [...]
    -----CONVERSION LOG END-----
2023-08-22 16:11:28 +01:00
deeplow
9f1abe2836
Replace non-printable ascii in conversion log
Certain characters may be abused. Particularly ANSI escape codes.
Solution inspired by Qubes OS's hardening of ther RPC mechanism [1]:

> Terminal control characters are a security issue, which in worst case
> amount to arbitrary command execution. In the simplest case this
> requires two often found codes: terminal title setting (which puts
> arbitrary string in the window title) and title repo reporting (which
> puts that string on the shell's standard input. [sic]
>
>  -- qvm-run.rst [2]

[1]: e005836286
[2]: c70da44702/doc/manpages/qvm-run.rst (L126)
2023-08-22 16:11:27 +01:00
deeplow
95cef8cf0a
Containers: capture conversion logs
Store the conversion log to a file (captured-output.txt) in the
container and when in development mode, have its output displayed on the
terminal output.
2023-08-22 16:11:26 +01:00
deeplow
e2accc2da1
Ignore large tests when doing "make test" 2023-08-22 16:11:24 +01:00
deeplow
d6bce4dec5
Qubes: close qrexec stdin and stout
Ensure a server cannon keep the client hannging if more data than
necessary is sent. This applies to container and the Qubes
implmentation.
2023-08-22 16:11:23 +01:00
deeplow
874b8865e2
Qubes: strategy for capturing conversion logs
Use qrexec stdout to send conversion data (pixels) and stderr to send
conversion progress at the end of the conversion. This happens
regardless of whether or not the conversion is in developer mode or not.

It's the client that decides if it reads the debug data from stderr or
not. In this case, it only reads it if developer mode is enabled.
2023-08-22 16:11:20 +01:00
Alex Pyrgiotis
00adf223a5
Add release requirements for Apple account 2023-08-22 12:05:40 +03:00
Alex Pyrgiotis
404c49874b
Prefer grabbing the altool password from the keychain
Closes #522
2023-08-22 12:05:40 +03:00
Alex Pyrgiotis
098e532bd2
dev_scripts: Ditch sudo requirement for Docker
We don't tend to use Docker for development tasks in Linux, since we
have Podman for that. In MacOS and Windows, we do use Docker, but
typically without sudo.

Make our MacOS / Windows dev tasks non-interactive, by ditching the
`sudo` invocation.

Closes #519
2023-08-22 12:05:40 +03:00
deeplow
e512ba2b6a
Updater dialog: make "yes" the default button
Fixes #507
2023-08-21 13:07:05 +01:00
Erik Moeller
5143103b96
Minor tweaks: grammar, fragment links 2023-08-21 13:05:52 +01:00
deeplow
f5b5751546
Adds minimal install advice on README.md
Makes it clear that one needs to install Docker for Desktop to use Dangerzone
on Mac or Windows and Podman on linux. The app itself will warn the user about
this, but we should state the prerequisites more clearly upfront.

Mentions mac and windows in INSTALL.md so that anyone reading this page does
not wrongly assume that Dangerzone is a Linux-only app.

Fixes #475
2023-08-21 13:05:50 +01:00
deeplow
8d05bcc10f
Update windows certificate in build-app.bat 2023-08-21 13:04:14 +01:00
Alex Pyrgiotis
2fa56282a6
Update references to 0.4.2 artifacts 2023-08-08 18:40:06 +03:00
deeplow
1837c826a6
Fix Qubes section from INSTALL.md
In Qubes by default the conversion happens in containers just like
other systems. This removes the mention that it used VMs by default.
2023-08-07 19:02:58 +01:00
deeplow
e8b28d6f87
Explicitly import html.parser for Cx_Freeze to build
The markdown dependency uses importlib to monkeypatch 'html.parser'
[1]. Due to this approach 'html.parser' is never explicitly stated
as a dependency. This works fine in most cases, since it's part of
the python standard lib. But on Windows the build tool (CxFreeze)
ships in the .exe only the modules needed. And because html.parser
is never mentioned, it fails with an error (see issue #501).

Fixes #501

[1]: https://github.com/Python-Markdown/markdown/blob/master/markdown/htmlparser.py#L29
2023-08-05 17:09:42 +01:00
deeplow
b7e212efd9
Add python3-pyside2.qtsvg dependency to debian builds
When the updater was added in commit 5b17f75047 [1], it it had missed
the dependencies on Debian.

[1]: 5b17f75047
2023-08-05 17:02:54 +01:00
deeplow
356f835d32
env.py: make env run in GUI mode (--no-gui otherwise)
Now that we have GUI tests, it makes more sense to have running with
the X11 socket mounted in the environment than not.
2023-08-05 17:02:26 +01:00
Alex Pyrgiotis
e3a8a651f1
Disable HWP / HWPX conversion on MacOS M1 / Qubes
The HWP / HWPX conversion feature does not work on the following
platforms:

* MacOS with Apple Silicon CPU
* Native Qubes OS

For this reason, we need to:

1. Disable it on the GUI side, by not allowing the user to select these
   files.
2. Throw an error on the isolation provider side, in case the user
   directly attempts to convert the file (either through CLI or via
   "Open With").

Refs #494
Refs #498
2023-08-05 16:50:49 +01:00
Alex Pyrgiotis
bc83341d2a
conversion: Detect when LibreOffice silently fails
Sometimes, LibreOffice returns with status code 0, but in reality, it
fails. It doesn't create a file, and Dangerzone does not detect this.
What happens next is that it fails in the next command, and throws an
unrelated error.

Detect that LibreOffice fails, by checking if the output file exists,
after the PDF conversion.
2023-08-05 16:50:47 +01:00
Alex Pyrgiotis
6736fb0153
Factor out MIME type detection
Factor out the MIME type detection logic, so that we can use it both in
Qubes and containers.
2023-08-05 16:50:35 +01:00
Alex Pyrgiotis
03df60db5f
Always pull base image when building ours
Always pull the base container image (alpine:latest) before building our
own container image. Else, in an environments that we haven't touched
for a while, an older image may be used.
2023-08-02 13:47:59 +03:00
Alex Pyrgiotis
0296844e36
Bump version to 0.4.2 2023-08-02 13:43:05 +03:00
Alex Pyrgiotis
4828299c99
Update changelog 2023-08-02 13:43:04 +03:00
Alex Pyrgiotis
664e0c1477
Update our release instructions
Update our release instructions in the following ways:

1. Make sure to check the Python dependencies / version before the
   release.
2. Make sure to upload the final container.tar.gz image as a release
   artifact.
2023-08-02 13:43:03 +03:00
deeplow
e2718c6f64
Update changelog with HWP support 2023-08-01 14:37:15 +01:00
Moon Sungjoon
075475c306
Add test files for hwp/hwpx (base64 encoded)
Add extra files and base64 encode externally contributed docs. This
prevents the accidental opening of such documents, since they couldn't
be rebuit by the Dangerzone developers to ensure their safety.
2023-08-01 14:37:14 +01:00
Moon Sungjoon
fa22e96af7
Clean up HWP/HWPX MIME types
Use the MIME types actually used by the `file` command, which was
recently changed for the detection of the HWPX format [1].

application/hwp+zip -> application/x-hwp+zip

But the HWPX format includes a 'mimetype' file, which contains the
MIME type string "application/hwp+zip", so that was left so because
it may be possible to detect it as "application/hwp+zip".

[1]: ceef7ead3a
2023-08-01 14:35:28 +01:00
Moon Sungjoon
a453c890a0
Fix dynamic loading of LibreOffice extensions
HWPX MIME type is recognized as 'application/zip' with current version of file command (file-5.44).
It will be recognized as 'application/hwp+zip' when new version of file is released.

For a temporary fix, when MIME type of file is 'application/zip',
check the file type again (without the MIME option).
And then check if it's 'Zip data (MIME type "application/hwp+zip"?)' or not.
2023-08-01 14:28:36 +01:00
deeplow
d16961bed6
Security: Dynamically load libreoffice extension (PoC)
Only load the LibreOffice extension for opening hwp/hwpx when it is
actually needed. Adding an extension to libreoffice may allow for it to
run arbitrary code. This makes it trust more scalable by trusting
LibreOffice extensions only for the filetypes which they target.

Reasoning
---------

Assuming a malicious `.oxt` extension this means that the extension has
arbitrary code execution in the container. While this is not an
existential threat in itself, we should not expose every Dangerzone user
to it. This is achieved by dynamically loading the extension at runtime
only when needed.

This ensures that a compromised extension will in its least malicious
form be able to modify the visual content of any hancom office files but
not *every file*. In the more malicious version, if the code execution
manages to do a container escape, this will only affect users that have
converted a Hancom office file.
2023-08-01 14:28:34 +01:00
Moon Sungjoon
3e895adbab
Add hwp hwpx support
hwp/hwpx has several custom MIME types

.hwp:
 - application/x-hwp
 - application/haansofthwp
 - application/vnd.hancom.hwp

.hwpx:
 - application/haansofthwpx
 - application/vnd.hancom.hwpx,
 - application/hwp+zip

Fixes #243
2023-08-01 14:27:18 +01:00
Moon Sungjoon
d8cc24cebe
container: Add H2ORestart for HWP/HWPX support
H2ORestart is a LibreOffice extension which adds Hancom HWP/HWPX (Hangul Word Processor)
supports for LibreOffice. This format is widely used in South Korea.

Version: v0.5.7
Extension Repository: https://github.com/ebandal/H2Orestart/releases
2023-08-01 14:07:51 +01:00
Alex Pyrgiotis
76a1a885f5
Force Podman use the overlay storage driver
Force Podman to use the overlay storage driver in our Dangerzone
environments. We have seen that in certain cases, Podman may opt to use
the vfs storage driver instead, which is more space-intensive.

Closes #489
2023-08-01 15:18:24 +03:00