Commit graph

465 commits

Author SHA1 Message Date
deeplow
4d8e4c53e3
sort imports with isort linter 2022-08-22 10:15:26 +01:00
deeplow
90a51a0004
apply black lint tool's suggestions 2022-08-22 10:03:59 +01:00
deeplow
6fc0e2c15f
add Makefile with linters (black & isort)
- borrowed makefile self-help code from SecureDrop
- considered windows dev env case: GNU make available via Cygwin
2022-08-22 10:03:57 +01:00
deeplow
b73efb30ae
add isort as dev dependency 2022-08-22 10:03:49 +01:00
deeplow
bd51947fca
deduplicate container_args
The container arguments was duplicated. This could potentially lead
to refactor errors. For example security arg could be added in one
container call but forgotten to be added in a second one.
2022-08-22 09:24:40 +01:00
deeplow
345ac8a396
podman run with --userns=keep-id to mount volumes
Moving to /dangerzone was failing with insuficient permissions:

    Invalid JSON returned from container: PermissionError: [Errno
    13] Permission denied: '/dangerzone/page-3.rgb'

A previous approach was removed in commit 805222. It started with
root at first in a wrapper script and then dropped these
priviledges which running the script.

`--userns=keep-id` solves the mountpoint issues as it maps the user
starting the container is mapped in the container [1].

[1]: https://www.redhat.com/sysadmin/user-flag-rootless-containers
2022-08-22 08:44:00 +01:00
deeplow
21a9a6c98c
running dangerzone without root in container
There was previously a user created in the container but it was not
used via the dockerfile RUN directive (as pointed out by
gmarmstrong[1]).

Fixes #169

