Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add simple "delete to trash" functionality #1249

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

tribut
Copy link
Contributor

@tribut tribut commented Aug 22, 2021

Edit: Moved to paperless-ngx/paperless-ngx#24

Adds PAPERLESS_THRASH_DIR. When set, original files are moved there instead of being unlinked when a document is deleted.

Implements the first point from #693.

The idea is that this prevents accidental (or malicious) permanent deletion of a document. This is the most minimalist implementation I could think of, there are no changes to the GUI at all – just a directory that keeps the originals that would otherwise have been removed.

Edit: Failing CI seems bogus (frontend ran into npm timeout and coveralls says coverage decreased by 0.003% - rounding error?)

@tribut tribut force-pushed the feature-trash branch 2 times, most recently from caa04a2 to e86dc2e Compare August 24, 2021 08:24
When set, original files are moved here instead of being permanently
removed when a document is deleted.
@dblitt
Copy link

dblitt commented Feb 16, 2022

This pretty much LGTM. I'm not super familiar with the testing, but I'm not seeing any problems. @tribut would you mind putting the os.rename call in handlers.py:248 in a try except to handle any exceptions caused by permission errors, etc? And also, there is an extra new line in test_file_handling.py on line 191.

edit: oops commented on the wrong PR

tribut pushed a commit to tribut/paperless-ng that referenced this pull request Aug 18, 2022
…-changelog

[CI] Fix automatic changelog generation on release
tribut pushed a commit to tribut/paperless-ng that referenced this pull request Aug 18, 2022
commit a4709b1
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Thu Jul 28 15:36:13 2022 -0700

    Update stale.yml

    [skip ci]

commit 3a03108
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Thu Jul 28 15:24:23 2022 -0700

    Update changelog.md

commit 0c517e5
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Thu Jul 28 15:18:49 2022 -0700

    v1.8.0 version strings

commit 5fe4350
Merge: 278cedf a722bfd
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Thu Jul 28 15:17:30 2022 -0700

    Merge pull request #1240 from paperless-ngx/beta

    [Beta] Paperless-ngx v1.8.0 Release Candidate 1

