From ac4aa1ebe290206b2aef2c8e07f47831789bbccc Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 26 Jan 2020 22:18:30 -0500 Subject: [PATCH] feat: PORT env var can override configured port --- conf/configuration.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf/configuration.go b/conf/configuration.go index 346f1823..2118de73 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -84,6 +84,9 @@ func LoadFromFile(confFile string, skipFlags ...bool) { if Server.DbPath == "" { Server.DbPath = filepath.Join(Server.DataFolder, "navidrome.db") } + if os.Getenv("PORT") != "" { + Server.Port = os.Getenv("PORT") + } log.SerLevelString(Server.LogLevel) log.Trace("Loaded configuration", "file", confFile, "config", fmt.Sprintf("%#v", Server)) }