Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to move untrusted files into subdirectory after conversion #255

Merged
merged 9 commits into from
Nov 24, 2022

Conversation

deeplow
Copy link
Contributor

@deeplow deeplow commented Nov 21, 2022

Follows what's been outlined in #251:
opt3

The only thing missing would be a way to detect a case where an archive directory cannot be created where the original documents are located. This could show in the GUI by disabling the option to archive, or the CLI by giving out an error.

@deeplow deeplow force-pushed the 251-untrusted-subdir branch from 3f7ff63 to 81b4b1c Compare November 22, 2022 19:04
@deeplow deeplow marked this pull request as ready for review November 23, 2022 09:02
@deeplow
Copy link
Contributor Author

deeplow commented Nov 23, 2022

Dangerzone has refered to untrusted files in the past as suspicious. Should we name the directory and the option as suspicious?

@apyrgio
Copy link
Contributor

apyrgio commented Nov 23, 2022

On the other hand, the non-suspicious documents are suffixed as "-safe", so having an "unsafe" directory makes the difference clearer. I'd vote to keep it as "unsafe" personally.

@apyrgio apyrgio self-requested a review November 23, 2022 15:31
dangerzone/document.py Outdated Show resolved Hide resolved
Move the 'safe_extension' widget to the top of the settings and the save
location widget to the bottom.
@deeplow deeplow force-pushed the 251-untrusted-subdir branch 2 times, most recently from 8cc016e to 34db094 Compare November 24, 2022 10:53
With the added new widgets not all widgets in the settings fit
perfectly.
For some reason, mypy was complaining that these statements were no
longer unreachable, but now it no longer is.
Fixes #251 by implementing the logic for archiving a document after
conversion into a default sub-directory.
Verifies that the archive directory can be created as soon as the
document is set to be archived.
Additionally this adds the pytest-mock dev dependency to be able to mock
certain methods.
Disable the option to move original documents to 'unsafe' subdirectory
when said directory is not writable.
@deeplow deeplow force-pushed the 251-untrusted-subdir branch from 34db094 to 49b7736 Compare November 24, 2022 11:17
@deeplow
Copy link
Contributor Author

deeplow commented Nov 24, 2022

Had to make some final layout adjustments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants