Aggiunge Garage al compose di produzione e script di bootstrap.

Rails e Sidekiq usano S3 interno (http://garage:3900); setup_garage_production.sh
configura bucket, chiavi e infra/.env sul server.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 08:05:35 +02:00
parent 565bc2c548
commit fd225fbadd
8 changed files with 128 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Crea garage/garage.prod.toml con secret casuali se mancante (solo produzione).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DEST="${ROOT}/garage/garage.prod.toml"
TEMPLATE="${ROOT}/garage/garage.prod.toml.example"
if [ -f "$DEST" ]; then
echo "Config Garage produzione già presente: $DEST"
exit 0
fi
if [ ! -f "$TEMPLATE" ]; then
echo "Manca $TEMPLATE"
exit 1
fi
RPC="$(openssl rand -hex 32)"
ADMIN="$(openssl rand -hex 32)"
sed -e "s/CHANGE_ME_RPC_SECRET_64_HEX/${RPC}/" \
-e "s/CHANGE_ME_ADMIN_TOKEN_64_HEX/${ADMIN}/" \
"$TEMPLATE" > "$DEST"
chmod 600 "$DEST"
echo "Creato $DEST"