Cloud container: RUDDER_ALLOW_HOST (the public host Rudder's engine accepts), defaulting to OIDC_REDIRECT_URL's host; 2 vCPUs advised
The engine now refuses non-loopback Host headers and Vite's proxy passes the public host through, so without this every /api/rudder call is 403 (studio, RUDSRV-STU2). entry.sh derives it from OIDC_REDIRECT_URL when unset; the README documents it and the CPU need (it ran ~1.5x behind real time on a loaded box).
This commit is contained in:
parent
c0487bb39d
commit
a5759491d0
2 changed files with 8 additions and 1 deletions
|
|
@ -67,7 +67,8 @@ there. Only then does it swap the new build in.
|
|||
| `PB_SUPERUSER_EMAIL`, `PB_SUPERUSER_PASSWORD` | PocketBase's superuser, set on start in both instances |
|
||||
| `PUBLIC_API_BASE` | the public API URL written into the build's `runtime-config.js` (e.g. `https://<host>/api-prod`) |
|
||||
| `BUILD_MAX_OLD_SPACE_MB` | Node heap cap for a build (default `1536`) |
|
||||
| `RUDDER_ENGINE` | `1` runs Rudder's voice-to-text engine here, fed by the browser's microphone (about 1 GB more; its model, ~742 MB, downloads once to `RUDDER_HOME`, default `/data/rudder`) |
|
||||
| `RUDDER_ENGINE` | `1` runs Rudder's voice-to-text engine here, fed by the browser's microphone (about 1 GB more; its model, ~742 MB, downloads once to `RUDDER_HOME`, default `/data/rudder`). Give the container at least 2 vCPUs, or transcription falls behind speech |
|
||||
| `RUDDER_ALLOW_HOST` | the public host the engine accepts (it refuses others); defaults to the host in `OIDC_REDIRECT_URL` |
|
||||
|
||||
Mount a persistent volume at **`/data`** (PocketBase data and published builds). Memory measured on
|
||||
the running container: about 0.45 GB idle, up to about 1.5 GB more during a build, so give it
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ CONFIG=/app/repo/deployment/cloud/vite.cloud.config.mjs
|
|||
# /api/rudder, which stays behind the sign-in (it is not a public route). About 1 GB resident.
|
||||
if [ "${RUDDER_ENGINE:-0}" = 1 ]; then
|
||||
export RUDDER_HOME="${RUDDER_HOME:-/data/rudder}" RUDDER_AUDIO=browser
|
||||
# The engine refuses a non-loopback Host header, and Vite's proxy passes the public host through:
|
||||
# allow the public host, defaulting to the one in OIDC_REDIRECT_URL.
|
||||
if [ -z "${RUDDER_ALLOW_HOST:-}" ] && [ -n "${OIDC_REDIRECT_URL:-}" ]; then
|
||||
RUDDER_ALLOW_HOST=$(printf '%s' "$OIDC_REDIRECT_URL" | sed -E 's#^[a-z]+://([^/:]+).*#\1#')
|
||||
fi
|
||||
export RUDDER_ALLOW_HOST="${RUDDER_ALLOW_HOST:-}"
|
||||
bash /app/repo/backend/rudder-engine/setup-runtime.sh \
|
||||
|| echo "[rudder] setup failed: the widget will report the engine offline"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue