Skip to content

Commit 7764733

Browse files
committed
set data directory to /data
1 parent f4df033 commit 7764733

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/storage/utils/localfs/localfs.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (c *Config) ApplyDefaults() {
8383
// ensure share folder always starts with slash
8484
c.ShareFolder = path.Join("/", c.ShareFolder)
8585

86-
c.DataDirectory = c.Root // path.Join(c.Root, "data")
86+
c.DataDirectory = path.Join(c.Root, "data")
8787
c.Uploads = path.Join(c.Root, ".uploads")
8888
c.Shadow = path.Join(c.Root, ".shadow")
8989

@@ -162,6 +162,7 @@ func getUser(ctx context.Context) (*userpb.User, error) {
162162
}
163163

164164
func (fs *localfs) wrap(ctx context.Context, p string) string {
165+
log := appctx.GetLogger(ctx)
165166
// This is to prevent path traversal.
166167
// With this p can't break out of its parent folder
167168
p = path.Join("/", p)
@@ -175,6 +176,7 @@ func (fs *localfs) wrap(ctx context.Context, p string) string {
175176
} else {
176177
internal = path.Join(fs.conf.DataDirectory, p)
177178
}
179+
log.Debug().Str("old", p).Str("wrapped", internal).Msg("localfs: wrap")
178180
return internal
179181
}
180182

0 commit comments

Comments
 (0)