From: Jeff Halter Date: Mon, 1 Apr 2024 21:38:09 +0000 (-0700) Subject: Fix handling of absolute paths in FileRoot config field X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/70c2c1100ac57b9444e71fd76b5c5f3205c71024?hp=2327c11fadf3fe307eb9bfd7630bfccccb74d071 Fix handling of absolute paths in FileRoot config field --- diff --git a/hotline/server.go b/hotline/server.go index 6b55cf8..e4232b6 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -257,7 +257,10 @@ func NewServer(configDir, netInterface string, netPort int, logger *zap.SugaredL return nil, err } - server.Config.FileRoot = filepath.Join(configDir, "Files") + // If the FileRoot is an absolute path, use it, otherwise treat as a relative path to the config dir. + if !filepath.IsAbs(server.Config.FileRoot) { + server.Config.FileRoot = filepath.Join(configDir, server.Config.FileRoot) + } *server.NextGuestID = 1