Skip to content
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

Headscale base_domain assertion is more strict than package's configuration check #371821

Closed
mtoohey31 opened this issue Jan 7, 2025 · 3 comments
Labels
0.kind: bug Something is broken

Comments

@mtoohey31
Copy link
Member

Describe the bug

Now that #358255 has been merged, Headscale's overly strict base_domain assertion (see juanfont/headscale#2210 for more discussion) has been fixed in the headscale package, but the corresponding assertion here:

{
# This is stricter than it needs to be but is exactly what upstream does:
# https://github.com/kradalby/headscale/blob/adc084f20f843d7963c999764fa83939668d2d2c/hscontrol/types/config.go#L799
assertion =
with cfg.settings;
dns.use_username_in_magic_dns or false
|| dns.base_domain == ""
|| !lib.hasInfix dns.base_domain server_url;
message = "server_url cannot contain the base_domain, this will cause the headscale server and embedded DERP to become unreachable from the Tailscale node.";
}
in the NixOS module wasn't fixed. As a result, this assertion now prohibits configurations which are valid according to the headscale package.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Configure headscale on a NixOS system using the module with (for example) https://bar.foo.com as server_url, and just foo as the dns.base_domain.
  2. Attempt to build the system. The assertion should be triggered, failing the build.

Expected behavior

The build should succeed, since the choice of server_url and base_domain above is valid according to the headscale package as of #358255.

Notify maintainers

@kradalby @Misterio77


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@mtoohey31 mtoohey31 added the 0.kind: bug Something is broken label Jan 7, 2025
@SuperSandro2000
Copy link
Member

Can you open a PR to reflect those changes?

@mtoohey31
Copy link
Member Author

👍 I'll try to get to it at some point. If someone else has time before I do though, feel free to go ahead and do it.

@mtoohey31
Copy link
Member Author

Looks like this was fixed by #374374.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants