From 6fd2ae73ccc9170340bc702b37843dcccf1fd4ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:30:28 +0000 Subject: [PATCH 1/2] Initial plan From a37c62a8397eb3b5a0e468a2e8a94fb0bcf7cab8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:33:38 +0000 Subject: [PATCH 2/2] Address review comments: fix indentation, add quotes, document IPV6_ONLY Co-authored-by: EdGeraghty <20861699+EdGeraghty@users.noreply.github.com> --- scripts/container-entrypoint.sh | 8 ++++---- templates/secrets.template.env | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/container-entrypoint.sh b/scripts/container-entrypoint.sh index 2792bd5..7ae2c5a 100755 --- a/scripts/container-entrypoint.sh +++ b/scripts/container-entrypoint.sh @@ -170,10 +170,10 @@ check_ip_address_settings() { check_env_var_or_set_default "IPV6_PREFIX" "${headscale_ipv6_prefix_default}" if [[ "${IPV6_ONLY}" == "true" ]]; then - export IP_PREFIXES="v6: $IPV6_PREFIX" + export IP_PREFIXES="v6: ${IPV6_PREFIX}" else - export IP_PREFIXES="v4: $IPV4_PREFIX - v6: $IPV6_PREFIX" + export IP_PREFIXES="v4: ${IPV4_PREFIX} + v6: ${IPV6_PREFIX}" fi } @@ -208,7 +208,7 @@ create_headscale_config() { "HEADSCALE_DNS_BASE_DOMAIN" "HEADSCALE_OVERRIDE_LOCAL_DNS" "MAGIC_DNS" - "IP_PREFIXES" + "IP_PREFIXES" "IP_ALLOCATION" "HEADSCALE_EXTRA_RECORDS_PATH" ) diff --git a/templates/secrets.template.env b/templates/secrets.template.env index 11abe16..02106a6 100644 --- a/templates/secrets.template.env +++ b/templates/secrets.template.env @@ -24,6 +24,9 @@ HEADSCALE_DNS_BASE_DOMAIN=CHANGEME # IPV6_PREFIX="fd7a:115c:a1e0::/48" # IPV4_PREFIX="100.64.0.0/10" +# Enable IPv6-only mode (disables IPv4 prefix allocation) +# IPV6_ONLY=false + # The following one can be set after first deployment # If not, it will require all Tailscale clients to restart on every deploy # HEADSCALE_NOISE_PRIVATE_KEY=CHANGEME