fix(dev): proxy local API and restrict frontend upstream
This commit is contained in:
@@ -3,13 +3,10 @@ set -eu
|
||||
|
||||
THT_FRONTEND_API_UPSTREAM=${THT_FRONTEND_API_UPSTREAM:-http://core:8787}
|
||||
THT_FRONTEND_API_UPSTREAM=${THT_FRONTEND_API_UPSTREAM%/}
|
||||
case "$THT_FRONTEND_API_UPSTREAM" in
|
||||
http://*|https://*) ;;
|
||||
*)
|
||||
echo "Invalid THT_FRONTEND_API_UPSTREAM: use an internal http(s) upstream" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
if ! /usr/local/bin/validate-frontend-api-upstream "$THT_FRONTEND_API_UPSTREAM"; then
|
||||
echo "Invalid THT_FRONTEND_API_UPSTREAM: expected internal http://core:8787" >&2
|
||||
exit 2
|
||||
fi
|
||||
export THT_FRONTEND_API_UPSTREAM
|
||||
|
||||
if ! envsubst '${THT_FRONTEND_API_UPSTREAM}' \
|
||||
|
||||
Reference in New Issue
Block a user