Skip to content

Commit caef144

Browse files
committed
feat: change headscale-ui tls to dns cloudflare
1 parent 3a89e1e commit caef144

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

accessories/headscale/Caddyfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
https://example.org:443 {
1+
https://ns.juev.org:8443 {
22
reverse_proxy /web* http://headscale-ui:8080
33
reverse_proxy * http://headscale:8080
4+
5+
tls {
6+
dns cloudflare {env.CF_API_TOKEN}
7+
resolvers 1.1.1.1
8+
}
49
}

accessories/headscale/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM caddy:builder AS caddy-builder
2+
3+
RUN xcaddy build \
4+
--with github.com/caddy-dns/cloudflare
5+
6+
FROM caddy:alpine
7+
8+
COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy
+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
services:
2-
32
headscale:
43
container_name: headscale
54
image: headscale/headscale:latest
65
restart: unless-stopped
76
# ports:
8-
# - 8080:8080
7+
# - 8080:8080
98
volumes:
109
- ./config:/etc/headscale
1110
- ./data:/var/lib/headscale
@@ -17,11 +16,14 @@ services:
1716
restart: unless-stopped
1817

1918
caddy:
20-
image: caddy:alpine
19+
# image: caddy:alpine
20+
build: .
2121
restart: unless-stopped
2222
ports:
23-
- "80:80"
24-
- "443:443"
25-
- "443:443/udp"
23+
# - "80:80"
24+
- "8443:8443"
25+
- "8443:8443/udp"
2626
volumes:
27-
- ./Caddyfile:/etc/caddy/Caddyfile
27+
- ./Caddyfile:/etc/caddy/Caddyfile
28+
environment:
29+
- CF_API_TOKEN=token

0 commit comments

Comments
 (0)