mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-09-25 01:53:03 +02:00
feat(admin): cleanup page — remove 'Fichiers temporaires' level, promote sections to h2 TOC entries
This commit is contained in:
@@ -452,6 +452,26 @@ deploy-cleanup-cron:
|
||||
deploy-check-cleanup-log:
|
||||
ssh xamxam "tail -20 /var/log/xamxam-cleanup-\$(date +%Y-%m-%d).log 2>/dev/null || echo '(log file empty or missing — will be created on first cron run)'"
|
||||
|
||||
deploy-tmp-cleanup-cron:
|
||||
# Install cron job for abandoned-upload garbage collection (hourly, 2h threshold).
|
||||
# Creates /etc/cron.d/xamxam-tmp-cleanup and log file on the server.
|
||||
@echo "📋 Installing abandoned-upload cleanup cron job…"
|
||||
rsync -v scripts/cleanup-tmp-uploads.php xamxam:/tmp/cleanup-tmp-uploads.php
|
||||
ssh xamxam "chmod 755 /tmp/cleanup-tmp-uploads.php"
|
||||
rsync -v deploy/xamxam-tmp-cleanup.cron xamxam:/tmp/xamxam-tmp-cleanup.cron
|
||||
ssh -t xamxam "sudo install -o root -g root -m 644 /tmp/xamxam-tmp-cleanup.cron /etc/cron.d/xamxam-tmp-cleanup && rm -f /tmp/xamxam-tmp-cleanup.cron"
|
||||
ssh -t xamxam "sudo touch /var/log/xamxam-tmp-cleanup-\$(date +%Y-%m-%d).log && sudo chown www-data:www-data /var/log/xamxam-tmp-cleanup-\$(date +%Y-%m-%d).log && sudo chmod 644 /var/log/xamxam-tmp-cleanup-\$(date +%Y-%m-%d).log"
|
||||
@echo "✅ Abandoned-upload cleanup cron installed."
|
||||
@echo " Cron file: /etc/cron.d/xamxam-tmp-cleanup"
|
||||
@echo " Script: /tmp/cleanup-tmp-uploads.php"
|
||||
@echo " Log file: /var/log/xamxam-tmp-cleanup-\$(date +%Y-%m-%d).log"
|
||||
@echo ""
|
||||
@echo "Verify with: just deploy-check-tmp-cleanup-log"
|
||||
|
||||
[group('deploy')]
|
||||
deploy-check-tmp-cleanup-log:
|
||||
ssh xamxam "tail -20 /var/log/xamxam-tmp-cleanup-\$(date +%Y-%m-%d).log 2>/dev/null || echo '(log file empty or missing — will be created on first cron run)'"
|
||||
|
||||
[group('deploy')]
|
||||
deploy-logrotate:
|
||||
# Install /etc/logrotate.d/xamxam for app + nginx + cron logs.
|
||||
@@ -493,7 +513,7 @@ deploy-migrate-storage dry_run='' target_host='xamxam':
|
||||
ssh {{target_host}} 'rm -f /var/www/xamxam/migrate-storage-paths.php'
|
||||
|
||||
[group('deploy')]
|
||||
deploy-all-first: deploy deploy-backup deploy-cleanup-cron deploy-logrotate
|
||||
deploy-all-first: deploy deploy-backup deploy-cleanup-cron deploy-tmp-cleanup-cron deploy-logrotate
|
||||
# One-shot: full initial deploy including backup and cleanup cron jobs.
|
||||
|
||||
# One-shot remote provisioning for a fresh xamxam server.
|
||||
@@ -638,3 +658,10 @@ cleanup-drafts dry_run='':
|
||||
# just cleanup-drafts --no-dry-run
|
||||
# OLDER_THAN_HOURS=24 just cleanup-drafts
|
||||
@php scripts/cleanup-drafts.php {{dry_run}}
|
||||
|
||||
cleanup-tmp-uploads dry_run='':
|
||||
# List (dry-run) or delete abandoned FilePond uploads (>2h or missing session).
|
||||
# Pass --no-dry-run to actually delete. Override the age with
|
||||
# TMP_UPLOAD_MAX_AGE_SECONDS:
|
||||
# just cleanup-tmp-uploads --no-dry-run
|
||||
@php scripts/cleanup-tmp-uploads.php {{dry_run}}
|
||||
|
||||
Reference in New Issue
Block a user