mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-30 18:46:00 +00:00
266fd004d2
Builds on @Hardik-369's instance-specific User-Agent idea and reworks the rest of the #1309 fix: - keep the unique User-Agent (buildUserAgent) — a shared UA gets the public Overpass mirrors to rate-limit harder; it appends the configured instance URL and is applied to every Nominatim/Overpass/Wikimedia call - add OVERPASS_URL so an operator behind locked-down egress (e.g. a Kubernetes cluster) can point the explore search at an internal/self-hosted Overpass instance instead of the public mirrors - keep the per-endpoint timeout default at 12s but make it tunable via OVERPASS_TIMEOUT_MS for slow self-hosted instances; non-positive/invalid values fall back to the default rather than 502-ing every search at a 0ms cap - log each endpoint's failure reason before the 502 so blocked egress is diagnosable instead of a bare "Overpass request failed" Adds unit tests for the User-Agent, endpoint and timeout resolution plus the all-mirrors-down path, and documents the two new env vars in .env.example, the wiki and the Helm chart.
79 lines
2.7 KiB
YAML
79 lines
2.7 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ include "trek.fullname" . }}-config
|
|
labels:
|
|
app: {{ include "trek.name" . }}
|
|
data:
|
|
NODE_ENV: {{ .Values.env.NODE_ENV | quote }}
|
|
PORT: {{ .Values.env.PORT | quote }}
|
|
{{- if .Values.env.TZ }}
|
|
TZ: {{ .Values.env.TZ | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.LOG_LEVEL }}
|
|
LOG_LEVEL: {{ .Values.env.LOG_LEVEL | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.ALLOWED_ORIGINS }}
|
|
ALLOWED_ORIGINS: {{ .Values.env.ALLOWED_ORIGINS | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.APP_URL }}
|
|
APP_URL: {{ .Values.env.APP_URL | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.FORCE_HTTPS }}
|
|
FORCE_HTTPS: {{ .Values.env.FORCE_HTTPS | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.HSTS_INCLUDE_SUBDOMAINS }}
|
|
HSTS_INCLUDE_SUBDOMAINS: {{ .Values.env.HSTS_INCLUDE_SUBDOMAINS | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.COOKIE_SECURE }}
|
|
COOKIE_SECURE: {{ .Values.env.COOKIE_SECURE | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.SESSION_DURATION }}
|
|
SESSION_DURATION: {{ .Values.env.SESSION_DURATION | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.SESSION_DURATION_REMEMBER }}
|
|
SESSION_DURATION_REMEMBER: {{ .Values.env.SESSION_DURATION_REMEMBER | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.TRUST_PROXY }}
|
|
TRUST_PROXY: {{ .Values.env.TRUST_PROXY | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.ALLOW_INTERNAL_NETWORK }}
|
|
ALLOW_INTERNAL_NETWORK: {{ .Values.env.ALLOW_INTERNAL_NETWORK | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_ISSUER }}
|
|
OIDC_ISSUER: {{ .Values.env.OIDC_ISSUER | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_CLIENT_ID }}
|
|
OIDC_CLIENT_ID: {{ .Values.env.OIDC_CLIENT_ID | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_DISPLAY_NAME }}
|
|
OIDC_DISPLAY_NAME: {{ .Values.env.OIDC_DISPLAY_NAME | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_ONLY }}
|
|
OIDC_ONLY: {{ .Values.env.OIDC_ONLY | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_ADMIN_CLAIM }}
|
|
OIDC_ADMIN_CLAIM: {{ .Values.env.OIDC_ADMIN_CLAIM | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_ADMIN_VALUE }}
|
|
OIDC_ADMIN_VALUE: {{ .Values.env.OIDC_ADMIN_VALUE | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_SCOPE }}
|
|
OIDC_SCOPE: {{ .Values.env.OIDC_SCOPE | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OIDC_DISCOVERY_URL }}
|
|
OIDC_DISCOVERY_URL: {{ .Values.env.OIDC_DISCOVERY_URL | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.DEMO_MODE }}
|
|
DEMO_MODE: {{ .Values.env.DEMO_MODE | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.MCP_RATE_LIMIT }}
|
|
MCP_RATE_LIMIT: {{ .Values.env.MCP_RATE_LIMIT | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OVERPASS_URL }}
|
|
OVERPASS_URL: {{ .Values.env.OVERPASS_URL | quote }}
|
|
{{- end }}
|
|
{{- if .Values.env.OVERPASS_TIMEOUT_MS }}
|
|
OVERPASS_TIMEOUT_MS: {{ .Values.env.OVERPASS_TIMEOUT_MS | quote }}
|
|
{{- end }}
|