stats-prune-400
Delete visitor statistics older than an operator-chosen number of days.
Why: the Carloku privacy policy promises "We keep the statistics for 400 days", and nothing deleted analytics day files.
What:
- CARLOSANALYTICSRETENTIONDAYS on the console: unset = keep forever (today's behaviour, self-hosters unaffected); N = delete day files under apps/<acct>/<app>/analytics/<box>/days/ dated more than N UTC days ago (exactly N kept). CARLOSANALYTICSRETENTIONDRY_RUN=1 logs instead of deleting. Invalid values refuse startup. Carloku will set 400.
- Runs at most once a day from the console (daily admission persisted in SQLite, riding the hourly economics worker). No box polling. Bounded paged LISTs that stop at the first unexpired date, batched deletes, ten-minute pass, delete and list caps, resume cursor.
- The deployment bucket is versioned, so every version and delete marker of an expired key is purged through optional provider-neutral release interfaces (S3: ListObjectVersions + DeleteObjects with version ids). On AccessDenied the pass logs the missing permission and falls back to current-key deletes.
- infra/modules/region-host: enableanalyticsversion_prune (default false) grants the console box ListBucketVersions (prefix apps/) and DeleteObjectVersion on deployment-bucket apps///analytics//days/* only.
- No console SQLite table holds visitor statistics; host demo_traffic is cap accounting, not visitor statistics.
Inert until released and configured. Switch-on: apply the IAM variable, then set the retention on the flagship console. README copy is drafted for Paul's copy review and not in this branch.
Commits
15
Discussions
0
0 open
Tasks
0/0
done
Discussions
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- paul@keymail.dev pushed 8421474aa Merge remote-tracking branch 'origin/main' into stats-prune-400
- paul@keymail.dev pushed 8f362c97b Merge remote-tracking branch 'origin/main' into stats-prune-400
- paul@keymail.dev pushed 3d93ce538 release: tolerate MinIO listing marker-only prefixes in the version test
- paul@keymail.dev pushed 64e9b4ddd Merge remote-tracking branch 'origin/main' into stats-prune-400
- paul@keymail.dev pushed 3ac0bb110 Merge remote-tracking branch 'origin/main' into stats-prune-400
- paul@keymail.dev pushed 47d6934d8 census: re-pin stats-prune-400 after the IAM comment fix
- paul@keymail.dev pushed 51e7dcd35 Raise analytics prune limits and report unfinished passes
- paul@keymail.dev pushed 1e482544f census: propose stats-prune-400 region-host IAM units
- paul@keymail.dev pushed e8c7e30ab Make analytics retention an operator setting in days
- paul@keymail.dev pushed b235e9a08 Scope optional console IAM grants to analytics version pruning
- paul@keymail.dev pushed ea4115f5b Purge every version of expired analytics day files
- paul@keymail.dev pushed 61bab55f9 Add optional version listing and deletion to S3 stores
- paul@keymail.dev pushed 3cf918d6e Preserve prune progress and trim idle analytics caches
- paul@keymail.dev pushed 744fdbe37 Prune expired analytics from a bounded daily console pass
- paul@keymail.dev pushed 6d8bd3af4 Add optional batch deletion and counted directory listings