2022-09-22 22:05:40 +00:00
|
|
|
{{/* Define the config */}}
|
|
|
|
{{- define "blocky.configmap" -}}
|
2023-03-04 12:42:14 +00:00
|
|
|
{{- $config := mustMerge ( include "blocky.config" . | fromYaml ) ( .Values.blockyConfig ) }}
|
|
|
|
enabled: true
|
2022-09-22 22:05:40 +00:00
|
|
|
data:
|
2022-09-24 20:39:59 +00:00
|
|
|
config.yml: |
|
2022-09-24 18:49:03 +00:00
|
|
|
{{ $config | toYaml | indent 4 }}
|
2022-09-22 22:05:40 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- define "blocky.config" -}}
|
|
|
|
redis:
|
|
|
|
address: {{ printf "%v-%v" .Release.Name "redis" }}:6379
|
2023-03-06 16:15:43 +00:00
|
|
|
password: {{ .Values.redis.creds.redisPassword | trimAll "\"" }}
|
2022-09-22 22:05:40 +00:00
|
|
|
database: 0
|
|
|
|
required: true
|
|
|
|
connectionAttempts: 10
|
|
|
|
connectionCooldown: 3s
|
|
|
|
prometheus:
|
|
|
|
enable: true
|
|
|
|
path: /metrics
|
2023-03-04 12:42:14 +00:00
|
|
|
queryLog:
|
|
|
|
# optional one of: postgresql, csv, csv-client. If empty, log to console
|
|
|
|
type: {{ .Values.queryLog.type }}
|
|
|
|
# directory (should be mounted as volume in docker) for csv, db connection string for mysql/postgresql
|
|
|
|
#postgresql target: postgres://user:password@db_host_or_ip:5432/db_name
|
|
|
|
{{- if eq .Values.queryLog.type "postgresql" }}
|
2023-03-07 11:46:48 +00:00
|
|
|
target: {{ .Values.cnpg.main.creds.std }}
|
2023-03-04 12:42:14 +00:00
|
|
|
{{- else }}
|
|
|
|
target: {{ .Values.queryLog.target }}
|
|
|
|
{{- end }}
|
|
|
|
# if > 0, deletes log files which are older than ... days
|
|
|
|
logRetentionDays: {{ .Values.queryLog.logRetentionDays | default 0 }}
|
|
|
|
# optional: Max attempts to create specific query log writer
|
|
|
|
creationAttempts: {{ .Values.queryLog.creationAttempts | default 3 }}
|
|
|
|
# optional: Time between the creation attempts
|
|
|
|
creationCooldown: {{ .Values.queryLog.creationAttempts | default "2s" }}
|
|
|
|
|
2022-09-22 22:05:40 +00:00
|
|
|
upstream:
|
|
|
|
default:
|
|
|
|
{{- .Values.defaultUpstreams | toYaml | nindent 8 }}
|
2022-09-24 18:49:03 +00:00
|
|
|
{{- range $id, $value := .Values.upstreams }}
|
|
|
|
{{ $value.name }}:
|
|
|
|
{{- $value.dnsservers | toYaml | nindent 8 }}
|
|
|
|
{{- end }}
|
2022-09-22 22:05:40 +00:00
|
|
|
|
2024-03-22 09:14:43 +00:00
|
|
|
upstreamTimeout: {{ .Values.upstreamTimeout | default "1s" }}
|
|
|
|
|
2023-04-16 09:51:02 +00:00
|
|
|
ports:
|
2024-03-05 22:06:21 +00:00
|
|
|
{{- if .Values.service.dns.enabled }}
|
2024-03-06 09:36:22 +00:00
|
|
|
dns: {{ .Values.service.dns.ports.dns.targetPort }}
|
2023-04-16 09:51:02 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.service.dot.enabled }}
|
|
|
|
tls: {{ .Values.service.dot.ports.dot.targetPort }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.service.main.enabled }}
|
|
|
|
http: {{ .Values.service.main.ports.main.targetPort }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.service.https.enabled }}
|
|
|
|
https: {{ .Values.service.https.ports.https.targetPort }}
|
|
|
|
{{- end }}
|
2023-03-04 12:42:14 +00:00
|
|
|
|
2022-09-22 22:05:40 +00:00
|
|
|
{{- if .Values.certFile }}
|
|
|
|
certFile: {{ .Values.certFile }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if .Values.keyFile }}
|
|
|
|
keyFile: {{ .Values.keyFile }}
|
|
|
|
{{- end }}
|
|
|
|
|
2023-04-16 09:51:02 +00:00
|
|
|
log:
|
|
|
|
{{- if .Values.logLevel }}
|
|
|
|
level: {{ .Values.logLevel }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.logTimestamp }}
|
|
|
|
timestamp: {{ .Values.logTimestamp }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.logPrivacy }}
|
|
|
|
privacy: {{ .Values.logPrivacy }}
|
|
|
|
{{- end }}
|
2022-09-22 22:05:40 +00:00
|
|
|
|
|
|
|
{{- if .Values.dohUserAgent }}
|
|
|
|
dohUserAgent: {{ .Values.dohUserAgent }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if .Values.minTlsServeVersion }}
|
|
|
|
minTlsServeVersion: {{ .Values.minTlsServeVersion }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
caching:
|
|
|
|
{{ toYaml .Values.caching | indent 2 }}
|
|
|
|
|
|
|
|
{{- if .Values.hostsFile.enabled }}
|
|
|
|
{{ $hostsfile := omit .Values.hostsFile "enabled" }}
|
|
|
|
hostsFile:
|
|
|
|
{{ toYaml $hostsfile | indent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if or .Values.bootstrapDns.upstream .Values.bootstrapDns.ips }}
|
|
|
|
bootstrapDns:
|
2023-03-22 06:48:58 +00:00
|
|
|
{{- if .Values.bootstrapDns.upstream }}
|
|
|
|
- upstream: {{ .Values.bootstrapDns.upstream }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.bootstrapDns.ips }}
|
|
|
|
ips:
|
|
|
|
{{- range $id, $value := .Values.bootstrapDns.ips }}
|
|
|
|
- {{ $value }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{/* Add additional Bootstrap DNS */}}
|
|
|
|
{{- range .Values.additionalBootstrapDns }}
|
|
|
|
{{- with .upstream }}
|
|
|
|
- upstream: {{ . }}
|
|
|
|
{{- end }}
|
2023-04-15 12:12:31 +00:00
|
|
|
{{- if .ips }}
|
2023-03-22 06:48:58 +00:00
|
|
|
ips:
|
2023-04-15 12:12:31 +00:00
|
|
|
{{- range $id, $value := .ips }}
|
2023-03-22 06:48:58 +00:00
|
|
|
- {{ $value }}
|
2023-04-15 12:12:31 +00:00
|
|
|
{{- end }}
|
2023-03-22 06:48:58 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2022-09-22 22:05:40 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if or .Values.filtering.filtering }}
|
|
|
|
filtering:
|
|
|
|
{{- if .Values.filtering.ips }}
|
|
|
|
queryTypes:
|
|
|
|
{{- range $id, $value := .Values.filtering.ips }}
|
|
|
|
- {{ $value }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if or .Values.customDNS.filterUnmappedTypes .Values.customDNS.customTTL .Values.customDNS.rewrite .Values.customDNS.mapping }}
|
|
|
|
customDNS:
|
|
|
|
{{- if .Values.customDNS.upstream }}
|
|
|
|
upstream: {{ .Values.customDNS.upstream }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.customDNS.customTTL }}
|
|
|
|
customTTL: {{ .Values.customDNS.customTTL }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.customDNS.rewrite }}
|
|
|
|
rewrite:
|
|
|
|
{{- range $id, $value := .Values.customDNS.rewrite }}
|
|
|
|
{{ $value.in }}: {{ $value.out }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if .Values.customDNS.mapping }}
|
|
|
|
mapping:
|
|
|
|
{{- range $id, $value := .Values.customDNS.mapping }}
|
|
|
|
{{ $value.domain }}: {{ $value.dnsserver }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if or .Values.clientLookup.upstream .Values.clientLookup.ips }}
|
|
|
|
clientLookup:
|
|
|
|
{{- if .Values.clientLookup.upstream }}
|
|
|
|
upstream: {{ .Values.clientLookup.upstream }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.clientLookup.ips }}
|
|
|
|
singleNameOrder:
|
|
|
|
{{- range $id, $value := .Values.clientLookup.ips }}
|
|
|
|
- {{ $value }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.clientLookup.clients }}
|
|
|
|
clients:
|
|
|
|
{{- range $id, $value := .Values.clientLookup.clients }}
|
|
|
|
{{ $value.domain }}:
|
|
|
|
{{- range $id, $value := .ips }}
|
|
|
|
- {{ $value }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if or .Values.conditional.rewrite .Values.conditional.mapping ( and .Values.k8sgateway.enabled .Values.k8sgateway.domains ) }}
|
|
|
|
conditional:
|
|
|
|
{{- if .Values.conditional.rewrite }}
|
|
|
|
rewrite:
|
|
|
|
{{- range $id, $value := .Values.conditional.rewrite }}
|
|
|
|
{{ $value.in }}: {{ $value.out }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if or .Values.conditional.mapping ( and .Values.k8sgateway.enabled .Values.k8sgateway.domains ) }}
|
|
|
|
mapping:
|
|
|
|
{{- if and .Values.k8sgateway.enabled .Values.k8sgateway.domains }}
|
|
|
|
{{- range $id, $value := .Values.k8sgateway.domains }}
|
|
|
|
{{ .domain }}: 127.0.0.1:{{ $.Values.service.k8sgateway.ports.k8sgateway.targetPort }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range $id, $value := .Values.conditional.mapping }}
|
|
|
|
{{ $value.domain }}: {{ $value.dnsserver }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
blocking:
|
|
|
|
blockType: {{ .Values.blocking.blockType }}
|
|
|
|
blockTTL: {{ .Values.blocking.blockTTL }}
|
|
|
|
refreshPeriod: {{ .Values.blocking.refreshPeriod }}
|
|
|
|
downloadTimeout: {{ .Values.blocking.downloadTimeout }}
|
|
|
|
downloadAttempts: {{ .Values.blocking.downloadAttempts }}
|
|
|
|
downloadCooldown: {{ .Values.blocking.downloadCooldown }}
|
2023-04-15 12:12:31 +00:00
|
|
|
startStrategy: {{ .Values.blocking.startStrategy }}
|
2022-09-22 22:05:40 +00:00
|
|
|
processingConcurrency: {{ .Values.blocking.processingConcurrency }}
|
2024-03-22 09:36:10 +00:00
|
|
|
|
2022-09-22 22:05:40 +00:00
|
|
|
whiteLists:
|
2024-03-22 09:36:10 +00:00
|
|
|
default:
|
|
|
|
- https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/optional-list.txt
|
|
|
|
- https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
|
|
|
|
- https://raw.githubusercontent.com/rahilpathan/pihole-whitelist/main/1.LowWL.txt
|
2022-09-22 22:05:40 +00:00
|
|
|
{{- range $id, $value := .Values.blocking.whitelist }}
|
|
|
|
{{ $value.name }}:
|
|
|
|
{{- $value.lists | toYaml | nindent 10 }}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-03-22 09:36:10 +00:00
|
|
|
|
2022-09-22 22:05:40 +00:00
|
|
|
blackLists:
|
2024-03-22 09:36:10 +00:00
|
|
|
default:
|
|
|
|
- https://big.oisd.nl/domainswild
|
2024-03-22 09:56:50 +00:00
|
|
|
- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
2022-09-22 22:05:40 +00:00
|
|
|
{{- range $id, $value := .Values.blocking.blacklist }}
|
|
|
|
{{ $value.name }}:
|
|
|
|
{{- $value.lists | toYaml | nindent 10 }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if .Values.blocking.clientGroupsBlock }}
|
|
|
|
clientGroupsBlock:
|
|
|
|
{{- range $id, $value := .Values.blocking.clientGroupsBlock }}
|
|
|
|
{{ $value.name }}:
|
|
|
|
{{- $value.groups | toYaml | nindent 10 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- end -}}
|