Some checks are pending
Container / meta (analyzer) (push) Waiting to run
Container / meta (api) (push) Waiting to run
Container / meta (legacy) (push) Waiting to run
Container / meta (nginx) (push) Waiting to run
Container / meta (playout) (push) Waiting to run
Container / meta (worker) (push) Waiting to run
Container / build (push) Blocked by required conditions
Project / pre-commit (push) Waiting to run
Project / test-tools (push) Waiting to run
Release-Please / release-please (push) Waiting to run
53 lines
1.5 KiB
Bash
Executable File
53 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# Generador de config para EasyPanel
|
|
# Lee variables de entorno y escribe /config/config.yml de forma atómica
|
|
|
|
set -eu
|
|
|
|
CONFIG_PATH=/config/config.yml
|
|
TMP_PATH=/config/config.yml.tmp
|
|
|
|
# Generar usando heredoc sin comillas para permitir expansión de variables
|
|
cat > "$TMP_PATH" <<EOF
|
|
general:
|
|
public_url: "${LIBRETIME_GENERAL_PUBLIC_URL:-http://localhost:8080}"
|
|
api_key: "${LIBRETIME_API_KEY:-}"
|
|
secret_key: "${LIBRETIME_SECRET_KEY:-}"
|
|
|
|
database:
|
|
host: "${POSTGRES_HOST:-postgres}"
|
|
port: ${POSTGRES_PORT:-5432}
|
|
name: "${POSTGRES_DB:-libretime}"
|
|
user: "${POSTGRES_USER:-libretime}"
|
|
password: "${POSTGRES_PASSWORD:-}"
|
|
|
|
rabbitmq:
|
|
host: "${RABBITMQ_HOST:-rabbitmq}"
|
|
port: ${RABBITMQ_PORT:-5672}
|
|
vhost: "${RABBITMQ_DEFAULT_VHOST:-/libretime}"
|
|
user: "${RABBITMQ_DEFAULT_USER:-libretime}"
|
|
password: "${RABBITMQ_DEFAULT_PASS:-}"
|
|
|
|
icecast:
|
|
source_password: "${ICECAST_SOURCE_PASSWORD:-changeme}"
|
|
admin_password: "${ICECAST_ADMIN_PASSWORD:-changeme}"
|
|
relay_password: "${ICECAST_RELAY_PASSWORD:-changeme}"
|
|
admin_user: "${ICECAST_ADMIN_USER:-admin}"
|
|
hostname: "${ICECAST_HOSTNAME:-localhost}"
|
|
EOF
|
|
|
|
# Validación mínima: debe contener la clave 'general:'
|
|
if ! grep -q '^general:' "$TMP_PATH"; then
|
|
echo "ERROR: config generation failed (missing 'general:')"
|
|
rm -f "$TMP_PATH"
|
|
exit 1
|
|
fi
|
|
|
|
# Mover de forma atómica
|
|
mv "$TMP_PATH" "$CONFIG_PATH"
|
|
|
|
echo "wrote $CONFIG_PATH"
|
|
|
|
# Mantener el contenedor en ejecución para que dependientes puedan verificar salud
|
|
tail -f /dev/null
|