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 expired pastes #3

Closed
elrido opened this issue Jul 9, 2016 · 7 comments
Closed

Deleting expired pastes #3

elrido opened this issue Jul 9, 2016 · 7 comments
Assignees
Milestone

Comments

@elrido
Copy link
Contributor

elrido commented Jul 9, 2016

@Draky50110:

Hello (again)

A simple tool : http://links.kevinvuilleumier.net/?qzwJlQ (zip file in title).

When a paste is expired, the file is still on the server.
This tool deletes expired files/pastes.
It also displays some info (numbers of pastes, of expired pastes, and so).

Of course, it will only work if the "database" is "zerobin_model".

But this might be a good option : when a paste is created, this fonction is ran to clear the system.
Transparent :)
Could be disabled in conf.ini ("runpurgewhencreatingpaste") ?

And maybe possible to adapt it with other database model (mysql/pgsql/etc.)...


@Hexalyse:

This tool shouldn't be run on each paste creation. Imagine a Zerobin with thousands of pastes and dozens of active users, it would ruin your disk I/Os.
We could consider running it at paste creation, if it hasn't been run for X minutes/hours, it would be more modulable and configurable.


@Draky50110:

Ok, in fact I don't know how is it possible to configure it ;) but the tool is here though... :)


@elrido:

I would also rather go with a "softcron" approach as Hexalyse suggests. Ideas could be:

  • per triggered "cron" only delete i.e. up to 10 (configurable) outdated pastes to reduce the delay introduced by the operation.
  • have a rate limiting mechanism to ensure it only runs (earliest) after certain interval (similar to the traffic limiter)
  • the method to find outdated pastes might be different in DBs (where its just another where condition) then in the data file model

@bpvarsity:

As anyone come up with a way to run a cron to delete the outdated pastes yet? Seems odd that the site doesn't delete expired pastes automatically.


@elrido:

Nope, sorry, did not yet look into this.

I made some progress in regards to #60 and plan to get back to work on release 0.23 (which should include this feature) when I am finished migrating all my sites and services to my new infrastructure.


@bpvarsity:

Awesome thanks

@elrido elrido added this to the Release 0.23 milestone Jul 9, 2016
@Draky50110
Copy link
Contributor

@elrido I know this tool, it is because I use it that I suggested this idea as integrated in ZeroBin :p

@elrido
Copy link
Contributor Author

elrido commented Jul 9, 2016

I'm sorry if the migration of the issues into the renamed repo of the fork caused any confusion. :-(

@Draky50110
Copy link
Contributor

No problem.
Why did you rename it by the way ?
Cause dev from scratch ?

@elrido
Copy link
Contributor Author

elrido commented Jul 9, 2016

See this issue here: Detach this repo / New name

@elrido elrido self-assigned this Jul 13, 2016
@elrido elrido closed this as completed in f8bc40b Jul 15, 2016
@elrido
Copy link
Contributor Author

elrido commented Jul 15, 2016

Sorry, I forgot to add these options in the configuration file.

@ZerooCool
Copy link
Contributor

@Draky50110 say :
A simple tool : http://links.kevinvuilleumier.net/?qzwJlQ (zip file in title).

...

It's the PrivateBin/data/purge.php ?

@elrido
Copy link
Contributor Author

elrido commented Jun 25, 2020

Yes, when this ticket was originally opened, the purge limiter hadn't been implemented yet. It got added in f8bc40b and 20cf678 in July 2016.

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

No branches or pull requests

3 participants