feat(blocky): add DoH support on main ingress (#3959)

* Update common.yaml

Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>

* Update Chart.yaml

Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>

Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
Kjeld Schouten-Lebbing 2022-09-29 22:00:12 +02:00 committed by GitHub
parent 3be727ac11
commit 003a83d76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -26,7 +26,7 @@ sources:
- https://github.com/0xERR0R/blocky
- https://github.com/Mozart409/blocky-frontend
- https://hub.docker.com/r/spx01/blocky
version: 1.0.11
version: 1.1.0
annotations:
truecharts.org/catagories: |
- network

View File

@ -73,5 +73,35 @@ service:
{{/* inject api paths in ingress */}}
{{- include "blocky.apiinjector" . }}
{{/* Define path for DoH */}}
{{- define "blocky.doh" -}}
{{- $fullname := include "tc.common.names.fullname" . -}}
path: "/dns-query"
# -- Ignored if not kubeVersion >= 1.14-0
pathType: Prefix
service:
# -- Overrides the service name reference for this path
name: {{ printf "%s-http" $fullname }}
port: {{ .Values.service.http.ports.http.port }}
{{- end -}}
{{/* inject websocket path to all main ingress hosts*/}}
{{- define "blocky.dohinjector" -}}
{{- $path := list (include "blocky.doh" . | fromYaml) -}}
{{- if .Values.ingress.main.enabled }}
{{- range .Values.ingress.main.hosts }}
{{- $newpaths := list }}
{{- $newpaths := concat .paths $path }}
{{- $_ := set . "paths" ( deepCopy $newpaths ) -}}
{{- end }}
{{- end }}
{{- end -}}
{{/* inject api paths in ingress */}}
{{- include "blocky.dohinjector" . }}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}