Files
urapt/urapt-web/docker-entrypoint.sh
T
owen 2a1ed3af04
CI / Test (linux/amd64) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Cross-build (darwin/amd64) (push) Waiting to run
CI / Cross-build (linux/amd64) (push) Waiting to run
CI / Cross-build (darwin/arm64) (push) Waiting to run
CI / Cross-build (linux/arm64) (push) Waiting to run
Normalize Railway upstream URL for web proxy
2026-06-29 20:37:33 -05:00

18 lines
535 B
Bash

#!/bin/sh
set -eu
if [ -z "${URAPT_SERVER_URL:-}" ]; then
echo "URAPT_SERVER_URL is required, e.g. https://urapt-production.up.railway.app" >&2
exit 1
fi
# Caddy reverse_proxy upstreams may only contain scheme, host, and port.
# Railway/public URLs are often copied with a trailing slash; normalize that.
URAPT_UPSTREAM="$URAPT_SERVER_URL"
while [ "${URAPT_UPSTREAM%/}" != "$URAPT_UPSTREAM" ]; do
URAPT_UPSTREAM="${URAPT_UPSTREAM%/}"
done
export URAPT_UPSTREAM
exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile