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

Orphaned pastas #63

Closed
jchia opened this issue Sep 28, 2022 · 4 comments
Closed

Orphaned pastas #63

jchia opened this issue Sep 28, 2022 · 4 comments
Labels
bug Something isn't working discussion

Comments

@jchia
Copy link
Contributor

jchia commented Sep 28, 2022

When the URL/identifier for a private, non-expiring, pasta is forgotten, the pasta may remain forever with nobody who can delete it except for some administrator or imaginary GC mechanism within microbin that has access to the underlying data files. This can result in endless garbage accumulation.

For this problem, perhaps there can be an administrative tool (e.g. program) to list the URLs/identifiers for pastas that meet certain criteria, optionally deleting them. For example, someone could be interested in private pastas that have not been accessed in the past n days. Potentially problematic concurrent access to the underlying data files by microbin and this tool needs to be considered.

Alternatively, there could be a switch to disallow non-expiring, private, pastas.

@szabodanika szabodanika added bug Something isn't working discussion labels Sep 28, 2022
@szabodanika
Copy link
Owner

I like the idea of a garbage collector. It can either remove pastas that haven't been accessed in N days or we could set a max storage limit and if that is reached, the oldest ones get deleted. I want to hear some other users' opinion on this

@Panja0
Copy link

Panja0 commented Sep 28, 2022

A garbage collector would be a great addition imho.
I would say pastas that haven't been accessed in N days is a good option.

@szabodanika szabodanika added this to the Targeting v1.2.0 milestone Sep 28, 2022
@jchia
Copy link
Contributor Author

jchia commented Sep 28, 2022

I personally would welcome either a new microbin option specifying the GC policy to use or a standalone program that does the GC. For preventing concurrent file access, flock() can be used on files and sqlite also has ways to prevent/coordinate concurrent access.

As for the choice of GC policy, I think allowing the user to choose the following would be good:

  • Read age threshold (how long ago was the last read). GC happens only when read age is no less than the threshold. For this purpose, an item is deemed to have been read at the time of creation. IDK whether the timestamp of the latest access is recorded, so this feature may entail additional book-keeping resulting from reads.
  • Include public items (whether to GC public+private items or only private items).
  • Include expiring items (whether to GC expiring + non-expiring items or only non-expiring items).

There is the question of whether GC is meant to apply to items with an expiration time. If not, then the above 3rd criterion is moot.

szabodanika added a commit that referenced this issue Oct 29, 2022
- Implements #7
- Implements #42 and therefore #64
- Improved #53
- Implements #59
- Implements #61
- Implements #63
- Implements #80
- Implements #84
- Added Info page
- Removed Help page
- Bumped version number to 1.2.0
- Fixed a bug where wide mode was still 720px wide
- Created FUNDING.yml
- Reorganised arguments in README.MD and documented new options
- Updated SECURITY.MD
- Added display of last read time and read count
- Increased default width to 800px to make UI less cluttered
- Reorganised index page
- New, better attach file button

I want to spend some time testing these changes and let everyone have a look at them before tagging and releasing new artifacts.
@szabodanika
Copy link
Owner

This has been implemented in v1.2.0. By default pastas that haven't been accessed for 90 days are deleted. This can be changed with the --gc-days argument

@szabodanika szabodanika removed this from the Targeting v1.3.0 milestone Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion
Projects
None yet
Development

No branches or pull requests

3 participants