fix: route all public traffic through Traefik at localhost:80
Logto ENDPOINT now points at Traefik (http://localhost) instead of directly at port 3001. All services share the same base URL, eliminating OIDC issuer mismatches and crypto.subtle secure context issues. - Remove :3001 from all public-facing Logto URLs - Add cameleer3-server-ui to Traefik at /server/ with prefix strip - Dashboard link uses /server/ path instead of port 8082 - Bootstrap Host headers match Logto ENDPOINT (no port) - Redirect URIs simplified (Traefik handles port 80) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,8 +42,8 @@ SERVER_UI_PASS="${SERVER_UI_PASS:-admin}"
|
||||
|
||||
# Redirect URIs (derived from PUBLIC_HOST)
|
||||
HOST="${PUBLIC_HOST:-localhost}"
|
||||
SPA_REDIRECT_URIS="[\"http://${HOST}/callback\",\"http://${HOST}:8080/callback\",\"http://${HOST}:5173/callback\"]"
|
||||
SPA_POST_LOGOUT_URIS="[\"http://${HOST}/login\",\"http://${HOST}:8080/login\",\"http://${HOST}:5173/login\"]"
|
||||
SPA_REDIRECT_URIS="[\"http://${HOST}/callback\",\"http://${HOST}:5173/callback\"]"
|
||||
SPA_POST_LOGOUT_URIS="[\"http://${HOST}/login\",\"http://${HOST}:5173/login\"]"
|
||||
TRAD_REDIRECT_URIS="[\"http://${HOST}:8081/oidc/callback\"]"
|
||||
TRAD_POST_LOGOUT_URIS="[\"http://${HOST}:8081\"]"
|
||||
|
||||
@@ -104,7 +104,7 @@ get_admin_token() {
|
||||
get_default_token() {
|
||||
curl -s -X POST "${LOGTO_ENDPOINT}/oidc/token" \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
-H "Host: ${HOST}:3001" \
|
||||
-H "Host: ${HOST}" \
|
||||
-d "grant_type=client_credentials&client_id=${1}&client_secret=${2}&resource=${MGMT_API_RESOURCE}&scope=all"
|
||||
}
|
||||
|
||||
@@ -116,18 +116,18 @@ log "Got Management API token."
|
||||
|
||||
# --- Helper: Logto API calls ---
|
||||
api_get() {
|
||||
curl -s -H "Authorization: Bearer $TOKEN" -H "Host: ${HOST}:3001" "${LOGTO_ENDPOINT}${1}" 2>/dev/null || echo "[]"
|
||||
curl -s -H "Authorization: Bearer $TOKEN" -H "Host: ${HOST}" "${LOGTO_ENDPOINT}${1}" 2>/dev/null || echo "[]"
|
||||
}
|
||||
api_post() {
|
||||
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -H "Host: ${HOST}:3001" \
|
||||
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -H "Host: ${HOST}" \
|
||||
-d "$2" "${LOGTO_ENDPOINT}${1}" 2>/dev/null || true
|
||||
}
|
||||
api_put() {
|
||||
curl -s -X PUT -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -H "Host: ${HOST}:3001" \
|
||||
curl -s -X PUT -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -H "Host: ${HOST}" \
|
||||
-d "$2" "${LOGTO_ENDPOINT}${1}" 2>/dev/null || true
|
||||
}
|
||||
api_delete() {
|
||||
curl -s -X DELETE -H "Authorization: Bearer $TOKEN" -H "Host: ${HOST}:3001" "${LOGTO_ENDPOINT}${1}" 2>/dev/null || true
|
||||
curl -s -X DELETE -H "Authorization: Bearer $TOKEN" -H "Host: ${HOST}" "${LOGTO_ENDPOINT}${1}" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# ============================================================
|
||||
|
||||
Reference in New Issue
Block a user