mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Remove use_username_in_magic_dns option
Upgrade the use of dns.use_username_in_magic_dns or dns_config.use_username_in_magic_dns to a fatal error and remove the option from the example configuration and integration tests. Fixes: #2219
This commit is contained in:
		
							parent
							
								
									697d80d5a8
								
							
						
					
					
						commit
						89a648c7dd
					
				@ -76,7 +76,7 @@ This will also affect the way you [reference users in policies](https://github.c
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### BREAKING
 | 
					### BREAKING
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Remove `dns.use_username_in_magic_dns` configuration option [#2020](https://github.com/juanfont/headscale/pull/2020)
 | 
					- Remove `dns.use_username_in_magic_dns` configuration option [#2020](https://github.com/juanfont/headscale/pull/2020), [#2279](https://github.com/juanfont/headscale/pull/2279)
 | 
				
			||||||
  - Having usernames in magic DNS is no longer possible.
 | 
					  - Having usernames in magic DNS is no longer possible.
 | 
				
			||||||
- Remove versions older than 1.56 [#2149](https://github.com/juanfont/headscale/pull/2149)
 | 
					- Remove versions older than 1.56 [#2149](https://github.com/juanfont/headscale/pull/2149)
 | 
				
			||||||
  - Clean up old code required by old versions
 | 
					  - Clean up old code required by old versions
 | 
				
			||||||
 | 
				
			|||||||
@ -311,15 +311,6 @@ dns:
 | 
				
			|||||||
  #   # you can also put it in one line
 | 
					  #   # you can also put it in one line
 | 
				
			||||||
  #   - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" }
 | 
					  #   - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # DEPRECATED
 | 
					 | 
				
			||||||
  # Use the username as part of the DNS name for nodes, with this option enabled:
 | 
					 | 
				
			||||||
  # node1.username.example.com
 | 
					 | 
				
			||||||
  # while when this is disabled:
 | 
					 | 
				
			||||||
  # node1.example.com
 | 
					 | 
				
			||||||
  # This is a legacy option as Headscale has have this wrongly implemented
 | 
					 | 
				
			||||||
  # while in upstream Tailscale, the username is not included.
 | 
					 | 
				
			||||||
  use_username_in_magic_dns: false
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Unix socket used for the CLI to connect without authentication
 | 
					# Unix socket used for the CLI to connect without authentication
 | 
				
			||||||
# Note: for production you will want to set this to something like:
 | 
					# Note: for production you will want to set this to something like:
 | 
				
			||||||
unix_socket: /var/run/headscale/headscale.sock
 | 
					unix_socket: /var/run/headscale/headscale.sock
 | 
				
			||||||
 | 
				
			|||||||
@ -322,14 +322,12 @@ func validateServerConfig() error {
 | 
				
			|||||||
	depr.fatalIfNewKeyIsNotUsed("dns.nameservers.split", "dns_config.restricted_nameservers")
 | 
						depr.fatalIfNewKeyIsNotUsed("dns.nameservers.split", "dns_config.restricted_nameservers")
 | 
				
			||||||
	depr.fatalIfNewKeyIsNotUsed("dns.search_domains", "dns_config.domains")
 | 
						depr.fatalIfNewKeyIsNotUsed("dns.search_domains", "dns_config.domains")
 | 
				
			||||||
	depr.fatalIfNewKeyIsNotUsed("dns.extra_records", "dns_config.extra_records")
 | 
						depr.fatalIfNewKeyIsNotUsed("dns.extra_records", "dns_config.extra_records")
 | 
				
			||||||
	depr.warn("dns_config.use_username_in_magic_dns")
 | 
						depr.fatal("dns.use_username_in_magic_dns")
 | 
				
			||||||
	depr.warn("dns.use_username_in_magic_dns")
 | 
						depr.fatal("dns_config.use_username_in_magic_dns")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// TODO(kradalby): Reintroduce when strip_email_domain is removed
 | 
						// TODO(kradalby): Reintroduce when strip_email_domain is removed
 | 
				
			||||||
	// after #2170 is cleaned up
 | 
						// after #2170 is cleaned up
 | 
				
			||||||
	// depr.fatal("oidc.strip_email_domain")
 | 
						// depr.fatal("oidc.strip_email_domain")
 | 
				
			||||||
	depr.fatal("dns.use_username_in_musername_in_magic_dns")
 | 
					 | 
				
			||||||
	depr.fatal("dns_config.use_username_in_musername_in_magic_dns")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	depr.Log()
 | 
						depr.Log()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -337,7 +335,8 @@ func validateServerConfig() error {
 | 
				
			|||||||
		// TODO(kradalby): Reintroduce when strip_email_domain is removed
 | 
							// TODO(kradalby): Reintroduce when strip_email_domain is removed
 | 
				
			||||||
		// after #2170 is cleaned up
 | 
							// after #2170 is cleaned up
 | 
				
			||||||
		// "oidc.strip_email_domain",
 | 
							// "oidc.strip_email_domain",
 | 
				
			||||||
		"dns_config.use_username_in_musername_in_magic_dns",
 | 
							"dns.use_username_in_magic_dns",
 | 
				
			||||||
 | 
							"dns_config.use_username_in_magic_dns",
 | 
				
			||||||
	} {
 | 
						} {
 | 
				
			||||||
		if viper.IsSet(removed) {
 | 
							if viper.IsSet(removed) {
 | 
				
			||||||
			log.Fatal().
 | 
								log.Fatal().
 | 
				
			||||||
 | 
				
			|||||||
@ -13,4 +13,3 @@ server_url: "https://server.derp.no"
 | 
				
			|||||||
dns:
 | 
					dns:
 | 
				
			||||||
  magic_dns: true
 | 
					  magic_dns: true
 | 
				
			||||||
  base_domain: derp.no
 | 
					  base_domain: derp.no
 | 
				
			||||||
  use_username_in_magic_dns: false
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -13,4 +13,3 @@ server_url: "https://derp.no"
 | 
				
			|||||||
dns:
 | 
					dns:
 | 
				
			||||||
  magic_dns: true
 | 
					  magic_dns: true
 | 
				
			||||||
  base_domain: clients.derp.no
 | 
					  base_domain: clients.derp.no
 | 
				
			||||||
  use_username_in_magic_dns: false
 | 
					 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								hscontrol/types/testdata/dns_full.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								hscontrol/types/testdata/dns_full.yaml
									
									
									
									
										vendored
									
									
								
							@ -33,5 +33,3 @@ dns:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # you can also put it in one line
 | 
					    # you can also put it in one line
 | 
				
			||||||
    - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.4" }
 | 
					    - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.4" }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  use_username_in_magic_dns: true
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -33,5 +33,3 @@ dns:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # you can also put it in one line
 | 
					    # you can also put it in one line
 | 
				
			||||||
    - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.4" }
 | 
					    - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.4" }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  use_username_in_magic_dns: true
 | 
					 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user