Skip to content

Fixed #18409 - command line option to purge signatures#18437

Merged
snipe merged 2 commits intodevelopfrom
#18409-purge-signature-pdfs
Jan 14, 2026
Merged

Fixed #18409 - command line option to purge signatures#18437
snipe merged 2 commits intodevelopfrom
#18409-purge-signature-pdfs

Conversation

@snipe
Copy link
Copy Markdown
Member

@snipe snipe commented Jan 14, 2026

This introduces a command line tool to purge EULA PDFs and signature files that are older than X days to reduce the backup file size and handle general cleanup for very old EULAs.

snipeit:purge-eula-pdfs  
                            {--older-than-days= : The number of days we should delete before } 
                            {--force : Skip the interactive yes/no prompt for confirmation}
                            {--dryrun : Run the purge process but don\'t update the database or delete files}
                            {--with-output : Display the results in a table in your console}
Screenshot 2026-01-14 at 12 45 54 PM

It's arguable that we might want to add an option to only allow this for users who have been deleted, but I can see several different use-cases.

Fixes #18409

@snipe snipe merged commit dfe664b into develop Jan 14, 2026
7 of 8 checks passed
@snipe snipe deleted the #18409-purge-signature-pdfs branch January 14, 2026 21:37
Copy link
Copy Markdown
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already merged but one minor formatting thing I noticed.

$acceptances = CheckoutAcceptance::HasFiles()->where('updated_at','<', $interval_date)->with('assignedTo')->get();

if (!$this->option('force')) {
if ($this->confirm("\n****************************************************\nTHIS WILL DELETE ALL OF THE SIGNATURES AND EULA PDF FILES SINCE '.$interval_date.'. \nThere is NO undo! \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output of this line is weird because it's wrapped in ".

Suggested change
if ($this->confirm("\n****************************************************\nTHIS WILL DELETE ALL OF THE SIGNATURES AND EULA PDF FILES SINCE '.$interval_date.'. \nThere is NO undo! \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) {
if ($this->confirm("\n****************************************************\nTHIS WILL DELETE ALL OF THE SIGNATURES AND EULA PDF FILES SINCE $interval_date \nThere is NO undo! \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled, ty!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants