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:
25
infra/scripts/ensure_garage_prod_config.sh
Executable file
25
infra/scripts/ensure_garage_prod_config.sh
Executable 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"
|
||||
Reference in New Issue
Block a user