[PR #196] [MERGED] Add ability to fetch DERP from url and file #1313

Closed
opened 2025-12-29 02:29:39 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/196
Author: @kradalby
Created: 10/22/2021
Status: Merged
Merged: 10/23/2021
Merged by: @kradalby

Base: mainHead: derp-improvements


📝 Commits (10+)

  • e836db1 Add config.yaml to gitignore
  • aa245c2 Remove derp.yaml, add selfhosted example
  • 57f46de Split derp into its own config struct
  • 177f1ec Add helper functions for building derp maps from urls and file
  • 582eb57 Use the new derp map
  • 0e902fe Add certificates to docker image so we can get derpmap from tailscale
  • d875cca move integration to yaml, add new derp configuration
  • aefbd66 Remove derpmap volume from integration tests
  • a355769 Update derp-example.yaml
  • 389a8d4 Merge branch 'main' into derp-improvements

📊 Changes

14 files changed (+349 additions, -227 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 Dockerfile (+5 -0)
📝 api.go (+12 -3)
📝 app.go (+28 -6)
📝 cmd/headscale/cli/utils.go (+46 -32)
📝 cmd/headscale/headscale_test.go (+19 -9)
📝 config.yaml.postgres.example (+0 -1)
📝 config.yaml.sqlite.example (+24 -7)
derp-example.yaml (+15 -0)
derp.go (+152 -0)
derp.yaml (+0 -146)
📝 integration_test.go (+27 -4)
integration_test/etc/config.json (+0 -19)
integration_test/etc/config.yaml (+20 -0)

📄 Description

This PR contains a breaking configuration change.

It expands on the DERP functionality and allows it to load both from file and URLs. It also adds the ability to have a worker that will periodically update the derp maps.

The breaking change will remove the configuration flag:

derp_map_path

in favour of a new interface:

derp:
  # List of externally available DERP maps encoded in JSON
  urls:
    - https://controlplane.tailscale.com/derpmap/default

  # Locally available DERP map files encoded in YAML
  paths:
    - derp-example.yaml

  # If enabled, a worker will be set up to periodically
  # refresh the given sources and update the derpmap
  # will be set up.
  auto_update_enabled: true

  # How often should we check for updates?
  update_frequency: 24h

This PR is best reviewed commit by commit.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/196 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 10/22/2021 **Status:** ✅ Merged **Merged:** 10/23/2021 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `derp-improvements` --- ### 📝 Commits (10+) - [`e836db1`](https://github.com/juanfont/headscale/commit/e836db1eadcf3a517758cf5ac342cdf25d903e3c) Add config.yaml to gitignore - [`aa245c2`](https://github.com/juanfont/headscale/commit/aa245c2d06a2dbd9caded3c063c9429d4bc3af78) Remove derp.yaml, add selfhosted example - [`57f46de`](https://github.com/juanfont/headscale/commit/57f46ded83456cc5abae95db15099abd51773bd8) Split derp into its own config struct - [`177f1ec`](https://github.com/juanfont/headscale/commit/177f1eca06ff3f046ac75c921f01ccf1b0eb80ab) Add helper functions for building derp maps from urls and file - [`582eb57`](https://github.com/juanfont/headscale/commit/582eb57a092b15ba84e1f69b9bca4a0c485249f7) Use the new derp map - [`0e902fe`](https://github.com/juanfont/headscale/commit/0e902fe949cec49aeea5f48da98779993f3b213d) Add certificates to docker image so we can get derpmap from tailscale - [`d875cca`](https://github.com/juanfont/headscale/commit/d875cca69d7919fdeb476b6c5b442ce5439d9e8c) move integration to yaml, add new derp configuration - [`aefbd66`](https://github.com/juanfont/headscale/commit/aefbd66317d837846e1db8c4fdc4d11633e885cf) Remove derpmap volume from integration tests - [`a355769`](https://github.com/juanfont/headscale/commit/a3557694161dfa18aa518df84e73a60d30c001ae) Update derp-example.yaml - [`389a8d4`](https://github.com/juanfont/headscale/commit/389a8d47a35e75c709c344a08086e4a3db4a708f) Merge branch 'main' into derp-improvements ### 📊 Changes **14 files changed** (+349 additions, -227 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `Dockerfile` (+5 -0) 📝 `api.go` (+12 -3) 📝 `app.go` (+28 -6) 📝 `cmd/headscale/cli/utils.go` (+46 -32) 📝 `cmd/headscale/headscale_test.go` (+19 -9) 📝 `config.yaml.postgres.example` (+0 -1) 📝 `config.yaml.sqlite.example` (+24 -7) ➕ `derp-example.yaml` (+15 -0) ➕ `derp.go` (+152 -0) ➖ `derp.yaml` (+0 -146) 📝 `integration_test.go` (+27 -4) ➖ `integration_test/etc/config.json` (+0 -19) ➕ `integration_test/etc/config.yaml` (+20 -0) </details> ### 📄 Description This PR contains a **breaking** configuration change. It expands on the DERP functionality and allows it to load both from file and URLs. It also adds the ability to have a worker that will periodically update the derp maps. The breaking change will remove the configuration flag: `derp_map_path` in favour of a new interface: ```yaml derp: # List of externally available DERP maps encoded in JSON urls: - https://controlplane.tailscale.com/derpmap/default # Locally available DERP map files encoded in YAML paths: - derp-example.yaml # If enabled, a worker will be set up to periodically # refresh the given sources and update the derpmap # will be set up. auto_update_enabled: true # How often should we check for updates? update_frequency: 24h ``` This PR is best reviewed commit by commit. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:29:39 +01:00
adam closed this issue 2025-12-29 02:29:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1313