#!/bin/sh set -e # Inject container env into the static SPA at runtime. The app loads # /runtime-env.js (see index.html) before its bundle. # FABRIC_OIDC_ONLY - "true" hides the username/password login form # FIX_TO_CENTER - non-empty pins the Center API base + hides its input ONLY="false" case "$(printf '%s' "${FABRIC_OIDC_ONLY:-}" | tr '[:upper:]' '[:lower:]')" in 1|true|yes|on) ONLY="true" ;; esac # JSON-escape FIX_TO_CENTER (backslash + double-quote) FIX="$(printf '%s' "${FIX_TO_CENTER:-}" | sed 's/\\/\\\\/g; s/"/\\"/g')" cat > /usr/share/nginx/html/runtime-env.js <