Skip to content

Commit 450fbfb

Browse files
committed
fix: correct the postinstall script to disable running dns server and update k8s script to use daemon set
1 parent 5ff144e commit 450fbfb

File tree

3 files changed

+153
-51
lines changed

3 files changed

+153
-51
lines changed

config.yaml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Void DNS Sink Hole and local DNS Resolver Config File
2+
#
3+
# This file is used to configure the Void DNS Sink Hole and local DNS Resolver.
4+
# The configuration file can be in YAML, JSON, or TOML format, named config
5+
# with the appropriate extension.
6+
#
7+
# The configuration file is loaded from the following locations, in order:
8+
# - /etc/void/config.yaml
9+
# - $HOME/.void/config.yaml
10+
# - ./config.yaml
11+
#
12+
# The configuration file can be overridden with the --config flag.
13+
#
14+
# There are three types of dns entries:
15+
# - local: A list of local domains that will be resolved by Void.
16+
# - allow: A list of domains that will be resolved upstream, bypassing
17+
# Void's DNS sink hole.
18+
# - block: A list of domains that will be blocked by Void's DNS sink hole.
19+
#
20+
# DNS resolution is performed in the following order:
21+
#
22+
# 1. If the domain is in the local list, resolve the domain locally.
23+
# 2. If the domain is in the allow list, resolve the domain upstream.
24+
# 3. If the domain is in the block list, return empty response.
25+
#
26+
# Void supports local and remote lists, or lists of lists.
27+
#
28+
# Lists can be regular expressions, wildcard domains, or exact domains. They
29+
# can also be lists that point to other lists (requires additional config, see
30+
# below) that contain regex, wildcard, or exact domains. Direct lists do not
31+
# require the `format` to be specified, but regex and wildcard lists do.
32+
#
33+
# NOTE: The file extension is not used to determine the format of the list,
34+
# it is the `format` field that determines the format of the list.
35+
#
36+
# Direct List Example
37+
# - path: "/etc/void/local.hosts"
38+
#
39+
# Regex List Example
40+
# - path: "/etc/void/hosts.regex"
41+
# format: regex
42+
#
43+
# Wildcard List Example
44+
# - path: "/etc/void/hosts.wild"
45+
# format: wildcard
46+
#
47+
# List of Lists Example
48+
# - path: "/etc/void/hosts.lists"
49+
# lists: true
50+
# format: direct # Optional, defaults to direct if not specified
51+
#
52+
#
53+
# Void understands lists in hostfile format, or line delimited format.
54+
#
55+
# Void supports either local or remote files (urls beginning with http:// or
56+
# https://). Remote files are cached locally in the configured cache directory.
57+
#
58+
# Defaults
59+
# -------
60+
# The default configuration is:
61+
#
62+
# Port: 53
63+
#
64+
# Upstream is Cloudflare TLS encrypted DNS:
65+
# - tcp-tls://1.1.1.1:853
66+
# - tcp-tls://1.0.0.1:853
67+
#
68+
#
69+
# Cache: /etc/void/cache
70+
71+
# Logger configures the log location and log rotation settings.
72+
#
73+
# Uses configuration from https://github.com/natefinch/lumberjack/tree/v2.0
74+
logger:
75+
filename: "/var/log/void/void.log"
76+
maxage: 30
77+
# maxsize: 100 # MB
78+
# maxbackups: 10
79+
# localtime: false
80+
compress: true
81+
82+
verbose: true
83+
84+
dns:
85+
#port: 53 # default
86+
#upstream: [ # default
87+
# "tcp-tls://1.1.1.1:853",
88+
# "tcp-tls://1.0.0.1:853",
89+
#]
90+
local:
91+
- path: "/etc/void/local.hosts"
92+
format: direct
93+
- path: "/etc/void/local.wild"
94+
format: wildcard
95+
allow:
96+
- path: "/etc/void/custom_allow.hosts"
97+
format: direct
98+
- path: https://raw.githubusercontent.com/mmotti/pihole-regex/master/whitelist.list
99+
format: direct
100+
- path: https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
101+
format: direct
102+
- path: https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/optional-list.txt
103+
format: direct
104+
block:
105+
- path: https://v.firebog.net/hosts/lists.php?type=nocross
106+
lists: true
107+
format: direct
108+
- path: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
109+
format: direct
110+
- path: https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list
111+
format: regex
112+
- path: https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt
113+
format: direct
114+
- path: https://www.github.developerdan.com/hosts/lists/amp-hosts-extended.txt
115+
format: direct
116+
- path: https://www.github.developerdan.com/hosts/lists/dating-services-extended.txt
117+
format: direct
118+
- path: https://www.github.developerdan.com/hosts/lists/hate-and-junk-extended.txt
119+
format: direct
120+
- path: https://www.github.developerdan.com/hosts/lists/tracking-aggressive-extended.txt
121+
format: direct