commit a722bfd
Author: Paperless-ngx Translation Bot [bot] <99855517+paperless-l10n@users.noreply.github.com>
Date:   Thu Jul 28 07:46:12 2022 -0700

    New Crowdin updates (jonaswinkler#1291)

    * New translations django.po (French)
    [ci skip]

    * New translations messages.xlf (French)
    [ci skip]

    * New translations django.po (French)
    [ci skip]

    * New translations messages.xlf (French)
    [ci skip]

    * New translations messages.xlf (Turkish)
    [ci skip]

    * New translations django.po (Turkish)
    [ci skip]

commit f3d99a5
Merge: ca33477 79de098
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Tue Jul 26 11:21:42 2022 -0700

    Merge pull request jonaswinkler#1277 from paperless-ngx/fix/redo-ocr-button-on-edit

    Fix/feature: add redo ocr button to document edit view

commit 79de098
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Tue Jul 26 09:54:05 2022 -0700

    fix button icon spacing on mobile

commit ca33477
Author: Paperless-ngx Translation Bot [bot] <99855517+paperless-l10n@users.noreply.github.com>
Date:   Tue Jul 26 09:45:21 2022 -0700

    New Crowdin updates (jonaswinkler#1242)

    * New translations messages.xlf (Turkish)
    [ci skip]

    * New translations messages.xlf (German)
    [ci skip]

    * New translations django.po (German)
    [ci skip]

    * New translations messages.xlf (Italian)
    [ci skip]

    * New translations messages.xlf (Italian)
    [ci skip]

    * New translations messages.xlf (Finnish)
    [ci skip]

    * New translations messages.xlf (Finnish)
    [ci skip]

commit 1071357
Merge: f32dfe0 ef790ca
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Tue Jul 26 09:44:42 2022 -0700

    Merge pull request jonaswinkler#1268 from paperless-ngx/bugfix-db-locked

    Bugfix: Adds configuration for database timeout, fixing database locked error

commit f32dfe0
Merge: 611707a 4e78ca5
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Mon Jul 25 12:59:31 2022 -0700

    Merge pull request jonaswinkler#1261 from paperless-ngx/fix/b1.8.0-ng-select-dropdowns

    Fix: dropdown selected items not visible again

commit 278cedf
Merge: b141671 ecc4553
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Mon Jul 25 09:25:52 2022 -0700

    Merge pull request jonaswinkler#1272 from paperless-ngx/fix-1263

    Documentation: fix occasional code block color legibility

commit 45a6b5a
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Sun Jul 24 20:15:26 2022 -0700

    Add redo OCR button to document edit

commit 611707a
Merge: 2d88638 b4d20d9
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Sun Jul 24 19:59:30 2022 -0700

    Merge pull request jonaswinkler#1276 from paperless-ngx/bugfix-webp-import

    Bugfix: Document import doesn't convert thumbnails to WebP

commit b4d20d9
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Sun Jul 24 10:22:53 2022 -0700

    Fixes document import copying PNG files to .webp extensions without actual conversion

commit ecc4553
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Fri Jul 22 15:10:33 2022 -0700

    fix occasional code block color legibility

commit ef790ca
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Fri Jul 22 11:08:52 2022 -0700

    Fixes the copy and paste of the log line

commit 2d88638
Merge: 0e2e5f3 91ba0bd
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Fri Jul 22 10:45:53 2022 -0700

    Merge pull request jonaswinkler#1269 from paperless-ngx/beta-deps-final

    Chore: Locks dependencies to the final versions for the beta

commit 91ba0bd
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Fri Jul 22 08:53:02 2022 -0700

    Locks dependencies to the final versions for the beta

commit 0e2e5f3
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Tue Jul 19 13:57:00 2022 -0700

    Creates utiliy to ensure all paths in settings are normalized and absolute

commit 7a99dcf
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Thu Jul 21 08:02:11 2022 -0700

    Adds configuration for database timeout, documentation and troubleshotting suggestion

commit 4e78ca5
Author: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Wed Jul 20 11:15:35 2022 -0700

    remove merge error ng-select css

commit 83de38e
Merge: f4be2e4 b1b6d50
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Wed Jul 20 08:26:12 2022 -0700

    Merge pull request jonaswinkler#1247 from paperless-ngx/bugfix-pikepdf-ocrmypdf-warnings

    Bugfix: Adds pngquant and jbig2dec to Docker image

commit f4be2e4
Merge: 4444925 16b0f7f
Author: Quinn Casey <quinn@quinncasey.com>
Date:   Tue Jul 19 21:03:16 2022 -0700

    Merge pull request #1259 from paperless-ngx/chore-add-ci-hadolint

    Chore: Add Hadolint job to CI

commit 16b0f7f
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Tue Jul 19 14:18:47 2022 -0700

    Removes a Dockerfile I can't find referenced anywhere

commit 27721ae
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Tue Jul 19 14:01:47 2022 -0700

    Fixes and updates the Hadolint action version

commit 329a317
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Tue Jul 19 13:54:33 2022 -0700

    Configure Hadolint in a single location for both hooks and CI

commit daad634
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Fri Jul 15 13:45:23 2022 -0700

    Adds a CI job for hadolint over all the Dockerfiles, fixes the minor thing it complained about

commit 4444925
Merge: 4c697ab 9c1ae96
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Mon Jul 18 15:55:29 2022 -0700

    Merge pull request jonaswinkler#1249 from paperless-ngx/fix-generated-changelog

    [CI] Fix automatic changelog generation on release

commit 9c1ae96
Author: Quinn Casey <quinn@quinncasey.com>
Date:   Mon Jul 18 09:48:03 2022 -0700

    Create PR for changelog instead of direct commit

commit b1b6d50
Author: Trenton Holmes <holmes.trenton@gmail.com>
Date:   Mon Jul 18 09:46:31 2022 -0700

    Adds a couple packages to the Docker image for ocrmypdf and pikepdf

commit 4c697ab
Author: Quinn Casey <quinn@quinncasey.com>
Date:   Sun Jul 17 15:23:28 2022 -0700

    Bump version to beta

commit b141671
Merge: 48dfbbe 2ab2d91
Author: Quinn Casey <quinn@quinncasey.com>
Date:   Sun Jul 17 13:18:57 2022 -0700

    Merge pull request jonaswinkler#1237 from tooomm/patch-1

    chore: Run stale bot only on certain labels

commit 2ab2d91
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Fri Jul 15 20:19:28 2022 -0700

    Use cant-reproduce for stale

commit 2784534
Author: tooomm <tooomm@users.noreply.github.com>
Date:   Fri Jul 15 21:18:38 2022 +0200

    only run on certain labels

commit 48dfbbe
Merge: 8efb97e e568b30
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Sun Jul 3 07:42:20 2022 -0700

    Merge pull request jonaswinkler#1110 from paperless-ngx/update-issue-form

commit 8efb97e
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Sat Jul 2 19:06:32 2022 -0700

    Update stale.yml

    [ci skip]

commit d8cda7f
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Sat Jul 2 17:51:39 2022 -0700

    Use any-of-labels for stalebot

    [ci skip]

commit 68f0cf4
Merge: 666b938 26b1251
Author: Felix E <felix@eckhofer.com>
Date:   Mon Jun 20 14:25:59 2022 +0200

    Merge pull request jonaswinkler#1148 from pReya/patch-1

    fix: update scanner capability

commit 26b1251
Author: Moritz Stückler <moritz.stueckler@gmail.com>
Date:   Mon Jun 20 12:06:54 2022 +0200

    fix: update scanner capability

    The Brother ADS-A1700W does indeed support SFTP. I've just bought it, and set it up like this.

commit e568b30
Author: shamoon <4887959+shamoon@users.noreply.github.com>
Date:   Tue Jun 7 15:28:49 2022 -0700

    Add lsio to issue form

commit 666b938
Merge: de5eaf1 163231d
Author: Quinn Casey <quinn@quinncasey.com>
Date:   Thu May 19 17:23:23 2022 -0700

    Merge pull request jonaswinkler#990 from tooomm/patch-2

    Docs: Fix headings and add links to PRs in changelog

commit 163231d
Author: tooomm <tooomm@users.noreply.github.com>
Date:   Thu May 19 23:12:40 2022 +0200

    Link issues, capitalization and minor fixes

commit e530750
Author: tooomm <tooomm@users.noreply.github.com>
Date:   Thu May 19 22:05:43 2022 +0200

    update heading levels for v1.7.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants