Skip to content

Commit

Permalink
Fix: don't add ".local" to hostname if already present (Mac)
Browse files Browse the repository at this point in the history
  • Loading branch information
betamos committed Aug 26, 2023
1 parent a63d269 commit 51441e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log/slog"
"net"
"strings"
"time"
)

Expand Down Expand Up @@ -65,7 +66,8 @@ func (o *Options) Validate() error {
// Addrs and Hostname are determined automatically, but can be overriden.
func (o *Options) Publish(s *Service, i *Instance) *Options {
if i.Hostname == "" {
i.Hostname = fmt.Sprintf("%v.%v", defaultHostname, s.Domain)
hostname, _ := strings.CutSuffix(defaultHostname, ".local")
i.Hostname = fmt.Sprintf("%v.%v", hostname, s.Domain)
}
o.publisher = &publisher{s, i}
return o
Expand Down

0 comments on commit 51441e0

Please sign in to comment.