deeplow
93f17b3166
Specialize DocumentFilenameException() for disambiguation
...
All filename-related exceptions were of class DocumentFilenameException.
This made it difficult to disambiguate them. Specializing them makes it
it easier for tests to detect which exception in particular we want to
verify.
2022-11-14 09:04:23 +00:00
deeplow
d71e230173
Update document state exclusively in convert()
...
The document's state update is better update in the convert() function.
This is because this function is always called for the conversion
progress regardless of the frontend.
2022-11-14 09:03:50 +00:00
deeplow
65ac0d19c3
Add an identifier to each document
...
With multiple input documents it is possible only one of them has
issues. Mentioning the document id can help debug.
2022-11-14 09:03:36 +00:00
deeplow
6d2fdf0afe
Deduplicate container output parsing (stdout_callback)
...
The container output logging logic was in both the CLI and the GUI.
This change moves the core parsing logic to container.py.
Since the code was largely the same, now cli does need to specify
a stdout_callback since all the necessary logging already happens.
The GUI now only adds an stdout_callback to detect if there was an
error during the conversion process.
2022-11-14 08:54:02 +00:00
deeplow
2d587f4082
Parallel cli bulk conversions via threading
...
Initial parallel document conversion: creates a pool of N threads
defined by the setting 'parallel_conversions'. Each thread calls
convert() on a document.
2022-11-14 08:54:00 +00:00
deeplow
f9b564be03
Security: cli wildcard injection mitigation
...
Wildcard arguments like `*` can lead to security vulnerabilities
if files are maliciously named as would-be parameters. In the following
scenario if a file in the current directory was named '--help', running
the following command would show the help.
$ dangerzone-cli *
By checking if parameters also happen to be files, we mitigate this
risk and have a chance to warn the user.
2022-11-14 08:53:38 +00:00
deeplow
981716ccff
Sequential bulk document support in cli
...
Basic implementation of bulk document support in dangerzone-cli.
Usage: dangerzone-cli [OPTIONS] doc1.pdf doc2.pdf
2022-11-14 08:51:00 +00:00
Alex Pyrgiotis
5a3a46cd46
Support Click 7.x callback handling
...
Support Click version 7.x and below, which inspect the number of
arguments a callback handler supports.
Refs #206
2022-11-10 16:35:48 +02:00
deeplow
649e427486
Make DangerzoneGui a subclass of DangerzoneCore
...
Simplify state sharing by having all dangerzone core logic in one
single class instead of two.
2022-10-27 13:44:16 +01:00
deeplow
dca290fb6b
Rename gui.common.GuiCommon class to gui.logic.DangerzoneGui
...
Rename the `gui.common` module and `gui.common.GuiCommon` class
to `gui.logic` and `gui.logic.DangerzoneGui` respectively. We keep as is
the original names of the variables that hold instances of this class,
since they will change in subsequent commits.
This change is part of the initial refactor to make the DangerzoneGui
class handle the GUI logic of the Dangerzone project.
2022-10-27 13:44:15 +01:00
deeplow
cb8130042e
Rename global_common.GlobalCommon class to logic.Dangerzone
...
Rename the `global_common` module and `global_common.GlobalCommon` class
to `logic` and `logic.Dangerzone` respectively. Also rename variables
that hold instances of this class.
This change is part of the initial refactor to make the Dangerzone class
handle the core logic of the Dangerzone project.
2022-10-27 13:44:13 +01:00
deeplow
2bed3c10e4
Move safe PDF naming logic to document.py
...
Let the Document class suggest the default filename for the safe PDF,
based on the provided input filename, appended with the extension
`-safe.pdf`.
Previously, this logic was copy-pasted throughout the code, which made
it difficult to maintain.
2022-10-27 13:44:12 +01:00
deeplow
7aa08457bd
Always resolve relative paths in Document class
...
Make the Document class always resolve relative input/output file paths,
which are usually passed as arguments by users.
Previously, resolving relative filepaths was a job left to the
instantiators of the Document class. This was error-prone since this
conversion must happen in all the places where we instantiated the
Document class.
2022-10-27 13:44:11 +01:00
Alex Pyrgiotis
a068770ab4
Validate filename arguments through Click
...
Implement Click's callback interface and create validators for the
input/output filenames, using the logic from the Document class. This
way, we can catch user errors as early as possible.
2022-10-27 13:44:08 +01:00
deeplow
db17bd0915
Validate I/O filenames in Document class
...
Factor out the filename validation logic and move it into the Document
class. Previously, the filename validation logic was scattered across
the CLI and GUI code.
Also, introduce a new errors.py module whose purpose is to handle
document-related errors, by providing:
* A special exception for them (DocumentFilenameExcpetion)
* A decorator that handles DocumentFilenameException, logs it and the
underlying cause, and exits the program gracefully.
2022-10-27 13:44:06 +01:00
deeplow
e8b56627c9
Rename select_document() function to new_window()
...
Rename select_document() to new_window() to better encapsulate the fact
that this function is opening a new Dangerzone window.
2022-10-27 13:44:04 +01:00
deeplow
e487b7f0a9
Instantiate documents with a filename
...
Avoid setting document's filename via document.filename and instead
do it via object instantiation where possible.
Incidentally this has to change some window logic. When
select_document() is called it no longer checks if there is already an
open window with no document selected yet. The user can open as many
windows with unselected documents as they want.
2022-10-27 13:44:03 +01:00
deeplow
0493aca036
Rename common.Common class to document.Document
...
Rename the `common` module and `common.Common` class to `document` and
`document.Document` respectively. Also, rename the variables that hold
instances of this class.
This change reflects the fact that the class is responsible for tracking
the state of the document. When we add bulk document conversion,
allowing us to keep track of a document's state will be key. This name
change is a step towards that.
2022-10-27 13:44:01 +01:00
deeplow
aecacee315
fix return type for container.install()
...
Note: the container installation failure is not addressed here. See
https://github.com/freedomofpress/dangerzone/issues/193
2022-09-15 13:26:05 +01:00
deeplow
82ac22e837
remove hardcoded 'docker' logging reference
...
Closes #122 as this was the last remaining hardcoded docker
reference where the code also applied to podman.
2022-09-15 12:17:22 +01:00
deeplow
57e455bbf1
remove "container" from container.py method names
...
Container-related methods recently moved to container.py no longer
need to have 'container' in their name as they are within the
container scope already.
Additonally it made it awkward to call from another module:
from .. import container
container.get_container_runtime()
2022-09-15 12:09:38 +01:00
deeplow
6202c0dba9
deduplicate container-tech-checking logic
...
The logic for detecting if we were are running on docker or podman
and identifying its respective binary were scattered across the
codebase. This centralizes it all in container.py
2022-09-15 12:09:37 +01:00
deeplow
a822870853
move global_common container logic to container.py
...
Container-specific methods in global_common class were basically
static methods. So it made sense to move these to container.py
2022-09-15 12:09:34 +01:00
deeplow
272281a29e
move to util: get_subprocess_startupinfo
2022-09-15 10:40:36 +01:00
deeplow
2d6826afa9
move ocr_languages from global_common to share/
...
ocr_languages can be treated as just a json file instead of being
in global_common. This way it is easier to maintain and makes
global_common cleaner.
2022-09-15 10:40:34 +01:00
deeplow
c0f0e7bf6a
move banner() code to cli & version() to util
...
- display_banner() was only displayed in CLI mode so it makes sense
for it to be in the CLI.
- get_version(), was mvoed to util since it is a static function
that is needed in multiple parts of the application.
2022-09-15 10:40:31 +01:00
deeplow
ce57fc0449
move get_resource_path to util.py
...
static methods that are used application-wide should belong to
the utilities python file.
inspired by @gmarmstrong's PR #166 on refactoring global_common
methods to be static and have a dzutil.py
2022-09-15 09:24:11 +01:00
deeplow
01a5e3b7ca
fix type hints for gui-common (CI would fail)
...
CI fails: https://app.circleci.com/pipelines/github/freedomofpress/dangerzone/397/workflows/cba836ed-98df-41f8-8f34-abcde5a8c015/jobs/1538
2022-09-13 13:17:20 +01:00
deeplow
f10446c309
make dz-cli exit(1) when it fails
...
Otherwise the failure cannot be detected easily by the calling
tests.
2022-09-13 13:07:13 +01:00
deeplow
377665c459
move tests to project root
2022-09-13 13:07:10 +01:00
Guthrie McAfee Armstrong
36d96ccb5c
Add unit tests
2022-09-13 13:06:59 +01:00
deeplow
1fa1b90c30
remove container after use
...
The containers and their respective volumes where not being deleted.
By adding `--rm` to the `podman run` it now removes the containers
after use along with anonymous (unnamed) volumes [1]. The same
happens in docker [2].
Fixes #196
[1]: https://docs.podman.io/en/latest/markdown/podman-run.1.html#volume-v-source-volume-host-dir-container-dir-options
[2]: https://docs.docker.com/storage/volumes/#remove-volumes
2022-08-26 10:14:43 +01:00
deeplow
6b385abfef
fix regression: --output-filename fails
...
--output-filename failed with the message:
Safe PDF filename is not writable
Bug introduced in commit 95ed346
.
2022-08-25 09:03:43 +01:00
deeplow
ec3b92a008
install_container return true when already installed
2022-08-22 12:28:50 +01:00
deeplow
f44e6521b6
better handle QFileDialog.getOpenFileName filename
2022-08-22 12:28:39 +01:00
deeplow
e0b3c5b599
resolve naming conflict: QWidget.update()
...
QWidget.update() is already a built-in Qt method [1]. This method
was unintentionally being overriden. Renamed it to update_progress
to fix it.
[1]: https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QWidget.html#PySide2.QtWidgets.PySide2.QtWidgets.QWidget.update
2022-08-22 11:13:37 +01:00
deeplow
75ce244195
type hint application wrapper monkeypatch
...
ignore method assignment. Currently mypy cannot check this.
Related upstream issues:
- https://github.com/python/mypy/issues/2427
- https://github.com/python/mypy/issues/708
2022-08-22 11:13:35 +01:00
deeplow
392c4bddb5
add blank line at end of file (black lint)
...
Satisfy the black lint tool
2022-08-22 11:12:22 +01:00
deeplow
201bf5ec03
simplify ansi disabling on mac (removing type issues)
2022-08-22 11:12:20 +01:00
deeplow
95ed34626d
fix type hint in checking if output files exist
2022-08-22 11:12:18 +01:00
deeplow
46a62c1669
fix type hints with commonn input/output filename
...
Input_filename and output_filename could be None or Str. This lead
to typing issues where the static analysis type hint tool could not
check that the type colisions would not happen in runtime.
So the logic was replaced by throwing a runtime exception if either
of these valiables is ever used without first having been set.
2022-08-22 11:12:16 +01:00
deeplow
7b46d1e3cf
fix spacing (black lint tool)
2022-08-22 11:12:14 +01:00
deeplow
f67c1c3656
fix TypeErrors "object is not subscriptable"
...
The type hint shoudld be List[] instead of list[] [1] and TypeError:
'ABCMeta' object is not subscriptable (using instead typing.Callable).
[1]: https://mail.python.org/pipermail/python-dev/2017-April/147818.html
2022-08-22 11:12:10 +01:00
deeplow
dcc0b269cd
fix typing for filename in gui_main (is optional)
2022-08-22 11:10:04 +01:00
deeplow
e76132a2f0
add typed hints to Settings dictionary
...
Originally tied to implment following PEP 589 [1] – TypedDict: Type
Hints for Dictionaries with a Fixed Set of Keys for the Settings
dict.
But this quickly turned out to very challenging without redoing the
code. So we opted instead for using the Any keyword.
[1]: https://peps.python.org/pep-0589/
2022-08-22 11:09:13 +01:00
deeplow
b1c039c4a4
add type hinting to systray (avoid circular imports)
2022-08-22 11:09:11 +01:00
deeplow
b34f7381b4
fix GlobalCommon ref. that was supposed to be Common
...
The type hints actually warned about this inconsistency.
2022-08-22 11:09:09 +01:00
deeplow
ccacf50db5
simplify resources_path logic to reolve type hint
...
The following logic was leading to type hint issues:
> inspect.getfile(inspect.currentframe())
But this code is overly complex for what it does is the same as
simply __file__. So we kill two birds with one stone, so to speak.
2022-08-22 11:09:03 +01:00
deeplow
c69f228261
handle case for no Popen.stdin
...
Similar to the previous commit (cb0f828)
2022-08-22 10:52:39 +01:00
deeplow
f99131e30c
type hints for container.py & handle no stdout
...
We added the following check as well:
+ if stdout_callback and p.stdout is not None:
Because, according to the subprocess docs[1]:
> If the stdout argument was not PIPE, this attribute is None.
In this case, it should not need to confirm that p.stdout is not
None in the mypy static analysis. However it still complained. So
we made mypy the favor and confirmed this was the case.
[1]: https://docs.python.org/3/library/subprocess.html#subprocess.Popen.stdout
2022-08-22 10:52:17 +01:00
deeplow
78daf75638
add type hint to GuiCommon app argument
2022-08-22 10:49:04 +01:00
deeplow
4aab47af38
ignore type hint to windows-only subprocess command
...
`subprocess.STARTUPINFO()` only exists in windows systems. Because
of this, in linux-based systems it was raising type hint issues
as it didn't recognize the return function.
2022-08-22 10:49:02 +01:00
deeplow
6ddd411be8
add type get_container_runtime & handle no runtime
...
There was no code to handle if at this stage the runtime existed.
This caused issues with type hints since `shutil.which()` can
return None, which had not previously been accounted for.
We did not use the opportunity to consolidate all the code for
detecting the runtime, to make this review easier.
2022-08-22 10:48:57 +01:00
deeplow
665e4d54f7
add type hints (1st pass: non problematic cases)
2022-08-22 10:33:28 +01:00
deeplow
d579a47a84
add type hints (1st pass: non problematic cases)
2022-08-22 10:33:23 +01:00
deeplow
7bac3eb6b1
remove get_resource_path() comments (too long)
...
The black lint tool complained.
2022-08-22 10:15:32 +01:00
deeplow
4d8e4c53e3
sort imports with isort linter
2022-08-22 10:15:26 +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
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
Micah Lee
d8adb2e9cc
Properly cleanup after conversion
2021-12-14 12:29:55 -08:00
Micah Lee
ccb5d85afa
Fix "open with" Dangerzone in macOS
2021-12-14 10:21:42 -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
d90097e7af
In GUI only use OCR if the OCR box is checked
2021-12-13 11:32:41 -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
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
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
Micah Lee
8052220034
Get rid of wrapper scripts in the container
2021-11-29 15:39:24 -08:00
Micah Lee
2de2b6dca5
Rename dangerzone-converter to container
2021-11-29 15:30:21 -08:00
Micah Lee
8d40555bf5
Prevent background windows from popping up for subprocess calls in Windows
2021-11-29 14:55:31 -08:00
Micah Lee
ee04570048
Specify linux/amd64 platform when running docker run
2021-11-24 17:00:33 -08:00
Micah Lee
e6d90a5729
Show more details on failure
2021-11-24 12:35:43 -08:00
Micah Lee
e5da385eef
In Windows, suppress extra window from popping up in subprocess
2021-11-24 12:25:45 -08:00
Micah Lee
cbdb741f7b
Need to keep the rename step
2021-11-23 16:28:26 -08:00
Micah Lee
7c4f35e0f8
Delete old function in global_common, and remove useless stuff from container.convert
2021-11-23 16:20:51 -08:00
Micah Lee
edbd3aa88a
Set the path in macOS, so it can find /usr/local/bin/docker
2021-11-23 16:16:55 -08:00
Micah Lee
9acfd2764e
Make the new code work in linux
2021-11-22 18:51:47 -05:00
Micah Lee
a7e0c3994d
Finish Docker Desktop flow
2021-11-22 15:02:29 -08:00
Micah Lee
a54e19fe11
Get WaitingWidget to properly check for and install the image
2021-11-22 14:37:53 -08:00
Micah Lee
83759d1a33
Delete vm-builder folder, and make build-image.sh build the dangerzone image
2021-11-22 14:23:17 -08:00
Micah Lee
42ce884419
Work on changing the WaitingWidget to check for Docker
2021-11-22 14:06:31 -08:00
Micah Lee
d1c33bfcf5
Begin ripping out VM logic, go back to Docker Desktop for Mac
2021-11-22 13:36:21 -08:00
Micah Lee
112291f82a
Remove unused dependencies
2021-11-22 11:37:05 -08:00
Micah Lee
47d6eb0d8b
Build vpnkit and hyperkit from source, remove Docker Desktop dependency to build, and add --allow-vm-login flag
2021-11-18 11:47:51 -08:00
Micah Lee
46681bc771
Start making Windows VM work with virtualbox
2021-08-09 14:05:07 -07:00
Micah Lee
173f31ff41
Start porting VM to Windows
2021-08-09 12:04:17 -07:00
Micah Lee
b82ffa2cac
Make it so windows remember if waiting has finished
2021-08-06 13:10:56 -07:00
Micah Lee
7d361955f8
Create all the dirs needed when using VM
2021-08-06 13:10:32 -07:00
Micah Lee
ea47a2e92c
Fix error message user interface
2021-08-06 12:58:02 -07:00
Micah Lee
7c756c194e
Add progress bar
2021-08-05 15:36:09 -07:00
Micah Lee
2c9787ff99
Rename TasksWidget to ConvertWidget
2021-08-05 15:08:51 -07:00
Micah Lee
5545252ca5
Refactor container to output JSON status updates, and make CLI work with it
2021-08-05 15:00:18 -07:00
Micah Lee
450320de6f
Make GUI use the new container too
2021-08-04 16:41:47 -07:00
Micah Lee
7f93c1e752
Pass the stdout from the container a line at a time back to the app
2021-08-04 16:33:15 -07:00
Micah Lee
c9c01f6e79
Remove separate dangerzone-container entry point, make CLI work with it, and refactor container code to be more DRY
2021-08-04 16:21:00 -07:00
Micah Lee
4a2c92e911
Move just the single task into its own ConvertThread object
2021-08-04 15:20:38 -07:00
Micah Lee
0b1a5b2c2a
Show waiting widget when installing the containre in Linux too
2021-08-04 15:13:48 -07:00
Micah Lee
4a4deeb64f
Add support for non-VM containers again
2021-08-04 15:02:49 -07:00
Micah Lee
588206a9e8
Start implementing built-in container in Linux, without a VM
2021-08-04 14:42:46 -07:00
Micah Lee
ee5acf64b2
Make converter handle failure properly
2021-07-30 13:01:54 -07:00
Micah Lee
5cf97b9c73
Properly close window
2021-07-27 11:23:03 -07:00
Micah Lee
acaa7a9cd1
Work with dark theme
2021-07-27 11:14:41 -07:00
Micah Lee
7fcd10e404
Move main window content into widget, and either show content or the waiting widget, but never both
2021-07-27 11:06:20 -07:00
Micah Lee
9fcb304545
Lockdown ssh, and also temporarily comment out deleting containers on ISO build
2021-07-27 10:54:17 -07:00
Micah Lee
2c2f87593c
Keep ssh tunnel open with autossh, and give root user ssh keys so unprivileged user cant access the host
2021-07-14 11:36:13 -07:00
Micah Lee
3f76211459
Fix open in Preview for macOS
2021-07-02 13:48:20 -07:00
Micah Lee
488dca4a71
Totally refactor how tasks work and how dangerzone-container works so that there is a single --convert task
2021-07-02 13:32:23 -07:00
Micah Lee
fe63689320
Remove restart from systray and replace it with new window
2021-07-02 10:17:46 -07:00
Micah Lee
0b1d8f6a3e
Skip file open events in dev mode
2021-07-02 10:10:01 -07:00
Micah Lee
ed4586a051
Suppress output from all the VM subprocesses, and make the waiting for VM output nicer
2021-07-02 10:09:34 -07:00
Micah Lee
5493292ba2
Provide the VM with the correct container name
2021-07-01 17:34:53 -07:00
Micah Lee
a7f3eb9b43
Make container mount and unmount dirs from the host
2021-07-01 17:14:48 -07:00
Micah Lee
2904d44aad
Start making it possible to execute podman inside the VM
2021-07-01 16:45:25 -07:00
Micah Lee
c7bd8a317a
Move the MainWindow widgets into the same file, and move the vm object into global_common
2021-07-01 16:06:36 -07:00
Micah Lee
e81e6ccc6c
Remove everything related to updating the container image
2021-07-01 15:56:12 -07:00
Micah Lee
1f1bb2b353
Successfully wait for VM to start, and then move on in the UI
2021-07-01 15:52:19 -07:00
Micah Lee
29a148d211
Successfully set up reverse ssh forward system, allowing the host to run commands on the guest over ssh
2021-07-01 15:32:07 -07:00
Micah Lee
1c39895206
Refactor how VM image is created to split it into different files, and write ssh-to-host.py script
2021-07-01 11:02:08 -07:00
Micah Lee
da75559e3a
Start working on ssh reverse tunnel stuff
2021-06-30 16:21:40 -07:00
Micah Lee
9158d02669
Successfully boot VM
2021-06-30 14:27:26 -07:00
Micah Lee
d9d352a680
Fix removing PDF viewer search in Mac, and make the waiting widget look better
2021-06-30 12:31:33 -07:00
Micah Lee
2dd509f980
To allow the Apple sandbox, disable finding PDF viewers on Mac
2021-06-30 12:02:45 -07:00
Micah Lee
d7cd8584f2
Split Vm class from SysTray, and make it launch hyperkit
2021-06-30 10:45:38 -07:00
Micah Lee
e8f7d96f90
Fix building VM ISO, and start implementing start_vm
2021-06-29 17:37:00 -07:00
Micah Lee
7b2211fc1f
Rename rip_docker to install/vm-builder, and start making a build script that uses it
2021-06-29 17:01:47 -07:00
Micah Lee
cf28d47ffc
Merge branch 'master' into 118_rip_docker_desktop
2021-06-29 16:52:25 -07:00
Micah Lee
f4739e749a
Start adding systray
2021-06-29 16:52:10 -07:00
Micah Lee
e3dc7988e9
Make strip-ansi Mac-only
2021-06-22 13:40:08 -07:00
Micah Lee
d3d417ee84
Strip ANSI colors from Mac GUI output to preventing crashing, and fix Mac docker path
2021-06-22 13:34:15 -07:00
Micah Lee
f8381749c3
Improve terminal colors on light-colored terminal backgrounds
2021-06-22 10:49:51 -07:00
Micah Lee
14fe8add58
Use the dangerzone cache dir for temporary files in all OSes, not just Linux
2021-06-22 09:43:32 -07:00
Micah Lee
51bee645ed
Explicitly set the container_tech to either "docker" or "podman"
2021-06-21 12:39:53 -07:00
Micah Lee
9ed3bac2b5
If Tails is detected, tell the container runtime to pull images over Tor
2021-06-21 12:35:23 -07:00
Micah Lee
d24d593094
Rip out everything required to make dangerzone-container run with root privs
2021-06-17 14:16:27 -07:00
Micah Lee
da6c3c253e
Make linux container runtime be podman, remove pkexec
2021-06-17 14:13:43 -07:00
Micah Lee
3c0dc74407
Change subprocess bullet character in one more places
2021-06-17 12:16:02 -07:00
Micah Lee
51414f2c96
Syntax error
2021-06-17 11:47:36 -07:00
Micah Lee
13adda0af5
Change subprocess bullet character to ">" to remove all the headaches
2021-06-17 11:40:38 -07:00
Micah Lee
77ac8e7d54
Switch subprocess bullet in GUI too
2021-06-17 11:22:41 -07:00
Micah Lee
9c645beaef
Switch subprocess bullet character
2021-06-17 11:18:13 -07:00
Micah Lee
04dcf72313
Don't display ANSI art banner in GUI mode because it prevents the app from opening in macOS from Finder
2021-06-17 11:17:55 -07:00
Micah Lee
d125a5004b
Find docker.exe in the path, in case Docker Desktop changes its location in the future
2021-06-17 10:31:07 -07:00
Micah Lee
3105a2c229
Change a bunch of stuff so Windows will work again
2021-06-16 16:55:25 -07:00
Micah Lee
9278848adf
Add --security-opt=no-new-privileges:true to docker call
2021-06-15 16:37:42 -07:00
Micah Lee
05f00ca53f
Fix bugs with testing if docker is ready
2021-06-10 14:46:31 -07:00
Micah Lee
a711ec1ded
Make the temp directories world-readable so that docker containers can access them regardless of which user created them
2021-06-10 14:41:26 -07:00
Micah Lee
429d1e3f08
Display banner and pretty terminal output in GUI mode too
2021-06-10 12:03:24 -07:00
Micah Lee
38ea24393a
Beautiful CLI colors and formatting
2021-06-10 11:39:26 -07:00
Micah Lee
46c73329a5
Switch from termcolor to colorama
2021-06-10 10:24:28 -07:00
Micah Lee
429f5dcf43
Set one more part of the banner to have a black background
2021-06-09 17:36:09 -07:00
Micah Lee
05b5d0bb3e
Set black background for banner
2021-06-09 17:35:00 -07:00
Micah Lee
918e5fa306
Display banner
2021-06-09 17:31:06 -07:00
Micah Lee
1144fd9f87
Make the CLI fully functional
2021-06-09 17:00:39 -07:00
Micah Lee
73d412501c
Move the ConvertToPixels task validation into global_common so the CLI and GUI can share it
2021-06-09 16:32:06 -07:00
Micah Lee
8aaf7ebcf1
Start implementing CLI args, and start with validating custom containers and pulling the latest container
2021-06-09 16:15:19 -07:00
Micah Lee
6ff68f88ea
Refactor dangerzone to move GUI code into its own module
2021-06-09 15:24:03 -07:00
Micah Lee
36c4e290a2
Find PDF viewers again
2021-06-09 13:28:56 -07:00
Micah Lee
b8e8c74161
Make an ApplicationWrapper to avoid inheriting from QApplication
2021-06-09 13:25:22 -07:00
Micah Lee
791723db20
GlobalCommon does not need temp dirs, and fix bug with finding Mac PFD viewers
2021-06-09 11:52:49 -07:00
Micah Lee
803844e832
Remove temporary directory output
2021-06-08 15:29:34 -07:00
Micah Lee
2f97f344a9
Fix typo with using a custom container
2021-06-08 15:29:14 -07:00
Micah Lee
cdc29ee8dd
Fix --custom-container option
2021-04-15 13:35:18 -07:00
Micah Lee
4450146028
Version bump to 0.1.5 and update changelog
2021-01-04 15:31:12 -08:00
Micah Lee
78e23a1e8b
Set QT_MAC_WANTS_LAYER env variable to work in Big Sur
2020-12-30 10:40:28 -08:00
Micah Lee
87be2bbc7d
Fix detecting if dangerzone or dangerzone-container is running in Windows, update docker.exe path, fix Windows build scripts to include to docker-container.exe symlink
2020-10-29 10:43:23 -07:00
Micah Lee
ac36006d0d
Merge branch 'master' into version-0.1.4
2020-10-28 16:52:45 -07:00
Micah Lee
1116c9a029
Make Windows docker link clickable, and make Windows installer add a start menu shortcut
2020-10-28 16:48:16 -07:00
Micah Lee
269cf5b431
Add Windows changes
2020-10-27 11:55:21 -07:00
Micah Lee
50044a05fa
Remove QVariant, to finish porting from PyQt5 to PySide2
2020-10-26 15:12:17 -07:00
Micah Lee
92b19fe1b3
Allow docker installed from snap package
2020-10-26 15:11:41 -07:00
Micah Lee
31b63e5471
Start switching from PyQt5 to PySide2
2020-10-26 14:52:45 -07:00
Micah Lee
9c0f61488a
Update changelog and version bump, and update CircleCI to support Ubuntu 20.10 and Fedora 32
2020-10-26 14:07:14 -07:00
Micah Lee
13285cd024
Suppress stderr from GUI output and display it in the terminal in dark; add a dangerzone poetry entrypoint; and update dependencies
2020-10-14 09:41:23 -07:00
Micah Lee
753134dc3f
Version bump to 0.1.3 and update changelog
2020-09-25 13:43:22 -07:00
Giacomo Rossetto
3d456f8f5a
Check if CFBundleName exit
2020-04-10 14:09:21 +02:00
Micah Lee
e798da9a99
Version bump to 0.1.2 and update changelog
2020-04-09 16:23:15 -07:00
Micah Lee
9c90a0fa33
Rename dangerzone-container commands to remove hiphens and underscores, because old and new versions of click treat them differently
2020-04-09 13:58:22 -07:00
Micah Lee
2674f1457a
Version bump to 0.1.1
2020-03-17 11:11:47 -07:00
Micah Lee
4eba0087e7
Version bump to 0.1.1.dev1
2020-03-16 17:07:43 -07:00
Micah Lee
3a1b6d457f
All dangerzone-container subprocesses get called from global_commons, and if the user cancels or fails the authentication dialog, handle gracefully
2020-03-16 14:26:07 -07:00
Micah Lee
cf367adcfa
This creates a separate script dangerzone-container which is a wrapper for running the container. This lets us run dangerzone as unprivileged, but dangerzone-container as privileged, to avoid adding the user to the dangerzone group.
2020-03-13 16:49:53 -07:00
Micah Lee
0b1cd9e9ef
If docker service is not running, try to start it
2020-03-12 16:00:30 -07:00
Micah Lee
2c0f0acbdf
When finding PDF viewers, skip apps that do not have Info.plist files (as is the case with com.apple.system-library)
2020-03-12 15:21:09 -07:00
Eike Rathke
46c741a634
Fix filter ODF extension .ods
...
application/vnd.oasis.opendocument.spreadsheet ods
2020-03-11 22:43:26 +01:00
Micah Lee
d519303150
Add --custom-container option, to run a container built locally instead of requiring download from dockerhub
2020-03-06 18:08:15 +05:30
Micah Lee
8845ac6440
Allow opening docm files
2020-03-03 19:23:46 +05:30
Micah Lee
469680565b
Merge branch 'master' of github.com:firstlookmedia/dangerzone
2020-03-02 21:12:08 -08:00
Micah Lee
322416eee8
Fix icon path
2020-03-02 21:11:54 -08:00
Micah Lee
271ac9641b
Version bump to 0.1
2020-02-28 17:38:49 -08:00
Micah Lee
ed6dc43276
When you activate dangerzone in macOS and no windows are open, open a blank window
2020-02-28 17:35:11 -08:00
Micah Lee
2f77159e3f
Version bump to 0.0.3
2020-02-27 15:45:02 -08:00
Micah Lee
dd6c336b85
Force updating the container if flmcode/dangerzone image is not there, and show slightly more output when pulling the image
2020-02-27 15:44:13 -08:00
Micah Lee
389f9db421
Use container from dockerhub instead of building it
2020-02-27 15:18:19 -08:00
Micah Lee
fc2fcf6bd3
Version bump to 0.0.2
2020-02-27 09:56:03 -08:00
Micah Lee
52cbbca7c6
Update container
2020-02-26 17:26:18 -08:00
Micah Lee
4c9bbfe217
Refactor Common into GlobalCommon (for the whole app) and Common (for a window), and allow multiple dangerzone windows at once in macOS
2020-02-26 15:46:23 -08:00
Micah Lee
cb38473573
Allow multiple windows to be open at once
2020-02-26 14:32:57 -08:00
Micah Lee
e18a898497
Make docker installer work the same way for Windows too
2020-02-26 14:01:43 -08:00
Micah Lee
2d4ca86985
Simplify docker installer, make it inform the user to install docker and run it, instead of trying to do that on behalf of the user
2020-02-26 13:39:44 -08:00
Micah Lee
163f482fd1
change version to 0.0.1 to test packaging
2020-02-21 16:29:00 -08:00
Micah Lee
45f78637af
Add build script and instructions for fedora
2020-02-21 16:04:11 -08:00
Micah Lee
ae7c919d8e
Use docker for ubuntu and debian, and provide GUI for adding user to docker group
2020-02-21 15:07:49 -08:00
Micah Lee
1f2607f44a
Handle macOS file open events
2020-02-21 10:42:56 -08:00
Micah Lee
2bfc3545ea
Remove dangerzone from macOS application list
2020-02-21 09:30:05 -08:00
Micah Lee
931effc7ce
In Windows, disable opening of safe PDF, make saving PDF required, and after safe PDF has been created, open Windows explorer with the safe PDF selected
2020-02-20 16:53:25 -08:00
Micah Lee
d01f2eedea
Rename "open_find_viewer" to "open_pdf_viewer"
2020-02-20 14:32:09 -08:00
Micah Lee
583f8de8ff
Move Windows icon into share, and make get_resource_path work in Windows
2020-02-20 13:41:56 -08:00
Micah Lee
5747f338dc
Make sure to pass startupinfo into all subprocesses that are run in windows
2020-02-20 12:31:57 -08:00
Micah Lee
65121ed729
Also pass common into launch_docker_windows function
2020-02-20 09:46:34 -08:00
Micah Lee
81627379f6
Pass common into Installer, so Docker Desktop for Windows installer will run
2020-02-20 09:38:49 -08:00
Micah Lee
7a22b98156
Add notice about building container maybe taking a long time
2020-02-13 16:12:18 -08:00
Micah Lee
e3069e9e05
Fail early if container pull or build fail
2020-02-13 15:55:28 -08:00
Micah Lee
791d930a55
In Windows, add startupinfo to subprocess calls to prevent terminal windows from opening in the background
2020-02-13 15:33:08 -08:00
Micah Lee
17a585f614
Make DockerInstaller also install the Windows version of Docker
2020-02-11 16:48:52 -08:00
Micah Lee
ff78578910
If docker is installed but not running, use DockerInstaller to launch it
2020-02-07 15:39:48 -08:00
Micah Lee
b04b6ee96c
When canceling the docker installer, reject the dialog immediately before quitting the threads, and try to gracefully quit the threads
2020-02-07 15:36:21 -08:00
Micah Lee
329fa4639b
Fix get_resource_path for Mac app bundle
2020-02-07 12:07:55 -08:00
Micah Lee
13aac3348a
After downloading Docker, install it, launch it for the first time, and once it's ready, re-launch dangerzone
2020-02-07 11:29:43 -08:00
Micah Lee
abb56b68ac
In macOS, download Docker Desktop for the user if it is not installed
2020-02-06 17:12:01 -08:00
Micah Lee
70889646be
Display the dangerous document filename on the tasks widget
2020-01-13 14:46:06 -08:00
Micah Lee
51cd76a456
Allow browsing for all support file types, update README to include supported file types, and update container that supports them all
2020-01-13 12:02:50 -08:00
Micah Lee
46585f15a8
Start printing container output to stdout as well, and update container
2020-01-10 17:23:19 -08:00
Micah Lee
90df7894aa
Make tasks more robust in handling failure by checking for return codes
2020-01-10 16:56:50 -08:00
Micah Lee
3928a3fa5a
Switch container to ubuntu:20.04, because the file command in ubuntu:18.04 failed at properly recogonnizing a .docx MIME type, and 18.04 is soon to be released
2020-01-09 16:58:17 -08:00
Micah Lee
13452a41aa
Fix opening save PDFs in Linux, and add some spacing in settings widget
2020-01-09 15:01:15 -08:00
Micah Lee
3be1d63330
Open in safe PDFs in macOS
2020-01-09 14:37:04 -08:00
Micah Lee
816a8fecd7
Remove css padding because it looks totally wrong in macOS
2020-01-09 13:13:03 -08:00
Micah Lee
0f464dcb0c
Detect the string "dangerzone" in docker output, instead of "localhost/dangerzone"
2020-01-09 13:11:42 -08:00
Micah Lee
dd295271f5
Make work in macOS using docker instead of podman
2020-01-09 13:09:17 -08:00
Micah Lee
48fd8ece40
Alphebatize the OCR language dropdown
2020-01-09 09:47:33 -08:00
Micah Lee
e1d0163504
Display command being executed in each task
2020-01-08 14:26:26 -08:00
Micah Lee
e4e5f71419
Make passing in the filename an argument instead of an option, so desktop file will work properly
2020-01-07 17:20:14 -08:00
Micah Lee
0aa7ff5f7c
Don't let you open safe PDFs in dangerzone
2020-01-07 17:12:23 -08:00
Micah Lee
e85191b498
Debian packaging
2020-01-07 17:10:54 -08:00
Micah Lee
6bac63fb5c
Make update containers checkbox required if the dangerzone podman image does not exist
2020-01-07 16:52:46 -08:00
Micah Lee
5e0c521293
Pass OCR environment variables into container
2020-01-07 16:46:04 -08:00
Micah Lee
3ea50a477d
Either save or open must be checked
2020-01-07 16:27:02 -08:00
Micah Lee
de2ae17544
If not saving, then save it to a temp file instead
2020-01-07 16:22:16 -08:00
Micah Lee
fcc2742a36
Add icon; when closing window use correct location of Qt app; print the command before executing the PDF reader
2020-01-07 16:18:49 -08:00
Micah Lee
cbc4a1e7ea
Save and open document, as needed
2020-01-07 16:14:43 -08:00
Micah Lee
bdcd61b964
Clicking start starts running the tasks
2020-01-07 16:09:08 -08:00
Micah Lee
dbff6b4b79
Make save browse button let you select an output file
2020-01-07 15:41:32 -08:00