diff --git a/charts/enterprise/blocky/Chart.yaml b/charts/enterprise/blocky/Chart.yaml index f20037eb793..6897ac188cb 100644 --- a/charts/enterprise/blocky/Chart.yaml +++ b/charts/enterprise/blocky/Chart.yaml @@ -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 diff --git a/charts/enterprise/blocky/templates/common.yaml b/charts/enterprise/blocky/templates/common.yaml index 771a3d532ce..f8e20c4da02 100644 --- a/charts/enterprise/blocky/templates/common.yaml +++ b/charts/enterprise/blocky/templates/common.yaml @@ -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" . }}