asciinema / asciinema-server

Platform for hosting and sharing terminal session recordings
https://docs.asciinema.org/manual/server/
Apache License 2.0
2.29k stars 263 forks source link

Make automatic deletion of unclaimed recordings a 2-step process #426

Closed ku1ik closed 9 months ago

ku1ik commented 9 months ago

Previously, ASCIICAST_GC_DAYS variable was used to control max age of unclaimed recordings, after which they were soft-deleted, i.e. marked as "archived" (confusing term), effectively making them inaccessible by de-listing them and showing 410 Gone page for direct recording links.

This PR implements 2-step deletion process. It introduces new config variable, UNCLAIMED_RECORDING_TTL, which controls the behaviour of automatic removal of unclaimed recordings.

Step 1 is soft-deletion, which is what we had previously. Also, we now use term "deletion" instead of "archival", because "archival" confused people, making them think the recordings are put in some sort of archive, while in fact they were just hidden and waiting for proper deletion.

Step 2 is hard-deletion, which removes any traces of a recording from the system (deleting DB records + recording file).

UNCLAIMED_RECORDING_TTL accepts TTL values in days, in the following formats:

The benefit of having 2-step auto-deletion process like this, especially for a main asciinema server instance - asciinema.org - is to give people time to reach out to the server admin until it's too late to recover the recording.

On asciinema.org we used ASCIICAST_GC_DAYS=7 and I plan to replace it with something like UNCLAIMED_RECORDING_TTL=7,90.