Commit graph

885 commits

Author SHA1 Message Date
Alex Pyrgiotis
586240ec22
ci: Add CI tests for missing platforms
Use the `dev_scripts/env.py` script to run CI tests for some platforms
we couldn't run before.
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
ea99b1e1dd
Narrow down installed system packages
Narrow down the system packages that we install in dev environments. The
rationale is that we get most of the Python dependencies from Poetry, so
we don't need to install them from the system as well.

The packages that we do need to install are non-Python ones, and this
commit adds some that were missing: make, python3-stdeb. Also, we
explicitly install the base Qt5 libraries, in order to get the graphics
and C++ libraries that we can't get from PyPI.
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
f16b42bb18
Ignore dev_scripts/envs for tests/lints
Ignore the `dev_scripts/envs` folder when running tests or linting code,
as it may contain files that are not owned by the current user. In this
case, we've seen that pytest/black etc. fail.

This typically happens when the user has run Dangerzone in a
containerized environment (see #286), and Podman created a directory
with files owned by the user in the nested container.
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
e3431c7ac2
dev_scripts: Add documentation for the QA script
Add a short explanation of what is the purpose of the QA script, and
what it uses underneath.

Refs #287
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
14a7ca1ae5
dev_scripts: Add QA script
Add a script that makes the user go through the QA steps for a supported
Dangerzone platform, and may optionally run them automatically, if the
user agrees.

Closes #287
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
feec73c60c
dev_scripts: Add design document for env.py
Add a design document for `dev_scripts/env.py`, which is a script that
creates Dangerzone environments for various Linux distros. In this
design document, we explain various architectural decisions that we have
taken for this script, as well as how it works under the hood, what are
its shortcomings, etc.

Refs #286
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
b51691416f
dev_scripts: Introduce script for Dangerzone envs
Introduce `dev_scripts/env.py`, which is a script for building
Dangerzone environments for various Linux distros, and running commands
in them.

Closes #286
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
4eead90c00
install: Fail early when image build fails 2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
624d480cca
install: Do not create intermediate tarfile for container
Skip the creation of the `share/container.tar` file, since it's not used
anywhere. Instead, pipe our `docker/podman save` invocations to `gzip`
directly, which will compress the tarfile on the fly. This saves both
time and disk space.
2023-01-16 18:48:08 +02:00
Alex Pyrgiotis
a0503c8c40
install: Do not create Debian source package twice 2023-01-16 18:48:08 +02:00
Alex Pyrgiotis
c36443b01e
Add note for python-all 2023-01-16 18:48:08 +02:00
deeplow
b9dc882663
CLI: prefix non-INFO logs with log type
In non-development mode, the CLI shows the user information via the INFO
log level. The message is shown directly without [INFO] as a prefix.
Otherwise it would quickly get annoying to the user seeing [INFO] on
every line of a CLI application.

However, if an error happens it's important for the user to recognize
it's an error or a warning. This commit prints the log level in these
cases.
2023-01-16 14:58:13 +00:00
deeplow
c442c443df
CLI: add missing logging format to non-dev env 2023-01-16 14:50:10 +00:00
deeplow
ad908f5d16
CLI: increase logging from ERROR to INFO level
ERROR level would only show errors and criticals and miss out on all
info-level logging.
2023-01-16 14:50:08 +00:00
deeplow
eb3fd5ae16
CLI: don't print DEBUG logs
The CLI version was mistakenly printing debug logs.
2023-01-16 14:50:06 +00:00
deeplow
c406c95cec
GUI: Add version to header bar
Fixes #219
2023-01-16 14:39:27 +00:00
deeplow
c08fddb443
Add unit test for --version 2023-01-16 14:39:25 +00:00
deeplow
fb3cb98793
Add --version flag 2023-01-16 14:39:24 +00:00
deeplow
0ab9f42dd9
Windows: fix "Open with" dialog showing dz description
The "open with" dialog on windows was showing the description of
Dangerzone instead of its app name. The issue was that on windows it
shows the description there.

Fixes #283
2023-01-16 11:38:08 +00:00
deeplow
84b8212e5d
Fix test instability: pytest in seq. podman<4.3.0
Instability in the automated tests sometimes would sometimes fail when
running "podman images --format {{.ID}}". It turns out that in versions
prior to podman 4.3.0, podman volumes (stored in
~/.local/share/contaiers) would get corrupted when multiple tests were
run in parallel.

The current solution is to wrap the test command to run sequentially in
versions prior to the fix and in parallel for versions after that.

Fixes #217
2023-01-09 11:54:24 +00:00
Ro
ffdc1425bb
Update Debian, Fedora instructions, add QubesOS instructions. 2023-01-09 11:13:12 +00:00
Alex Pyrgiotis
fc313d8744
ci: Fix convert-test-docs step
Fix the failing convert-test-docs step, by pinning Poetry to version
1.2.2. This way, we avoid a bug in Poetry 1.3 [1], which was recently
released on PyPI.

[1]: https://github.com/python-poetry/poetry/issues/7184

Closes #292
2022-12-15 18:32:48 +02:00
Alex Pyrgiotis
147caca524
ci: Fix failing build-debian-bookworm step
Debian has removed the python-all package from its Bookworm repos, which
breaks our CI tests. Looking into why python-all is required in the
first place, we found that it's an artificial stdeb requirement [1],
prior to 0.9.1 versions

The only platform affected by this issue is Ubuntu Focal, so our
solution is to install python-all specifically for that platform.

Finally, we further simplify our build tasks [2] (on Debian-like
distros) by not letting dh-python run tests when building the packages.
Running the tests has some issues after all:

1. It requires installing all the runtime dependencies of Dangerzone,
   since it uses `python -m unittest discover` underneath.
2. It doesn't aid in the stability of the package, since unittest cannot
   run test cases for PyTest.

[1]: https://github.com/astraw/stdeb/issues/153
[2]: https://github.com/freedomofpress/dangerzone/issues/292#issuecomment-1349967888
2022-12-15 18:30:19 +02:00
Alex Pyrgiotis
06f92747ab
ci: Fix the failing run-lint step
Fix the failing run-lint test by switching to Debian Bookworm for this
step, and installing Poetry 1.2.2 from the official repos. This way, we
circumvent a bug [1] in Poetry 1.3 (released on PyPI) and we greatly
simplify this step [2].

[1]: https://github.com/python-poetry/poetry/issues/7184
[2]: https://github.com/freedomofpress/dangerzone/issues/292#issuecomment-1351368122
2022-12-15 18:29:35 +02:00
Alex Pyrgiotis
e5ec5a279c
Separate Poetry dependencies into groups
Create two separate groups for Poetry dependencies:

1. test: Dependencies required for testing Dangerzone.
2. lint: Dependencies required for linting the code with `make lint`.
2022-12-15 18:28:10 +02:00
deeplow
b82808016a
README: make screenshots smaller and side-by-side 2022-12-07 10:51:04 +00:00
deeplow
c8707e8d4a
Update README screenshots for 0.4.0 release 2022-12-02 11:26:21 +00:00
Erik Moeller
fc5edb42be
Merge pull request #280 from freedomofpress/prepare-0.4.0
Prepare artifact links for 0.4.0
2022-12-01 16:50:56 -08:00
Alex Pyrgiotis
6517c4bc5f
Replace references to github.com/firstlookmedia
Replace references to github.com/firstlookmedia with
github.com/freedomofpress, since the ownership of these repos has been
transferred to the Freedom of the Press Foundation.
2022-12-01 22:31:42 +02:00
Erik Moeller
ed41dd7646
Merge pull request #281 from freedomofpress/fix-kudu
Use the proper codename for Ubuntu Kinetic Kudu
2022-12-01 11:24:53 -08:00
Alex Pyrgiotis
8658753d57
Use the proper codename for Ubuntu Kinetic Kudu
In a previous commit, we used the wrong codename for Ubuntu 22.10
"Kinetic Kudu". Instead of "kudu", we should use "kinetic".
2022-12-01 21:18:40 +02:00
deeplow
361001579e
Bump version to v0.4.0 2022-12-01 15:58:01 +00:00
Alex Pyrgiotis
03823bbd29
Update the QA section in RELEASE.md
Update the QA section in the RELEASE.md, based on the latest changes on
our main branch.
2022-12-01 17:53:48 +02:00
Alex Pyrgiotis
31402e0b97
Prepare artifact links for 0.4.0 2022-12-01 17:42:18 +02:00
deeplow
eb38c39557
Changelog: add exit confirmation feature 2022-12-01 15:24:19 +00:00
deeplow
aa1476d59b
Replace exit() with sys.exit() to work on Windows
Windows was complaining that 'exit' is not defined.
2022-12-01 15:03:34 +00:00
deeplow
766c455929
Windows: persist "Open safe documents after converting" setting
Now that safe PDFs can open on Windows right after conversion
(implemented in commit 5b2fefd), we need to save/load the "Open safe
documents after converting" setting.
2022-12-01 15:02:31 +00:00
deeplow
99f23216d6
Fix limited PATH in produced .exe and .msi
Cx-Freeze 6.13.0 limited the PATH of the build executables, making it so
Dangerzone couldn't find Docker through shutil.which().

More information on the issue is available at:
https://github.com/marcelotduarte/cx_Freeze/issues/1674
2022-12-01 14:58:30 +00:00
deeplow
5761255b56
Fix Python version in Windows build scripts
Windows python build scripts were still referencing the old python 3.9
version, whereas 3.10 is the currently used one in the dev environment.
2022-12-01 14:58:29 +00:00
deeplow
642d86899b
Fix timeout message: replace pdfseparate with pdftk 2022-12-01 14:51:52 +00:00
Alex Pyrgiotis
1ad6b59bb1
Support Ubuntu 22.10 "Kinetic Kudu"
Add support for the newly released Ubuntu 22.10 "Kinetic Kudu".

Closes #265
2022-12-01 01:05:00 +02:00
deeplow
cb75cfd958
Update changelog with 'open with' functionality 2022-11-30 12:51:02 +00:00
deeplow
7e42994f81
Prevent user from adding files from multiple dirs
Allowing this would lead to several UI edge-cases related to where the
files would be saved. Avoiding this is the easiest solution at the
moment.

In the future we should consider other options.
2022-11-30 12:49:20 +00:00
deeplow
06797ab626
Prevent adding duplicate documents
It was possible that users would add duplicate documents via 'open with
Dangerzone'. This would lead to unexpected situations and preventing it
both in the CLI and the GUI solves those issues.
2022-11-30 12:49:18 +00:00
deeplow
65d0b7a0d0
Allow adding more docs via 'open_with' while in settings
Handle the case where a user has already added some documents (either
through 'open with' or via Dangerzone 'select documents' button) and
then they want to add some more via the 'open_with' dialog.

It updates the settings to reflect the newly added documents and blocks
the user from adding them if a conversion is already in progress.
2022-11-30 12:49:17 +00:00
deeplow
cb68ba7d1c
Centralize 'document adding' in ContentWidget
Makes the ContentWidget a choke-point, where we can allow or prevent
adding more documents and where we can ensure that newly selected
documents are added immediately to the DangerzoneGui class.

Logically, the application flow should not change in any way.
2022-11-30 12:49:16 +00:00
deeplow
ce5558b5a2
Fix "open with" on macOS for single files
Fixes partially #268
2022-11-30 12:49:14 +00:00
deeplow
af5f7c70d3
Quit dangerzone on macOS when window is closed
Closing windows on macOS would not actually close Dangerzone. Now that
it is a single-window program, it makes sense for it to close
immediately.

Fixes #271
2022-11-29 16:01:27 +00:00
deeplow
466d83129e
Increase minimum window width for macOS
The save group box would get partially trimmed when running in macOS
this appears to be due to differences in rendering fonts and widget
sizes.

Refs #270
2022-11-29 15:56:09 +00:00
deeplow
d582e25606
Changelog: update for 0.4.0 release 2022-11-25 08:27:37 +00:00