diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-04-01 14:38:09 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-04-01 14:39:57 -0700 |
| commit | 70c2c1100ac57b9444e71fd76b5c5f3205c71024 (patch) | |
| tree | f0ca5fef8891638bacdacff254e42e51705a3736 /hotline | |
| parent | 2327c11fadf3fe307eb9bfd7630bfccccb74d071 (diff) | |
Fix handling of absolute paths in FileRoot config field
Diffstat (limited to 'hotline')
| -rw-r--r-- | hotline/server.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 |