From 2f3a440de528aab3234ac5f5dfec53b2401a6e30 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Wed, 17 Jun 2026 11:11:20 -0400 Subject: [PATCH] fix: auto read dns.extra_records_path instead of making it required Closes HP-538 --- app/server/headscale/config-loader.ts | 2 +- config.example.yaml | 8 ++++---- docs/NixOS-options.md | 2 +- docs/install/docker.md | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/server/headscale/config-loader.ts b/app/server/headscale/config-loader.ts index 437f83c..151dfbf 100644 --- a/app/server/headscale/config-loader.ts +++ b/app/server/headscale/config-loader.ts @@ -251,7 +251,7 @@ export async function loadHeadscaleConfig(path?: string, strict = true, dnsPath? return new HeadscaleConfig("no"); } - const dns = await loadHeadscaleDNS(dnsPath); + const dns = await loadHeadscaleDNS(dnsPath ?? config.dns.extra_records_path); if (dns && !config.dns.extra_records_path) { log.error( "config", diff --git a/config.example.yaml b/config.example.yaml index af73341..5eecad8 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -101,11 +101,11 @@ headscale: config_strict: true # If you are using `dns.extra_records_path` in your Headscale - # configuration, you need to set this to the path for Headplane - # to be able to read the DNS records. + # configuration, Headplane will read that path automatically. Set + # this only when Headplane needs to access the same file at a + # different path, such as in Docker bind mounts. # - # Pass it in if using Docker and ensure that the file is both - # readable and writable to the Headplane process. + # Ensure that the file is both readable and writable to the Headplane process. # When using this, Headplane will no longer need to automatically # restart Headscale for DNS record changes. # dns_records_path: "/var/lib/headscale/extra_records.json" diff --git a/docs/NixOS-options.md b/docs/NixOS-options.md index 31cb5b8..41777ba 100644 --- a/docs/NixOS-options.md +++ b/docs/NixOS-options.md @@ -83,7 +83,7 @@ _Default:_ `true` ## settings.headscale.dns_records_path -_Description:_ If you are using `dns.extra_records_path` in your Headscale configuration, you need to set this to the path for Headplane to be able to read the DNS records. +_Description:_ If you are using `dns.extra_records_path` in your Headscale configuration, Headplane reads that path automatically. Set this only when Headplane needs to access the same file at a different path. Ensure that the file is both readable and writable by the Headplane process. When using this, Headplane will no longer need to automatically restart Headscale for DNS record changes. diff --git a/docs/install/docker.md b/docs/install/docker.md index 1e8ed8c..b231d82 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -123,10 +123,10 @@ services: # Headplane config.yaml file. - "/path/to/headscale/config.yaml:/etc/headscale/config.yaml" - # If you are using dns.extra_records in Headscale (recommended), you - # should also mount that file here so Headplane can read and write it. - # Ensure that the path matches `headscale.dns_records_path` in your - # Headplane config.yaml file. + # If you are using dns.extra_records_path in Headscale (recommended), + # also mount that file here so Headplane can read and write it. If the + # in-container path differs from Headscale's dns.extra_records_path, + # set `headscale.dns_records_path` in your Headplane config.yaml file. - "/path/to/headscale/dns_records.json:/etc/headscale/dns_records.json" # Read-only access to the Docker socket (or a proxy)