aboutsummaryrefslogtreecommitdiff
path: root/cmd/mobius-hotline-server
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-07-26 18:19:33 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-07-26 18:19:33 -0700
commitd03ffd881e4a8bd93a2936556fd09214b4ad0bd1 (patch)
tree0df2796ed4b6ca6688e8bf8cb16c035aef822370 /cmd/mobius-hotline-server
parentc28fb3985c82544084a84d0d91c69fd102174a36 (diff)
Make Bonjour optional and disabled by default
Bonjour doesn't seem happy inside Docker, so I'm making it optional and off by default.
Diffstat (limited to 'cmd/mobius-hotline-server')
-rw-r--r--cmd/mobius-hotline-server/main.go10
-rw-r--r--cmd/mobius-hotline-server/mobius/config/config.yaml3
2 files changed, 9 insertions, 4 deletions
diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go
index e2c7789..1390dda 100644
--- a/cmd/mobius-hotline-server/main.go
+++ b/cmd/mobius-hotline-server/main.go
@@ -169,11 +169,13 @@ func main() {
// Assign functions to handle specific Hotline transaction types
mobius.RegisterHandlers(srv)
- s, err := bonjour.Register(srv.Config.Name, "_hotline._tcp", "", *basePort, []string{"txtv=1", "app=hotline"}, nil)
- if err != nil {
- slogger.Error("Error registering Hotline server with Bonjour", "err", err)
+ if srv.Config.EnableBonjour {
+ s, err := bonjour.Register(srv.Config.Name, "_hotline._tcp", "", *basePort, []string{"txtv=1", "app=hotline"}, nil)
+ if err != nil {
+ slogger.Error("Error registering Hotline server with Bonjour", "err", err)
+ }
+ defer s.Shutdown()
}
- defer s.Shutdown()
// Serve Hotline requests until program exit
log.Fatal(srv.ListenAndServe(ctx))
diff --git a/cmd/mobius-hotline-server/mobius/config/config.yaml b/cmd/mobius-hotline-server/mobius/config/config.yaml
index 0801621..7cb7412 100644
--- a/cmd/mobius-hotline-server/mobius/config/config.yaml
+++ b/cmd/mobius-hotline-server/mobius/config/config.yaml
@@ -58,3 +58,6 @@ MaxConnectionsPerIP: 0
IgnoreFiles:
- '^\.' # Ignore all files starting with ".". Leave this set if you are using the PreserveResourceForks option.
- '^@' # Ignore all files starting with "@"
+
+# Enable service announcement on local network with Bonjour
+EnableBonjour: false \ No newline at end of file