1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-04-27 19:15:07 +00:00

On notification server, get server host and port from environement if set (#728)

This commit is contained in:
Josue-T 2024-12-16 12:00:31 +01:00 committed by GitHub
parent c11e8ccbe9
commit da31024f8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 == "" {