File tree Expand file tree Collapse file tree 9 files changed +24
-21
lines changed Expand file tree Collapse file tree 9 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ app_setup_block: |
121121
122122# changelog
123123changelogs :
124- - { date: "12.10.22:", desc: "Add Alpine branch." }
124+ - { date: "12.10.22:", desc: "Add Alpine branch. Optimize wg and coredns services. " }
125125 - { date: "09.10.22:", desc: "Switch back to iptables-legacy due to issues on some hosts." }
126126 - { date: "04.10.22:", desc: "Rebase to Jammy. Upgrade to s6v3." }
127127 - { date: "16.05.22:", desc: "Improve NAT handling in server mode when multiple ethernet devices are present." }
Original file line number Diff line number Diff line change 11. {
22 loop
3+ health
34 forward . /etc/resolv.conf
45}
Original file line number Diff line number Diff line change 162162 echo "**** No client conf found. Provide your own client conf as \"/config/wg0.conf\" and restart the container. ****"
163163 sleep infinity
164164 fi
165- echo "**** Disabling CoreDNS ****"
166- rm -rf /etc/services.d/coredns
165+ printf "false" > /run/s6/container_environment/USE_COREDNS
167166fi
168167
169168# set up CoreDNS
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22
33if netstat -apn | grep -q ":53 "; then
4- echo "Another service is using port 53, disabling CoreDNS"
5- sleep infinity
4+ USE_COREDNS="false"
5+ fi
6+
7+ if [[ ${USE_COREDNS} == "false" ]]; then
8+ s6-notifyoncheck -d -n 300 -w 1000 -c "echo **** Disabling CoreDNS ****" \
9+ sleep infinity
10+ elif grep -q "health" /config/coredns/Corefile; then
11+ exec \
12+ s6-notifyoncheck -d -n 300 -w 1000 -c "redirfd -w 1 /dev/null curl -s http://localhost:8080/health" \
13+ cd /config/coredns \
14+ /app/coredns -dns.port=53
615else
7- exec \
8- s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z -u 127.0.0.1 53" \
9- cd /config/coredns \
10- /app/coredns -dns.port=53
16+ exec \
17+ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -zu localhost 53" \
18+ cd /config/coredns \
19+ /app/coredns -dns.port=53
1120fi
Original file line number Diff line number Diff line change 1+ /etc/s6-overlay/s6-rc.d/svc-wireguard/finish
Original file line number Diff line number Diff line change 1+ #!/usr/bin/with-contenv bash
2+
3+ wg-quick down wg0
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22
3- _term() {
4- echo "Caught SIGTERM signal!"
5- wg-quick down wg0
6- }
7-
8- trap _term SIGTERM
9-
103wg-quick up wg0
11-
12- sleep infinity &
13-
14- wait
Original file line number Diff line number Diff line change 1- longrun
1+ oneshot
Original file line number Diff line number Diff line change 1+ /etc/s6-overlay/s6-rc.d/svc-wireguard/run
You can’t perform that action at this time.
0 commit comments