-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add an embedded DERP server to Headscale #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
897d480
Add an embedded DERP server to Headscale
juanfont 9d43f58
Added missing deps
juanfont 23cde84
Merge branch 'main' into embedded-derp
juanfont 607c1eb
Be consistent with uppercase DERP
juanfont 22d2443
Move more stuff to common
juanfont 09d78c7
Even more stuff moved to common
juanfont 758b1ba
Renamed configuration items of the DERP server
juanfont df37d1a
Do not offer the option to be DERP insecure
juanfont b742379
Do not use the term embedded
juanfont 88378c2
Rename the file to derp_server.go for coherence
juanfont e9eb90f
Added integration tests for the embedded DERP server
juanfont 992efbd
Added missing private TLS key
juanfont 237f7f1
Merge branch 'main' into embedded-derp
juanfont e78c002
Fix minor issue
juanfont 54c3e00
Merge local DERP server region with other configured DERP sources
juanfont 70910c4
Working /bootstrap-dns DERP helper
juanfont dc909ba
Improved logging on startup
juanfont eb50015
Make STUN server configurable
juanfont eb06054
Make DERP Region configurable
juanfont de2ea83
Linting here and there
juanfont e1fcf0d
Added more version
juanfont b47de07
Update Dockerfile.tailscale
juanfont 580db9b
Mention that STUN is UDP
juanfont a27b386
Clarified expiration dates
juanfont b3fa66d
Check for DERP in test
juanfont 05df8e9
Added missing file
juanfont 15ed713
Merge branch 'embedded-derp' of https://github.com/juanfont/headscale…
juanfont 03452a8
Prettied
juanfont dd26cbd
Merge branch 'main' into embedded-derp
kradalby cc0c88a
Added small integration test for stun
juanfont b41d899
Merge branch 'embedded-derp' of https://github.com/juanfont/headscale…
juanfont 05c5e22
Updated CHANGELOG and README
juanfont e5d22b8
Merge branch 'main' into embedded-derp
juanfont bdbf620
Merge branch 'embedded-derp' of https://github.com/juanfont/headscale…
juanfont b803240
Added new line for prettier
juanfont File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,26 @@ ip_prefixes: | |
| # headscale needs a list of DERP servers that can be presented | ||
| # to the clients. | ||
| derp: | ||
| server: | ||
| # If enabled, runs the embedded DERP server and merges it into the rest of the DERP config | ||
| # The Headscale server_url defined above MUST be using https, DERP requires TLS to be in place | ||
| enabled: false | ||
|
|
||
| # Region ID to use for the embedded DERP server. | ||
| # The local DERP prevails if the region ID collides with other region ID coming from | ||
| # the regular DERP config. | ||
| region_id: 999 | ||
|
|
||
| # Region code and name are displayed in the Tailscale UI to identify a DERP region | ||
| region_code: "headscale" | ||
| region_name: "Headscale Embedded DERP" | ||
|
|
||
| # If enabled, also listens in UDP at the configured address for STUN connections to help on NAT traversal | ||
| # For more details on how this works, check this great article: https://tailscale.com/blog/how-tailscale-works/ | ||
| stun: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could possible call out that this is UDP, so people know what to open in firewall. |
||
| enabled: false | ||
| listen_addr: "0.0.0.0:3478" | ||
|
|
||
| # List of externally available DERP maps encoded in JSON | ||
| urls: | ||
| - https://controlplane.tailscale.com/derpmap/default | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we split this into
DERPServerConfigandDERPSTUNConfig?At some point I want to have a go at getting rid of all the manual reading of options from viper, I think it can do that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe look into using HCL struct based parsing?