#!/bin/sh # Runs via nginx's own /docker-entrypoint.d/ hook mechanism (official nginx # image sources every executable script there before starting nginx) -- # no custom ENTRYPOINT needed. Writes /runtime-env.js, loaded by index.html # before the app bundle (see Dockerfile), so this container's own env vars # can flip Conduit between an isolated private relay and the public Conduit # network without rebuilding the image -- see # packages/core/src/config.ts's getRuntimeOverrides() (installed by # apply-runtime-override.py) for the other half of this. set -eu CONDUIT_MODE="${CONDUIT_MODE:-public}" OUT=/usr/share/nginx/html/runtime-env.js if [ "$CONDUIT_MODE" = "private" ]; then if [ -z "${CONDUIT_PRIVATE_RELAY_URLS:-}" ]; then echo "conduit-market: CONDUIT_MODE=private requires CONDUIT_PRIVATE_RELAY_URLS (comma-separated wss:// URLs) -- refusing to start with no relay configured" >&2 exit 1 fi cat > "$OUT" < "$OUT" <