mirror of
https://github.com/optim-enterprises-bv/homelab.git
synced 2025-11-03 11:27:52 +00:00
feat(adguard): mount config-file for declarative configuration
This commit is contained in:
@@ -4,9 +4,6 @@ http:
|
|||||||
enabled: false
|
enabled: false
|
||||||
address: 0.0.0.0:3000
|
address: 0.0.0.0:3000
|
||||||
session_ttl: 720h
|
session_ttl: 720h
|
||||||
users:
|
|
||||||
- name: veh
|
|
||||||
password: $2a$10$/84M9f9064xOSmb3MGXBmuApKPhvXnRxMGjISmvAmkp85ViiMd5l.
|
|
||||||
auth_attempts: 5
|
auth_attempts: 5
|
||||||
block_auth_min: 15
|
block_auth_min: 15
|
||||||
http_proxy: ""
|
http_proxy: ""
|
||||||
@@ -20,21 +17,22 @@ dns:
|
|||||||
ratelimit: 20
|
ratelimit: 20
|
||||||
ratelimit_subnet_len_ipv4: 24
|
ratelimit_subnet_len_ipv4: 24
|
||||||
ratelimit_subnet_len_ipv6: 56
|
ratelimit_subnet_len_ipv6: 56
|
||||||
ratelimit_whitelist: []
|
ratelimit_whitelist: [ ]
|
||||||
refuse_any: true
|
refuse_any: true
|
||||||
upstream_dns:
|
upstream_dns:
|
||||||
- https://dns10.quad9.net/dns-query
|
- 10.96.0.11
|
||||||
|
- udp://unbound.dns.svc.cluster.local:53
|
||||||
|
- tcp://unbound.dns.svc.cluster.local:53
|
||||||
upstream_dns_file: ""
|
upstream_dns_file: ""
|
||||||
bootstrap_dns:
|
bootstrap_dns:
|
||||||
- 9.9.9.10
|
- 10.96.0.10
|
||||||
- 149.112.112.10
|
fallback_dns:
|
||||||
- 2620:fe::10
|
- 1.1.1.1
|
||||||
- 2620:fe::fe:10
|
- 9.9.9.9
|
||||||
fallback_dns: []
|
upstream_mode: fastest_addr
|
||||||
upstream_mode: load_balance
|
|
||||||
fastest_timeout: 1s
|
fastest_timeout: 1s
|
||||||
allowed_clients: []
|
allowed_clients: [ ]
|
||||||
disallowed_clients: []
|
disallowed_clients: [ ]
|
||||||
blocked_hosts:
|
blocked_hosts:
|
||||||
- version.bind
|
- version.bind
|
||||||
- id.server
|
- id.server
|
||||||
@@ -46,7 +44,7 @@ dns:
|
|||||||
cache_ttl_min: 0
|
cache_ttl_min: 0
|
||||||
cache_ttl_max: 0
|
cache_ttl_max: 0
|
||||||
cache_optimistic: false
|
cache_optimistic: false
|
||||||
bogus_nxdomain: []
|
bogus_nxdomain: [ ]
|
||||||
aaaa_disabled: false
|
aaaa_disabled: false
|
||||||
enable_dnssec: false
|
enable_dnssec: false
|
||||||
edns_client_subnet:
|
edns_client_subnet:
|
||||||
@@ -55,15 +53,15 @@ dns:
|
|||||||
use_custom: false
|
use_custom: false
|
||||||
max_goroutines: 300
|
max_goroutines: 300
|
||||||
handle_ddr: true
|
handle_ddr: true
|
||||||
ipset: []
|
ipset: [ ]
|
||||||
ipset_file: ""
|
ipset_file: ""
|
||||||
bootstrap_prefer_ipv6: false
|
bootstrap_prefer_ipv6: false
|
||||||
upstream_timeout: 10s
|
upstream_timeout: 10s
|
||||||
private_networks: []
|
private_networks: [ ]
|
||||||
use_private_ptr_resolvers: true
|
use_private_ptr_resolvers: true
|
||||||
local_ptr_upstreams: []
|
local_ptr_upstreams: [ ]
|
||||||
use_dns64: false
|
use_dns64: false
|
||||||
dns64_prefixes: []
|
dns64_prefixes: [ ]
|
||||||
serve_http3: false
|
serve_http3: false
|
||||||
use_http3_upstreams: false
|
use_http3_upstreams: false
|
||||||
serve_plain_dns: true
|
serve_plain_dns: true
|
||||||
@@ -85,14 +83,14 @@ tls:
|
|||||||
strict_sni_check: false
|
strict_sni_check: false
|
||||||
querylog:
|
querylog:
|
||||||
dir_path: ""
|
dir_path: ""
|
||||||
ignored: []
|
ignored: [ ]
|
||||||
interval: 2160h
|
interval: 2160h
|
||||||
size_memory: 1000
|
size_memory: 1000
|
||||||
enabled: true
|
enabled: true
|
||||||
file_enabled: true
|
file_enabled: true
|
||||||
statistics:
|
statistics:
|
||||||
dir_path: ""
|
dir_path: ""
|
||||||
ignored: []
|
ignored: [ ]
|
||||||
interval: 24h
|
interval: 24h
|
||||||
enabled: true
|
enabled: true
|
||||||
filters:
|
filters:
|
||||||
@@ -104,8 +102,8 @@ filters:
|
|||||||
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt
|
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt
|
||||||
name: AdAway Default Blocklist
|
name: AdAway Default Blocklist
|
||||||
id: 2
|
id: 2
|
||||||
whitelist_filters: []
|
whitelist_filters: [ ]
|
||||||
user_rules: []
|
user_rules: [ ]
|
||||||
dhcp:
|
dhcp:
|
||||||
enabled: false
|
enabled: false
|
||||||
interface_name: ""
|
interface_name: ""
|
||||||
@@ -117,7 +115,7 @@ dhcp:
|
|||||||
range_end: ""
|
range_end: ""
|
||||||
lease_duration: 86400
|
lease_duration: 86400
|
||||||
icmp_timeout_msec: 1000
|
icmp_timeout_msec: 1000
|
||||||
options: []
|
options: [ ]
|
||||||
dhcpv6:
|
dhcpv6:
|
||||||
range_start: ""
|
range_start: ""
|
||||||
lease_duration: 86400
|
lease_duration: 86400
|
||||||
@@ -129,7 +127,7 @@ filtering:
|
|||||||
blocked_services:
|
blocked_services:
|
||||||
schedule:
|
schedule:
|
||||||
time_zone: UTC
|
time_zone: UTC
|
||||||
ids: []
|
ids: [ ]
|
||||||
protection_disabled_until: null
|
protection_disabled_until: null
|
||||||
safe_search:
|
safe_search:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -142,7 +140,17 @@ filtering:
|
|||||||
blocking_mode: default
|
blocking_mode: default
|
||||||
parental_block_host: family-block.dns.adguard.com
|
parental_block_host: family-block.dns.adguard.com
|
||||||
safebrowsing_block_host: standard-block.dns.adguard.com
|
safebrowsing_block_host: standard-block.dns.adguard.com
|
||||||
rewrites: []
|
rewrites:
|
||||||
|
- domain: '*.stonegarden.dev'
|
||||||
|
answer: 192.168.1.222
|
||||||
|
- domain: stonegarden.dev
|
||||||
|
answer: 192.168.1.222
|
||||||
|
- domain: plex.stonegarden.dev
|
||||||
|
answer: 192.168.1.228
|
||||||
|
- domain: jellyfin.stonegarden.dev
|
||||||
|
answer: 192.168.1.229
|
||||||
|
- domain: whoami.stonegarden.dev
|
||||||
|
answer: 192.168.1.223
|
||||||
safebrowsing_cache_size: 1048576
|
safebrowsing_cache_size: 1048576
|
||||||
safesearch_cache_size: 1048576
|
safesearch_cache_size: 1048576
|
||||||
parental_cache_size: 1048576
|
parental_cache_size: 1048576
|
||||||
@@ -160,7 +168,7 @@ clients:
|
|||||||
rdns: true
|
rdns: true
|
||||||
dhcp: true
|
dhcp: true
|
||||||
hosts: true
|
hosts: true
|
||||||
persistent: []
|
persistent: [ ]
|
||||||
log:
|
log:
|
||||||
file: ""
|
file: ""
|
||||||
max_backups: 0
|
max_backups: 0
|
||||||
|
|||||||
@@ -18,14 +18,43 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
seccompProfile:
|
seccompProfile:
|
||||||
type: RuntimeDefault
|
type: RuntimeDefault
|
||||||
|
initContainers:
|
||||||
|
- name: copy-base-config
|
||||||
|
image: busybox
|
||||||
|
command: [ "cp", "/tmp/AdGuardHome.yaml", "/opt/adguardhome/conf/AdGuardHome.yaml" ]
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
capabilities:
|
||||||
|
drop: [ "ALL" ]
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /tmp/AdGuardHome.yaml
|
||||||
|
subPath: AdGuardHome.yaml
|
||||||
|
- name: config-folder
|
||||||
|
mountPath: /opt/adguardhome/conf
|
||||||
|
- name: append-users
|
||||||
|
image: busybox
|
||||||
|
command: [ "sh", "-c", "cat /tmp/users.yaml >> /opt/adguardhome/conf/AdGuardHome.yaml" ]
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
capabilities:
|
||||||
|
drop: [ "ALL" ]
|
||||||
|
volumeMounts:
|
||||||
|
- name: users
|
||||||
|
mountPath: /tmp/users.yaml
|
||||||
|
subPath: users.yaml
|
||||||
|
- name: config-folder
|
||||||
|
mountPath: /opt/adguardhome/conf
|
||||||
containers:
|
containers:
|
||||||
- name: adguard
|
- name: adguard
|
||||||
image: docker.io/adguard/adguardhome:v0.107.48 # renovate: docker=docker.io/adguard/adguardhome
|
image: docker.io/adguard/adguardhome:v0.107.48 # renovate: docker=docker.io/adguard/adguardhome
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
# capabilities:
|
# capabilities:
|
||||||
# drop: [ "ALL" ]
|
# drop: [ "ALL" ]
|
||||||
ports:
|
ports:
|
||||||
- name: dns-tcp
|
- name: dns-tcp
|
||||||
containerPort: 53
|
containerPort: 53
|
||||||
@@ -47,12 +76,18 @@ spec:
|
|||||||
cpu: 500m
|
cpu: 500m
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: adguard-conf
|
- name: config-folder
|
||||||
mountPath: /opt/adguardhome/conf
|
mountPath: /opt/adguardhome/conf
|
||||||
- name: adguard-work
|
- name: work-folder
|
||||||
mountPath: /opt/adguardhome/work
|
mountPath: /opt/adguardhome/work
|
||||||
volumes:
|
volumes:
|
||||||
- name: adguard-conf
|
- name: config
|
||||||
emptyDir: {}
|
configMap:
|
||||||
- name: adguard-work
|
name: adguard-config
|
||||||
emptyDir: {}
|
- name: users
|
||||||
|
secret:
|
||||||
|
secretName: users
|
||||||
|
- name: config-folder
|
||||||
|
emptyDir: { }
|
||||||
|
- name: work-folder
|
||||||
|
emptyDir: { }
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ configMapGenerator:
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
- svc.yaml
|
- svc.yaml
|
||||||
|
- secret-users.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- http-route.yaml
|
- http-route.yaml
|
||||||
|
|||||||
13
k8s/infra/network/dns/adguard/secret-users.yaml
Normal file
13
k8s/infra/network/dns/adguard/secret-users.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: bitnami.com/v1alpha1
|
||||||
|
kind: SealedSecret
|
||||||
|
metadata:
|
||||||
|
name: users
|
||||||
|
namespace: dns
|
||||||
|
spec:
|
||||||
|
encryptedData:
|
||||||
|
users.yaml: AgDR07t8nqDB5CdVU1OUr6bFKHP766dk8alMNn1pbMQngS7lW5aas9gpwTxjayhIEdXlX76jC+LB8CrwL4FcFpuMaqJgqXZLFO5XOV2HKrA6jgoCnoGJtaVTvYfD2dHP426+sqSSVzDUglxCs5fmrLmaH2kUhZbUzbzVc6lQzQgqv4kZSU8VpDUZ35aE5QGUog35j8HmIKb4ieL9iL7qo1pdh2e/fKlMZ7TxwmL8eoHplnGePnI4JMMI5K4kOmMNZKm2w9Zg5/MQbtglA8Ws246z9ECMbmAojc4w1Crv2EKeghdzUiiuPALzfwoLVtCgYC5qrPmlm0VRhTBGm0eatxFXu9LWWOYGQvwgiRmBe/bxs7r3kXZfh59G2R/ehJikAEJtMocyOfixguKTcjxjgAPvLSctti7hMji67lbxWs3Mc00mG3t0JOWGyFpWcTIZ4g3c4zCMNGx9lrxZbVxrP8FuKWtc+1hGlgxHnyNMLyYUJXV3EDd2Kp5E5cN98991H0UeVKUvCMTXRCdfeKcaxI/E9PDzSAzy5ARKUb3LkYS3+LLvfgjY1BOXT5ZmkI+HhExgvZjsecT8H72qeHxFPX/bksM/oskBcLyYYkNePETKYiwTnipqCA+AGTqMh1bd5OgaalBvxTTqP5pfvuFeMHRrp0a90eMP//3Ibl8Ev2hN9eQtSu2Z4a/clD26HIHt2g+s+COUjdyPgCj9kEgAqrReTC2MdjrTIirAQJgcuIwMx/hPwKIt+9On6X3lzgdXBJNqN57z3PI5VjVRnEB2eS/wr7zKBI9apbfNOQkpitH5a+fdldaeBBf7N99YkZ6DBw2dfA==
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: users
|
||||||
|
namespace: dns
|
||||||
@@ -5,6 +5,7 @@ metadata:
|
|||||||
namespace: dns
|
namespace: dns
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
# https://kubernetes.io/docs/concepts/services-networking/cluster-ip-allocation/
|
||||||
clusterIP: 10.96.0.11
|
clusterIP: 10.96.0.11
|
||||||
ports:
|
ports:
|
||||||
- name: dns
|
- name: dns
|
||||||
|
|||||||
Reference in New Issue
Block a user