enhancement: log effective data and config paths at startup

Log the resolved OCIS_BASE_DATA_PATH and OCIS_CONFIG_DIR at startup
so operators can immediately see where data is being written. This
catches misconfigured Docker volume mounts where data silently falls
back to ~/.ocis inside the container instead of /var/lib/ocis.

Fixes: #12044

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Faure
2026-03-13 23:38:42 -04:00
parent 3ac19ca463
commit 3c51128d3e
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
Enhancement: Log effective data and config paths at startup
oCIS now logs the effective data path and config path at startup so
operators can immediately verify that data is written to the expected
location. This helps catch misconfigured Docker volume mounts where
data silently falls back to an ephemeral container path instead of
the intended persistent mount.
https://github.com/owncloud/ocis/pull/XXXX
https://github.com/owncloud/ocis/issues/12044

View File

@@ -27,6 +27,7 @@ import (
"github.com/thejerf/suture/v4"
ociscfg "github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/defaults"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
ogrpc "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
@@ -370,6 +371,13 @@ func Start(ctx context.Context, o ...Option) error {
return err
}
// Log the effective data and config paths at startup so operators can
// verify that data is written to the expected location.
s.Log.Info().
Str("data_path", defaults.BaseDataPath()).
Str("config_path", defaults.BaseConfigPath()).
Msg("effective data and config paths")
// cancel the context when a signal is received.
var cancel context.CancelFunc = func() {}
if ctx == nil {