diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 3e493769..e3cf2372 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -7,12 +7,23 @@ set -e ENV_JS="/usr/share/nginx/html/env.js" +# Escapes a value for safe embedding in a double-quoted JS string literal +# (backslashes, double quotes; newlines collapsed to spaces). +js_escape() { + printf '%s' "$1" | tr '\n' ' ' | sed 's/\\/\\\\/g; s/"/\\"/g' +} + +SITE_NAME=$(js_escape "${APP_SITE_NAME:-Faunosteo}") +BRAND_NAME=$(js_escape "${APP_BRAND_NAME:-Faunosteo}") +FOOTER_NAME=$(js_escape "${APP_FOOTER_NAME:-Faunosteo}") +TAGLINE=$(js_escape "${APP_TAGLINE:-Outils pour ostéopathes animaliers}") + cat > "$ENV_JS" <