Skip to content

Commit 7a76e82

Browse files
authored
Merge pull request #381 from Paraphraser/20210702-wireguard-experimental
20210702 WireGuard - experimental branch - PR 3 of 3
2 parents 293aedd + 0bccc28 commit 7a76e82

File tree

4 files changed

+42
-37
lines changed

4 files changed

+42
-37
lines changed

.internal/templates/services/wireguard/serviceFiles/wg0.conf

Whitespace-only changes.
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
wireguard:
2-
image: linuxserver/wireguard
32
container_name: wireguard
4-
cap_add:
5-
- NET_ADMIN
6-
- SYS_MODULE
3+
image: ghcr.io/linuxserver/wireguard
4+
restart: unless-stopped
75
environment:
8-
- PUID=1000
9-
- PGID=1000
10-
- TZ=Etc/UTC
11-
- SERVERURL=Unset
12-
- SERVERPORT=Unset
13-
- PEERS=1
14-
- PEERDNS=auto
15-
- INTERNAL_SUBNET=100.64.0.0/24
16-
volumes:
17-
- ./services/wireguard/config:/config
18-
- /lib/modules:/lib/modules
6+
- PUID=1000
7+
- PGID=1000
8+
- TZ=Etc/UTC
9+
- SERVERURL=Unset
10+
- SERVERPORT=Unset
11+
- PEERS=laptop,phone,tablet
12+
- PEERDNS=auto
13+
# - INTERNAL_SUBNET=100.64.0.0/24
14+
- ALLOWEDIPS=0.0.0.0/0
1915
ports:
20-
- "51820:51820/udp"
16+
- "51820:51820/udp"
17+
volumes:
18+
- ./volumes/wireguard:/config
19+
- /lib/modules:/lib/modules:ro
20+
cap_add:
21+
- NET_ADMIN
22+
- SYS_MODULE
2123
sysctls:
22-
- net.ipv4.conf.all.src_valid_mark=1
23-
restart: unless-stopped
24+
- net.ipv4.conf.all.src_valid_mark=1

.internal/templates/services/wireguard/tmp/build.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/host_installers/duck.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1-
#!/bin/bash
2-
# Your comma-separated domains list
3-
DOMAINS="YOUR_DOMAINS"
1+
#!/usr/bin/env bash
2+
3+
# Your DuckDNS domain (or comma-separated list of DuckDNS domains if you
4+
# have multiple domains associated with the same IP address).
5+
DOMAINS="YOURS.duckdns.org"
6+
47
# Your DuckDNS Token
58
DUCKDNS_TOKEN="YOUR_DUCKDNS_TOKEN"
69

7-
# A random delay to avoid every client contacting the duckdns server at the same moment
8-
sleep $((RANDOM % 60))
10+
# is this script running in the foreground or background?
11+
if [ "$(tty)" = "not a tty" ] ; then
12+
13+
# background! Assume launched by cron. Add a random delay to avoid
14+
# every client contacting DuckDNS at exactly the same moment.
15+
sleep $((RANDOM % 60))
16+
17+
fi
18+
19+
# mark the event in case this is being logged.
20+
echo "$(date "+%a, %d %b %Y %H:%M:%S %z") - updating DuckDNS"
21+
922
# Request duckdns to update your domain name with your public IP address
10-
curl --silent --max-time 10 --output /dev/null "https://www.duckdns.org/update?domains=${DOMAINS}&token=${DUCKDNS_TOKEN}&ip="
23+
curl --max-time 10 \
24+
"https://www.duckdns.org/update?domains=${DOMAINS}&token=${DUCKDNS_TOKEN}&ip="
25+
26+
# curl does not append newline so fix that
27+
echo ""

0 commit comments

Comments
 (0)