libretime/tools/easypanel-config-generator.sh

62 lines
1.7 KiB
Bash

#!/bin/sh
# Generador de config para EasyPanel
# Lee variables de entorno y escribe /config/config.yml
set -eu
CONFIG_PATH=/config/config.yml
cat > "$CONFIG_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}"
#!/bin/sh
# Generador de config para EasyPanel
# Lee variables de entorno y escribe /config/config.yml
set -eu
CONFIG_PATH=/config/config.yml
# Usar heredoc sin comillas para permitir expansión de variables
cat > "$CONFIG_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
echo "wrote $CONFIG_PATH"
# Mantener el contenedor en ejecución para que dependientes puedan verificar salud
tail -f /dev/null