ui
Some checks are pending
CI / test-control-plane (push) Waiting to run
CI / test-node-agent (push) Waiting to run
CI / build-web (push) Waiting to run

This commit is contained in:
Harivansh Rathi 2026-04-01 21:18:08 -04:00
parent 171a682f6a
commit f6069a024a
7 changed files with 675 additions and 120 deletions

View file

@ -234,12 +234,24 @@ func (a *app) handler() http.Handler {
for _, mount := range a.exportMounts {
mountPathPrefix := strings.TrimSuffix(mount.mountPath, "/")
fs := webdav.Dir(mount.exportPath)
lockSystem := webdav.NewMemLS()
dav := &webdav.Handler{
Prefix: mountPathPrefix,
FileSystem: fs,
LockSystem: webdav.NewMemLS(),
LockSystem: lockSystem,
}
mux.Handle(mount.mountPath, a.requireDAVAuth(mount, finderCompatible(dav, fs, mountPathPrefix)))
// Register a username-scoped handler at {mountPath}{username}/ so
// Finder shows the username as the volume name in the sidebar.
userScopedPath := mount.mountPath + a.authUsername + "/"
userScopedPrefix := strings.TrimSuffix(userScopedPath, "/")
userDav := &webdav.Handler{
Prefix: userScopedPrefix,
FileSystem: fs,
LockSystem: lockSystem,
}
mux.Handle(userScopedPath, a.requireDAVAuth(mount, finderCompatible(userDav, fs, userScopedPrefix)))
}
return mux