[1]: https://github.com/freedomofpress/dangerzone/issues/169#issue-1268399245
2022-08-22 08:43:58 +01:00
deeplow
2d4bad680e
drop all linux kernel capabilities from containers
These are not needed in order to convert documents in the
dangerzone containers.
2022-08-22 08:43:56 +01:00
deeplow
a02801cc2d
add again the --security-opt flag
Had previously been added but removed in a refactor (see commit
488dca).
2022-08-22 08:43:32 +01:00
Guthrie McAfee Armstrong
e63c931800
Remove psutil, termcolor, and wmi dependencies 2022-08-19 15:16:19 +01:00
Guthrie McAfee Armstrong
575c4b2302
Remove macholib dependency (fix #145) 2022-08-19 15:16:16 +01:00
Guthrie McAfee Armstrong
395eba0a74
Remove requests dependency 2022-08-19 15:16:14 +01:00
Guthrie McAfee Armstrong
0b9e91434d
Update poetry.lock 2022-08-19 15:15:00 +01:00
deeplow
f2f2e6f143
in cli-mode banner should be printed instead
Was calling color spillover to the adjacent text if the banner was
logged instead of printed. Since this is the CLI version, it could
make sense to have this printed.
2022-08-18 12:20:26 +01:00
deeplow
67d91be81a
replace prints with logging
fixes #144: printing non-ascii characters in a macOS application
opened directly from finder would sometimes lead to an error
message in /var/log/system.log similar to this:

  Failed to execute script 'dangerzone' due to unhandled exception:
  'ascii' codec can't encode character '\u201c' in position 1:
  ordinal not in range(128)
2022-08-18 12:07:23 +01:00
deeplow
c2a140807f
simplify get_resource_path logic
Simplifying the logic for obtaining resource paths by using pathlib
instead inspect.

Co-authored-by: Guthrie McAfee Armstrong <git@gmarmstrong.dev>
Based on commit bbce13d
2022-08-16 17:06:43 +01:00
deeplow
4d9f729654
fix win build failure due to package autodiscovery
Setuptools was trying to autodiscover packages with an error
described in #178 [1]. Adding the packages arg to setup() solves
it. In the future we may want to centralize the package list in
a pyproject.toml, once it goes out of beta in setuptools [2].

Fixes #178

[1]: https://github.com/freedomofpress/dangerzone/issues/178
[2]: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html?highlight=package%20discovery#package-discovery-and-namespace-packages
2022-08-16 14:29:11 +01:00
deeplow
80a3543202
Merge branch 'update-ci' 2022-08-05 11:38:20 +01:00
deeplow
c713801e77
remove EOL ubuntu versions 2022-08-04 19:23:41 +01:00
deeplow
47364c200c
disable debian 12 while waiting on upsteam fix
More details at https://github.com/freedomofpress/dangerzone/issues/172
2022-07-20 10:23:58 +01:00
deeplow
72f5200de5
Merge pull request #171 from montoyamoraga/patch-1
delete repetition of word "of"
2022-07-15 05:13:09 -04:00
deeplow
a04ed076cb
update distros in CI (deprecate old & add new ver.) 2022-07-11 11:01:19 +01:00
aarón montoya-moraga
9733e562f9
delete repetition of word "of" 2022-06-26 01:59:54 -04:00
Micah Lee
d8adb2e9cc
Properly cleanup after conversion 2021-12-14 12:29:55 -08:00
Micah Lee
17e1121e57
Version bump to 0.3.1 and update changelog 2021-12-14 10:27:41 -08:00
Micah Lee
ccb5d85afa
Fix "open with" Dangerzone in macOS 2021-12-14 10:21:42 -08:00
Micah Lee
c19d8aad86
Add icon to Windows binaries 2021-12-14 09:12:20 -08:00
Micah Lee
20c0edec4a
Merge pull request #142 from firstlookmedia/131-packaging
Switch Windows packaging to cx_Freeze
2021-12-13 16:46:33 -08:00
Micah Lee
0cf514eba7
Fix version path 2021-12-13 15:32:35 -08:00
Micah Lee
a710178d75
Add package scripts for windows 2021-12-13 15:25:41 -08:00
Micah Lee
bc8b9d62b4
Switch Windows package from pyinstaller to cx_freeze 2021-12-13 15:23:45 -08:00
Micah Lee
2206df0422
Merge pull request #141 from firstlookmedia/137-docker-exception
Ignore exceptions when there's an error deleting an old container image
2021-12-13 11:37:44 -08:00
Micah Lee
c312420aba
Ignore exceptions when there's an error deleting an old container image 2021-12-13 11:37:19 -08:00
Micah Lee
8044f22768
Merge pull request #140 from firstlookmedia/136-gui-ocr
In GUI only use OCR if the OCR box is checked
2021-12-13 11:33:12 -08:00
Micah Lee
d90097e7af
In GUI only use OCR if the OCR box is checked 2021-12-13 11:32:41 -08:00
Micah Lee
1f16433b9a
Merge pull request #139 from firstlookmedia/134-move-file
Use shutil.move instead of os.rename in the final step
2021-12-13 11:18:15 -08:00
Micah Lee
a81b2043cf
Use shutil.move instead of os.rename in case files are on different disks 2021-12-13 10:55:55 -08:00
Micah Lee
b4cae37874
Deploy ubuntu on 21.04 2021-11-30 18:01:57 -08:00
Micah Lee
3a337eee1f
Refactor deployments 2021-11-30 17:31:57 -08:00
Micah Lee
defe9ef9dc
Deploy different versions of fedora, debian, and ubuntu from the same container 2021-11-30 17:08:24 -08:00
Micah Lee
4ecaad18fd
Force ruby 2.7 2021-11-30 16:45:39 -08:00
Micah Lee
6f6dae109f
Fix typo in CircleCI deploy 2021-11-30 16:04:36 -08:00
Micah Lee
8f22c4d680
Simplify CircleCI deployment and display debug output 2021-11-30 15:56:32 -08:00
Micah Lee
57f7ed26f8
Typo in release docs, and add to changelog 2021-11-30 15:04:15 -08:00
Micah Lee
369ffe6cea
Allow opening external links in the WaitingWidget label 2021-11-30 14:59:05 -08:00
Micah Lee
89cf07d2b1
Remove obsolete status bar action 2021-11-30 09:59:05 -08:00
Micah Lee
9f5fe7612c
Remove support for tiff because graphicsmagick is failing to convert it 2021-11-29 17:14:01 -08:00
Micah Lee
8757ff8296
Only add --platform linux/amd64 in docker, not in podman 2021-11-29 16:44:30 -08:00
Micah Lee
1d08e12f5e
When running containers, explictly use path to python3 and .py file, and --force when deleting the obsolete image 2021-11-29 16:33:55 -08:00
Micah Lee
7e74371edd
Exit cli with -1 on failure 2021-11-29 16:22:22 -08:00