No description
- Shell 86.1%
- Nix 13.9%
|
All checks were successful
Deploy storage stack / deploy (push) Successful in 20s
The data is copied and verified and both apps sign with their Garage keys, so send s3.asxp.io to Garage's S3 API. MinIO loses its route and stays up, unrouted, as the way back. Garage answers no anonymous S3 request. Unsigned GET and HEAD of /public/<key> go to its web endpoint instead, with the Host header the endpoint picks the bucket by, so the links handed out so far keep working. Signed requests for that bucket still reach the S3 API. Assisted-by: Claude:fable-5-2 |
||
|---|---|---|
| .forgejo/workflows | ||
| init | ||
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| flake.lock | ||
| flake.nix | ||
| garage.toml | ||
| README.md | ||
| SECRETS.md | ||
storage
Postgres + MinIO for asxp.io and any future small services that need a database or object storage. Single-host, no clustering. Deploys via Forgejo Actions to the same box that runs the apps.
What's here
docker-compose.yml—postgres,minio, and one-shot init containers.init/postgres-init.sh— idempotent role/DB bootstrap.init/minio-bootstrap.sh— idempotent bucket + per-app service account..forgejo/workflows/deploy.yaml— pushes compose +.envto the prod host and runsdocker compose up -d.
Networking
Two Docker networks:
storage— internal-only; apps join this as an external network to reachpostgres:5432andminio:9000.traefik— existing reverse-proxy network. Only MinIO joins it, to expose the S3 API athttps://s3.asxp.io.
The MinIO console (:9001) is not exposed externally. To use it, SSH-port-forward:
ssh -L 9001:storage-minio:9001 deploy@prod
# then open http://localhost:9001
Adding a new app
- Pick an app name, e.g.
foo. - Pick a DB password, S3 access key, S3 secret key for it (any random hex).
- Add Forgejo secrets
FOO_DB_PASSWORD,FOO_S3_ACCESS_KEY,FOO_S3_SECRET_KEYto this repo and to the foo repo. - Extend
init/postgres-init.shwithensure_role "foo" ...andensure_db "foo" "foo". - Extend
init/minio-bootstrap.shwithensure_bucket "foo-...",write_policy "foo-...-rw" "foo-...",ensure_user ... "foo-...-rw". - Pass the new envs through in
docker-compose.ymland the deploy workflow. - Push.
State and backups
Two named Docker volumes are stateful:
pg_data(Postgres data dir) —/var/lib/docker/volumes/storage_pg_data/_dataminio_data(S3 object bytes) —/var/lib/docker/volumes/storage_minio_data/_data
Server-level backup covers both. If you ever move off whole-server backup,
the minimum is pg_dumpall for Postgres and mc mirror for MinIO.
Secrets
See SECRETS.md for the full list of Forgejo secrets this repo
needs. Apps that consume storage (asxpio, future) also need the per-app
credentials added on their repo so they can connect.