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

[Bug] dns.use_username_in_magic_dns configuration key is deprecated warning #2065

Closed
4 tasks done
mitchellkellett opened this issue Aug 20, 2024 · 6 comments · Fixed by #2075
Closed
4 tasks done

[Bug] dns.use_username_in_magic_dns configuration key is deprecated warning #2065

mitchellkellett opened this issue Aug 20, 2024 · 6 comments · Fixed by #2075
Labels
bug Something isn't working
Milestone

Comments

@mitchellkellett
Copy link

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Since upgrading to 0.23.0-beta2, I'm now seeing the following in the startup log. I don't have use_username_in_magic_dns in the DNS section of the config.yaml file.

2024-08-20T21:13:50Z WRN
WARN: The "dns.use_username_in_magic_dns" configuration key is deprecated and has been removed. Please see the changelog for more details.

Expected Behavior

I'm only warned of the deprecation if I use use_username_in_magic_dns in the DNS section of the config.yaml file.

Steps To Reproduce

  1. Upgrade to 0.23.0-beta2.
  2. Start Headscale
  3. Observe Logs

Environment

- OS: Ubuntu 22.04
- Headscale version: 0.23.0-beta2
- Tailscale version: 1.70.0

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

config.yaml

~~~
dns:
  magic_dns: true
  base_domain: hs.net
  nameservers:
    global:
      - https://dns.nextdns.io/abc123
  search_domains: []
  extra_records: []
~~~
@mitchellkellett mitchellkellett added the bug Something isn't working label Aug 20, 2024
@kradalby kradalby added this to the v0.23.0 milestone Aug 21, 2024
@gperez2000
Copy link

gperez2000 commented Aug 21, 2024

The DNS configuration I have set up is as follows: I am not receiving any messages since I implemented it, and it functions well.

dns:

  nameservers:
    global:

    - 1.1.1.3
    - 9.9.9.9
    - 8.8.8.8


    split:
      yourdomain.com:
        - x.x.x.x
        - x.x.x.x
  domains: []
  extra_records:
    - name: "gitlab.yourdomain.dev"
      type: "A"
      value: "x.x.x.x"
    - name: "headscale.yourdomain.com"
      type: "A"
      value: "x.x.x.x"


  magic_dns: true


  base_domain: yourdomain.net
  use_username_in_magic_dns: false

@kradalby
Copy link
Collaborator

please use markdown formatting, this is impossible to read.

@Zeashh
Copy link

Zeashh commented Aug 21, 2024

I got the same warning on the v.0.23.0-beta2 Docker image:

2024-08-21T07:39:56Z WRN
WARN: The "dns.use_username_in_magic_dns" configuration key is deprecated and has been removed. Please see the changelog for more details.

Config:

    server_url: https://domain.com:443
    listen_addr: 0.0.0.0:8080
    metrics_listen_addr: 0.0.0.0:9090
    grpc_listen_addr: 127.0.0.1:50443
    grpc_allow_insecure: false
    private_key_path: "/var/lib/headscale/private.key"
    noise:
      private_key_path: "/var/lib/headscale/noise_private.key"
    prefixes:
      v4: 100.64.0.0/10
      v6: fd7a:115c:a1e0::/48
      allocation: sequential
    derp:
      server:
        enabled: true
        region_id: 999
        region_code: "headscale"
        region_name: "Headscale Embedded DERP"
        stun_listen_addr: "0.0.0.0:3478"
        private_key_path: "/var/lib/headscale/derp_server_private.key"
        automatically_add_embedded_derp_region: true
      urls: []
      paths:
        - /etc/headscale/derp.yaml
      auto_update_enabled: true
      update_frequency: 24h
    disable_check_updates: true
    ephemeral_node_inactivity_timeout: 1h
    database:
      type: postgres
      postgres:
        host: ...
        port: 5432
        name: headscale
        user: headscale
        pass: "..."
        max_open_conns: 10
        max_idle_conns: 10
        conn_max_idle_time_secs: 3600
        ssl: true
    log:
      format: text
      level: debug
    dns:
      magic_dns: true
      base_domain: clients.domain.com
      nameservers:
        global:
          - 192.168.100.20
          #        - 1.1.1.1
          #        - 9.9.9.9
      split: {}
      search_domains:
        - clients.domain.com
      extra_records: []
    unix_socket: /var/run/headscale/headscale.sock
    unix_socket_permission: "0770"
    logtail:
      enabled: true
    randomize_client_port: false

@kradalby
Copy link
Collaborator

I think its because I use viper to set it default false, should be fixed shortly.

kradalby added a commit to kradalby/headscale that referenced this issue Aug 23, 2024
kradalby added a commit to kradalby/headscale that referenced this issue Aug 23, 2024
@cg31
Copy link

cg31 commented Aug 23, 2024

This warning is bogus. Even we remove use_username_in_magic_dns in config.yaml, it still shows up.

Because LoadConfig() set a default and later warns about it:

https://github.com/juanfont/headscale/blob/main/hscontrol/types/config.go#L249

viper.SetDefault("dns.use_username_in_magic_dns", false)
// later
depr.warn("dns.use_username_in_magic_dns")

@kradalby
Copy link
Collaborator

Yes, just mentioned that in the previous comment, its fixed in #2075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants