carlos / platform Public

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