From da31024f8f2907d692cac6aa7eeffe3c5fc8f1e1 Mon Sep 17 00:00:00 2001 From: Josue-T Date: Mon, 16 Dec 2024 12:00:31 +0100 Subject: [PATCH] On notification server, get server host and port from environement if set (#728) --- notification-server/server.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/notification-server/server.go b/notification-server/server.go index 7b6dfead..c6af3f8e 100644 --- a/notification-server/server.go +++ b/notification-server/server.go @@ -11,6 +11,7 @@ import ( "os/signal" "path/filepath" "strings" + "strconv" "syscall" "time" @@ -45,8 +46,18 @@ func init() { } func loadNotifConfig() { - host = "0.0.0.0" + host := os.Getenv("NOTIFICATION_SERVER_HOST") + if host == "" { + host = "0.0.0.0" + } + port = 8083 + if os.Getenv("NOTIFICATION_SERVER_PORT") != "" { + i, err := strconv.Atoi(os.Getenv("NOTIFICATION_SERVER_PORT")) + if err == nil { + port = i + } + } logLevel := os.Getenv("NOTIFICATION_SERVER_LOG_LEVEL") if logLevel == "" {