summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-02-21 21:11:06 -0500
committerJesse Luehrs <doy@tozt.net>2024-02-21 21:11:06 -0500
commitb8d98946e806445049a6786f9dba4d0a2679cbcc (patch)
treec5eec220b21f1850066da6d5df6b6022fb849875 /modules
parent64ff3f3cd9dcee61fa40a52728860cf81479b3ab (diff)
downloadpuppet-tozt-b8d98946e806445049a6786f9dba4d0a2679cbcc.tar.gz
puppet-tozt-b8d98946e806445049a6786f9dba4d0a2679cbcc.zip
try enabling derp?
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/headscale/facts.d/bind_address8
-rw-r--r--modules/headscale/templates/config.yaml6
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/headscale/facts.d/bind_address b/modules/headscale/facts.d/bind_address
new file mode 100755
index 0000000..2e8236a
--- /dev/null
+++ b/modules/headscale/facts.d/bind_address
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+
+address="$(curl --connect-timeout 1 -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address || true)"
+if [ -n "$address" ]; then
+ printf "bind_address=%s" "$address"
+fi
diff --git a/modules/headscale/templates/config.yaml b/modules/headscale/templates/config.yaml
index d37eb3b..134f331 100644
--- a/modules/headscale/templates/config.yaml
+++ b/modules/headscale/templates/config.yaml
@@ -7,6 +7,12 @@ noise:
ip_prefixes:
- fd7a:115c:a1e0::/48
- 100.64.0.0/10
+derp:
+ server:
+ enabled: true
+ stun_listen_addr: 0.0.0.0:3478
+ private_key_path: <%= @data_dir %>/derp_server_private.key
+ ipv4: <%= @bind_address %>
disable_check_updates: true
db_type: sqlite3
db_path: <%= @data_dir %>/db.sqlite