forgejo/lib
Adam Moussa f6b105a9fd
Some checks are pending
Deploy / deploy (push) Waiting to run
fix(infra): persistent data volume + restore-on-boot + cached AMI (#22)
Today's instance replacement (uncached AMI lookup resolved a new AL2023
release) destroyed the root volume holding all Forgejo state; restored
manually from the 05:00 S3 dump. This makes replacement harmless:

- New 50 GiB standalone volume (RemovalPolicy.RETAIN) mounted at
  /var/lib/forgejo — sqlite db, repositories, and logs all survive
  instance replacement and stack deletion. No app.ini path changes.
- Restore-on-boot: if the data volume has no database (first boot or
  total volume loss), userdata restores the latest S3 dump
  automatically before starting the service. Volume loss self-heals
  to <=24h-old state.
- blkid guard: an existing filesystem is mounted, never formatted.
- cachedInContext: true + committed cdk.context.json — AMI changes
  (and the instance replacement they force) become deliberate.
- Root volume 50 -> 20 GiB; state no longer lives there.
- forgejo-backup tag on the data volume brings it under the existing
  DLM snapshot policy.

Deploy replaces the instance once; restore-on-boot pulls the fresh
17:43 UTC dump.
2026-06-05 13:47:51 -04:00
..
constructs Fix compliance audit violations from issue #6 (#7) 2026-05-18 16:35:23 -04:00
forgejo-replica-stack.ts Add 3-2-1 backup strategy with cross-region and GCS offsite (#5) 2026-05-15 17:59:31 -04:00
forgejo-stack.ts fix(infra): persistent data volume + restore-on-boot + cached AMI (#22) 2026-06-05 13:47:51 -04:00