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

Deleting a source during a sync must delete the files also on disk #153

Closed
redshiftzero opened this issue Nov 10, 2018 · 1 comment
Closed
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@redshiftzero
Copy link
Contributor

After we implemented the sync logic here, we implemented the ability to download files, messages, and replies from sources.

The current logic does not delete the file, message, or reply from a source locally when the source is deleted from the database.

Briefly summarizing how we've been doing downloads, we first store them in the data directory with the same filename as the server (this is the filename that the API provides). These downloads can end in:

  • .gpg (replies or submissions that are messages) e.g. 1-foo-bar.gpg or,
  • .gz.gpg (submissions that are files) e.g. 1-foo-bar.gz.gpg.

Then, we decrypt (and in the case of files, also decompress) a file, and we store that file again locally in the data directory with the file extension(s) stripped off, i.e. 1-foo-bar. If a file fails to decrypt, it will be stored with the same filename as the server. If it decrypts but fails to decompress, it will be saved as 1-foo-bar.gz.

In this ticket, we should add a storage.py function that deletes all files locally that contain a particular journalist designation (this is term used for the short name associated with a source, e.g. here foo bar). Then we can call that in the sync logic when sources are deleted. This is also needed for #78.

@redshiftzero redshiftzero added bug Something isn't working help wanted Extra attention is needed labels Nov 10, 2018
@redshiftzero redshiftzero added this to the 0.1.0alpha milestone Nov 10, 2018
@redshiftzero
Copy link
Contributor Author

Steps to Reproduce

  1. Sign in, download some documents.
  2. Sign into the journalist interface, delete a source.
  3. Look in the data dir.
  4. See that the files associated with that source codename still exist.

@redshiftzero redshiftzero self-assigned this Nov 10, 2018
@redshiftzero redshiftzero added this to In Development in SecureDrop Team Board Nov 12, 2018
@redshiftzero redshiftzero moved this from In Development to Ready for review in SecureDrop Team Board Nov 14, 2018
SecureDrop Team Board automation moved this from Ready for review to Done Nov 14, 2018
legoktm pushed a commit that referenced this issue Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
No open projects
Development

No branches or pull requests

1 participant