File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,7 @@ func generateUserProfiles(
105
105
106
106
var profiles []tailcfg.UserProfile
107
107
for _ , user := range userMap {
108
- profiles = append (profiles ,
109
- user .TailscaleUserProfile ())
108
+ profiles = append (profiles , user .TailscaleUserProfile ())
110
109
}
111
110
112
111
return profiles
@@ -455,7 +454,7 @@ func (m *Mapper) baseWithConfigMapResponse(
455
454
456
455
resp .DERPMap = m .derpMap
457
456
458
- resp .Domain = m .cfg .BaseDomain
457
+ resp .Domain = m .cfg .Domain ()
459
458
460
459
// Do not instruct clients to collect services we do not
461
460
// support or do anything with them
Original file line number Diff line number Diff line change @@ -242,6 +242,17 @@ func validatePKCEMethod(method string) error {
242
242
return nil
243
243
}
244
244
245
+ // Domain returns the hostname/domain part of the ServerURL.
246
+ // If the ServerURL is not a valid URL, it returns the BaseDomain.
247
+ func (c * Config ) Domain () string {
248
+ u , err := url .Parse (c .ServerURL )
249
+ if err != nil {
250
+ return c .BaseDomain
251
+ }
252
+
253
+ return u .Hostname ()
254
+ }
255
+
245
256
// LoadConfig prepares and loads the Headscale configuration into Viper.
246
257
// This means it sets the default values, reads the configuration file and
247
258
// environment variables, and handles deprecated configuration options.
You can’t perform that action at this time.
0 commit comments