Add Garage beside MinIO
All checks were successful
Deploy storage stack / deploy (push) Successful in 25s

MinIO is abandoned upstream and its images are gone from the registries,
so the object store cannot be rebuilt or updated. Garage takes its
place.

This is the first step: Garage runs as one node next to MinIO, with the
same three buckets and one key per app, and is not routed yet. MinIO
keeps serving s3.asxp.io and is no longer bootstrapped, so its users
stay as they are until the data is copied and the apps are switched.

Garage only accepts keys in its own format. The bootstrap hashes the
existing secrets into that format, as the apps' deploys will, so no
secret has to change for the move; a secret already in Garage's format
is used as it is.

Garage has no anonymous S3 access. The public bucket is marked as a
website instead, to be served through Garage's web endpoint.

Assisted-by: Claude:fable-5-2
This commit is contained in:
Sergei Poljanski 2026-11-11 03:41:03 +04:00
commit dc04ff3cce
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
4 changed files with 171 additions and 23 deletions

View file

@ -23,7 +23,7 @@ jobs:
REMOTE_HOST: ${{ secrets.DEPLOY_IP }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "docker-compose.yml init"
SOURCE: "docker-compose.yml garage.toml init"
TARGET: "/opt/storage/"
- name: Write .env from secrets and bring stack up
@ -63,15 +63,26 @@ jobs:
PUBLIC_S3_SECRET_KEY=${PUBLIC_S3_SECRET_KEY}
EOF
chmod 600 /opt/storage/.env
chmod +x /opt/storage/init/postgres-init.sh /opt/storage/init/minio-bootstrap.sh
chmod +x /opt/storage/init/postgres-init.sh /opt/storage/init/garage-bootstrap.sh
# Garage's RPC secret never leaves the host: made once, kept
# outside the rsynced paths.
mkdir -p /opt/storage/secrets
if [ ! -s /opt/storage/secrets/garage_rpc_secret ]; then
head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n' > /opt/storage/secrets/garage_rpc_secret
fi
chmod 600 /opt/storage/secrets/garage_rpc_secret
cd /opt/storage
# minio/minio and minio/mc are gone from Docker Hub (upstream
# abandoned); the host's cached copies are all there is.
docker compose pull --ignore-pull-failures
docker compose up -d postgres minio
# Run init containers (idempotent) and wait for them to exit.
docker compose up -d postgres minio garage
# Run the init steps (idempotent).
docker compose up --exit-code-from postgres-init postgres-init
docker compose up --exit-code-from minio-init minio-init
ASXPIO_S3_ACCESS_KEY="${ASXPIO_S3_ACCESS_KEY}" ASXPIO_S3_SECRET_KEY="${ASXPIO_S3_SECRET_KEY}" \
BINGO_S3_ACCESS_KEY="${BINGO_S3_ACCESS_KEY}" BINGO_S3_SECRET_KEY="${BINGO_S3_SECRET_KEY}" \
PUBLIC_S3_ACCESS_KEY="${PUBLIC_S3_ACCESS_KEY}" PUBLIC_S3_SECRET_KEY="${PUBLIC_S3_SECRET_KEY}" \
sh init/garage-bootstrap.sh
echo "Storage stack deployed."