Skip to content

Commit eba2cd0

Browse files
committed
chore(deploy): expose AUTH_TRUSTED_PROXIES in docker-compose.prod and Helm chart
1 parent 0addae4 commit eba2cd0

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

docker-compose.prod.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ services:
1717
# addition to NEXT_PUBLIC_APP_URL. Use when serving from multiple domains
1818
# (apex + www, alias hostnames, reverse-proxy IPs). Empty by default.
1919
- TRUSTED_ORIGINS=${TRUSTED_ORIGINS:-}
20+
# AUTH_TRUSTED_PROXIES: comma-separated reverse-proxy IPs or CIDR ranges in
21+
# front of the app (ingress, load balancer). Better Auth walks
22+
# x-forwarded-for right to left, skips these hops, and uses the first
23+
# untrusted address as the client IP. Required for correct session IPs and
24+
# rate-limit keying behind a multi-hop proxy chain. Empty by default.
25+
- AUTH_TRUSTED_PROXIES=${AUTH_TRUSTED_PROXIES:-}
2026
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
2127
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
2228
- API_ENCRYPTION_KEY=${API_ENCRYPTION_KEY:-}

helm/sim/values.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@
159159
"type": "string",
160160
"description": "Comma-separated additional public origins to trust for auth (e.g. 'https://app.example.com,https://www.example.com'). Merged into Better Auth trustedOrigins."
161161
},
162+
"AUTH_TRUSTED_PROXIES": {
163+
"type": "string",
164+
"description": "Comma-separated reverse-proxy IPs or CIDR ranges in front of the app (e.g. '10.0.0.0/16'). Better Auth walks x-forwarded-for right to left, skips these hops, and uses the first untrusted address as the client IP."
165+
},
162166
"SSO_TRUSTED_PROVIDER_IDS": {
163167
"type": "string",
164168
"description": "Comma-separated SSO provider IDs to trust for automatic account linking when an SSO sign-in matches an existing account's email. Only needed for IdPs that do not assert email_verified. Merged into Better Auth accountLinking.trustedProviders."

helm/sim/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ app:
8585
# TRUSTED_ORIGINS: comma-separated extra public origins to trust for auth (e.g. apex+www, alias hostnames).
8686
# Merged into Better Auth `trustedOrigins` alongside NEXT_PUBLIC_APP_URL. Leave empty when serving from a single origin.
8787
TRUSTED_ORIGINS: ""
88+
# AUTH_TRUSTED_PROXIES: comma-separated reverse-proxy IPs or CIDR ranges in front of the app
89+
# (ingress controller, load balancer). Better Auth walks x-forwarded-for right to left, skips
90+
# these hops, and uses the first untrusted address as the client IP. Required for correct
91+
# session IPs and rate-limit keying behind a multi-hop proxy chain (e.g. "10.0.0.0/16").
92+
AUTH_TRUSTED_PROXIES: ""
8893
# SOCKET_SERVER_URL: Auto-detected when realtime.enabled=true (uses internal service)
8994
# NEXT_PUBLIC_SOCKET_URL: public WebSocket URL for browsers. Leave empty to default to the
9095
# page's own origin (assumes the ingress/reverse proxy routes /socket.io to the realtime service).

0 commit comments

Comments
 (0)