Feature 03 task 5: Trusted proxy handling for forwarded headers (#23)
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com> Co-committed-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #23.
This commit is contained in:
@@ -29,6 +29,15 @@ docker compose project "mealquest" — 10.60.1.14
|
||||
One Go service serves the API, the auth flow, media and the PWA. Its SQLite
|
||||
database is replicated by Litestream to the NAS.
|
||||
|
||||
Traefik terminates TLS. The service honours `X-Forwarded-For` and
|
||||
`X-Forwarded-Proto` only from peers listed in `MEALQUEST_TRUSTED_PROXY`
|
||||
(comma-separated IPs/CIDRs; production lists `10.60.1.33`); from any other
|
||||
peer they are ignored. The client is the rightmost `X-Forwarded-For` address
|
||||
that is not a trusted proxy. The resolved client IP is added as `client_ip`
|
||||
to every log line written while handling a request. The OIDC redirect URI
|
||||
and the Secure cookies are fixed by `MEALQUEST_PUBLIC_URL`, never by request
|
||||
headers, so sign-in works whichever peer the request arrives from.
|
||||
|
||||
## Repository layout
|
||||
|
||||
| Path | Purpose |
|
||||
|
||||
Reference in New Issue
Block a user