diff --git a/.github/scripts/build-catalog.sh b/.github/scripts/build-catalog.sh index 8ef0f5ef87d..6373080e7c5 100755 --- a/.github/scripts/build-catalog.sh +++ b/.github/scripts/build-catalog.sh @@ -276,6 +276,16 @@ include_questions(){ /# Include{documentation}/ { for (i=0;i "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml + # Replace # Include{[forwardedHeaders]} with the standard forwardedHeaders codesnippet + awk 'NR==FNR { a[n++]=$0; next } + /# Include{forwardedHeaders}/ { for (i=0;i "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml + + # Replace # Include{proxyProtocol} with the standard proxyProtocol codesnippet + awk 'NR==FNR { a[n++]=$0; next } + /# Include{proxyProtocol}/ { for (i=0;i "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml + } export -f include_questions diff --git a/charts/stable/traefik/Chart.yaml b/charts/stable/traefik/Chart.yaml index 8f357dbb77c..6dbad81094f 100644 --- a/charts/stable/traefik/Chart.yaml +++ b/charts/stable/traefik/Chart.yaml @@ -23,7 +23,7 @@ sources: - https://github.com/traefik/traefik-helm-chart - https://traefik.io/ type: application -version: 13.2.3 +version: 13.3.0 annotations: truecharts.org/catagories: | - network diff --git a/charts/stable/traefik/questions.yaml b/charts/stable/traefik/questions.yaml index 1ae4ff17927..4d74a741c77 100644 --- a/charts/stable/traefik/questions.yaml +++ b/charts/stable/traefik/questions.yaml @@ -605,36 +605,8 @@ questions: schema: type: string default: "websecure" - - variable: forwardedHeaders - label: "Accept Forwarded Headers" - schema: - additional_attrs: true - type: dict - attrs: - - variable: enabled - label: "Enable" - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: trustedIPs - label: "Trusted IPs" - schema: - type: list - default: [] - items: - - variable: trustedIPsEntry - label: "" - schema: - type: string - required: true - default: "" - - variable: insecureMode - label: "Insecure Mode" - schema: - type: boolean - default: false +# Include{forwardedHeaders} +# Include{proxyProtocol} - variable: websecure label: "websecure Entrypoints Configuration" schema: @@ -661,36 +633,8 @@ questions: label: "Redirect to Entrypoint" schema: type: string - - variable: forwardedHeaders - label: "Accept Forwarded Headers" - schema: - additional_attrs: true - type: dict - attrs: - - variable: enabled - label: "Enable" - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: trustedIPs - label: "Trusted IPs" - schema: - type: list - default: [] - items: - - variable: trustedIPsEntry - label: "" - schema: - type: string - required: true - default: "" - - variable: insecureMode - label: "Insecure Mode" - schema: - type: boolean - default: false +# Include{forwardedHeaders} +# Include{proxyProtocol} - variable: tls label: "websecure Entrypoints Configuration" schema: @@ -763,36 +707,8 @@ questions: label: "Redirect to Entrypoint" schema: type: string - - variable: forwardedHeaders - label: "Accept Forwarded Headers" - schema: - additional_attrs: true - type: dict - attrs: - - variable: enabled - label: "Enable" - schema: - type: boolean - default: false - show_subquestions_if: true - subquestions: - - variable: trustedIPs - label: "Trusted IPs" - schema: - type: list - default: [] - items: - - variable: trustedIPsEntry - label: "" - schema: - type: string - required: true - default: "" - - variable: insecureMode - label: "Insecure Mode" - schema: - type: boolean - default: false +# Include{forwardedHeaders} +# Include{proxyProtocol} # Include{ingressRoot} - variable: main label: "Main Ingress" diff --git a/charts/stable/traefik/templates/_args.tpl b/charts/stable/traefik/templates/_args.tpl index e51ea524cae..68c640bf0df 100644 --- a/charts/stable/traefik/templates/_args.tpl +++ b/charts/stable/traefik/templates/_args.tpl @@ -67,6 +67,17 @@ args: - "--providers.kubernetesingress.ingressclass={{ .Release.Name }}" {{- end }} {{- range $entrypoint, $config := $ports }} + {{/* add args for proxyProtocol support */}} + {{- if $config.proxyProtocol }} + {{- if $config.proxyProtocol.enabled }} + {{- if $config.proxyProtocol.insecureMode }} + - "--entrypoints.{{ $entrypoint }}.proxyProtocol.insecure" + {{- end }} + {{- if not ( empty $config.proxyProtocol.trustedIPs ) }} + - "--entrypoints.{{ $entrypoint }}.proxyProtocol.trustedIPs={{ join "," $config.proxyProtocol.trustedIPs }}" + {{- end }} + {{- end }} + {{- end }} {{/* add args for forwardedHeaders support */}} {{- if $config.forwardedHeaders.enabled }} {{- if not ( empty $config.forwardedHeaders.trustedIPs ) }} diff --git a/charts/stable/traefik/values.yaml b/charts/stable/traefik/values.yaml index 3870edb2a4a..019612f4519 100644 --- a/charts/stable/traefik/values.yaml +++ b/charts/stable/traefik/values.yaml @@ -152,6 +152,9 @@ service: # -- Forwarded Headers should never be enabled on Main entrypoint forwardedHeaders: enabled: false + # -- Proxy Protocol should never be enabled on Main entrypoint + proxyProtocol: + enabled: false tcp: enabled: true type: LoadBalancer @@ -161,6 +164,8 @@ service: port: 9080 protocol: HTTP redirectTo: websecure + # Options: Empty, 0 (ingore), or positive int + # redirectPort: # -- Configure (Forwarded Headers)[https://doc.traefik.io/traefik/routing/entrypoints/#forwarded-headers] Support forwardedHeaders: enabled: false @@ -168,8 +173,13 @@ service: trustedIPs: [] # -- Trust all forwarded headers insecureMode: false - # Options: Empty, 0 (ingore), or positive int - # redirectPort: + # -- Configure (Proxy Protocol Headers)[https://doc.traefik.io/traefik/routing/entrypoints/#proxyprotocol] Support + proxyProtocol: + enabled: false + # -- Only IPs in trustedIPs will lead to remote client address replacement + trustedIPs: [] + # -- Trust every incoming connection + insecureMode: false websecure: enabled: true port: 9443 @@ -181,6 +191,13 @@ service: trustedIPs: [] # -- Trust all forwarded headers insecureMode: false + # -- Configure (Proxy Protocol Headers)[https://doc.traefik.io/traefik/routing/entrypoints/#proxyprotocol] Support + proxyProtocol: + enabled: false + # -- Only IPs in trustedIPs will lead to remote client address replacement + trustedIPs: [] + # -- Trust every incoming connection + insecureMode: false # tcpexample: # enabled: true # targetPort: 9443 @@ -207,6 +224,9 @@ service: # -- Forwarded Headers should never be enabled on Metrics entrypoint forwardedHeaders: enabled: false + # -- Proxy Protocol should never be enabled on Metrics entrypoint + proxyProtocol: + enabled: false udp: enabled: false @@ -328,7 +348,7 @@ middlewares: redirectRegex: [] # - name: redirectRegexName # regex: putregexhere - # replacement: repslacementurlhere + # replacement: replacementurlhere # permanent: false stripPrefixRegex: [] # - name: stripPrefixRegexName diff --git a/cspell.config.yaml b/cspell.config.yaml index 49513c40f13..e4979ff0d81 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -4,20 +4,25 @@ words: - allowtransparency - APITOKEN - appname + - appnamehere - Authentik + - Authexample - authkey - autoconnect - AUTOSYNC - backupname + - basicauthexample - bazarr - bugfixer's - bungeecord + - chainname - cheatsheet - cloudflared - Cloudflareddns - collabora - configfile - configmap + - containo - daemonset - dbcreds - dbengine @@ -27,6 +32,7 @@ words: - dockerized - duplicati - dynmap + - Entrypoints - eptgmk - Fireshare - fullname @@ -39,6 +45,10 @@ words: - hyperconverged - hyperthread - iban + - ingressclasses + - ingressroutes + - ingressroutetcps + - ingressrouteudps - integrationsenabled - ipaddr - ixcert @@ -66,6 +76,8 @@ words: - mediafiles - meshroom - metallb + - middlewares + - middlewaretcps - Mikrotik - milicpu - minecraft @@ -94,6 +106,7 @@ words: - Preload - proto - puid + - putregexhere - pvcname - pvcpath - quotum @@ -105,11 +118,13 @@ words: - RECORDTYPES - registeringats - reneg + - replacementurlhere - resolv - sabnzbd - schouten - selfsigned - SERVERCONFIG + - serverstransports - serviceexpert - smallblock - sonarr @@ -131,7 +146,13 @@ words: - targetport - tccr - teamspeak + - testpassword + - testuser + - themenamehere + - tlsoptions + - tlsstores - traefik + - traefikservices - truecharts - truenas - truetool diff --git a/templates/questions/traefik/forwardedHeaders.yaml b/templates/questions/traefik/forwardedHeaders.yaml new file mode 100644 index 00000000000..62b0ae43495 --- /dev/null +++ b/templates/questions/traefik/forwardedHeaders.yaml @@ -0,0 +1,32 @@ + - variable: forwardedHeaders + label: Accept Forwarded Headers + schema: + additional_attrs: true + type: dict + attrs: + - variable: enabled + label: Enable + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: trustedIPs + label: Trusted IPs + description: Trust Forwarded Headers from specific IPs. + schema: + type: list + default: [] + items: + - variable: trustedIPsEntry + label: "" + schema: + type: string + required: true + default: "" + - variable: insecureMode + label: Insecure Mode + description: Always Trust Forwarded Headers + schema: + type: boolean + default: false diff --git a/templates/questions/traefik/proxyProtocol.yaml b/templates/questions/traefik/proxyProtocol.yaml new file mode 100644 index 00000000000..855fef5ab16 --- /dev/null +++ b/templates/questions/traefik/proxyProtocol.yaml @@ -0,0 +1,33 @@ + - variable: proxyProtocol + label: Accept Proxy Protocol connections + description: If Proxy Protocol header parsing is enabled for the entry point, this entry point can accept connections with or without Proxy Protocol headers. + schema: + additional_attrs: true + type: dict + attrs: + - variable: enabled + label: Enable + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: trustedIPs + label: Trusted IPs + description: Only IPs in trustedIPs will lead to remote client address replacement + schema: + type: list + default: [] + items: + - variable: trustedIPsEntry + label: "" + schema: + type: string + required: true + default: "" + - variable: insecureMode + label: Insecure Mode + description: Trust every incoming connection + schema: + type: boolean + default: false diff --git a/tools/build-release.sh b/tools/build-release.sh index 250013f7a43..fabfc0c4755 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -368,6 +368,16 @@ include_questions(){ /# Include{documentation}/ { for (i=0;i "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml + # Replace # Include{[forwardedHeaders]} with the standard forwardedHeaders codesnippet + awk 'NR==FNR { a[n++]=$0; next } + /# Include{forwardedHeaders}/ { for (i=0;i "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml + + # Replace # Include{proxyProtocol} with the standard proxyProtocol codesnippet + awk 'NR==FNR { a[n++]=$0; next } + /# Include{proxyProtocol}/ { for (i=0;i "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml + } export -f include_questions