deployment/k8s/deploy.yaml

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
apiVersion: apps/v1
2-
kind: Deployment
2+
kind: DaemonSet
33
metadata:
4-
name: void-deployment
4+
name: void-daemonset
55
spec:
6-
replicas: 3
76
selector:
87
matchLabels:
98
app: void
@@ -12,43 +11,19 @@ spec:
1211
labels:
1312
app: void
1413
spec:
14+
hostNetwork: true
15+
dnsPolicy: ClusterFirstWithHostNet
1516
containers:
1617
- name: void-container
17-
image: ghcr.io/devnw/void:v0.0.10-beta2
18+
image: ghcr.io/devnw/void:latest
1819
ports:
1920
- containerPort: 53
20-
resources:
21-
limits:
22-
cpu: 500m
23-
requests:
24-
cpu: 250m
25-
26-
---
27-
28-
apiVersion: v1
29-
kind: Service
30-
metadata:
31-
name: void-loadbalancer
32-
spec:
33-
selector:
34-
app: void
35-
ports:
36-
- protocol: UDP
37-
port: 53
38-
targetPort: 53
39-
type: LoadBalancer
40-
41-
---
42-
43-
apiVersion: autoscaling/v1
44-
kind: HorizontalPodAutoscaler
45-
metadata:
46-
name: void-autoscaler
47-
spec:
48-
scaleTargetRef:
49-
apiVersion: apps/v1
50-
kind: Deployment
51-
name: void-deployment
52-
minReplicas: 3
53-
maxReplicas: 10
54-
targetCPUUtilizationPercentage: 80
21+
protocol: UDP
22+
volumeMounts:
23+
- name: void-storage
24+
mountPath: /etc/void
25+
volumes:
26+
- name: void-storage
27+
hostPath:
28+
path: /etc/void
29+
type: DirectoryOrCreate

deployment/scripts/postinstall.sh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,30 @@ set -e
33

44
configure()
55
{
6-
systemctl enable void.service
6+
# Set DNSStubListener=no in /etc/systemd/resolved.conf
7+
sed -i 's/#DNSStubListener=yes/DNSStubListener=no/' /etc/systemd/resolved.conf
78

8-
systemctl daemon-reload
9+
# Restart the systemd-resolved service
10+
systemctl restart systemd-resolved
911

10-
systemctl start void.service
12+
systemctl enable void.service
13+
14+
systemctl daemon-reload
15+
16+
systemctl start void.service
1117
}
1218

1319
case $1 in
14-
configure)
15-
configure
16-
;;
20+
configure)
21+
configure
22+
;;
1723

18-
abort-upgrade)
19-
;;
24+
abort-upgrade)
25+
;;
2026

21-
abort-remove)
22-
;;
27+
abort-remove)
28+
;;
2329

24-
abort-deconfigure)
25-
;;
30+
abort-deconfigure)
31+
;;
2632
esac

0 commit comments

Comments
 (0)