feat: implement configurable delete modes

This commit is contained in:
OpenClaw Agent
2026-09-21 13:38:18 +08:00
parent 633c833d1c
commit add2a22416
7 changed files with 102 additions and 5 deletions
+2 -2
View File
@@ -67,9 +67,9 @@ func main() {
if len(cfg.Path) == 1 {
store = storage.Local{Root: root}
}
srv := &api.Server{Store: store, Auth: mgr, Sessions: map[string]*auth.Account{}, WebDAVRoot: root, Allow: cfg.Allow, MultiRoot: len(cfg.Path) > 1}
srv := &api.Server{Store: store, Auth: mgr, Sessions: map[string]*auth.Account{}, WebDAVRoot: root, Allow: cfg.Allow, MultiRoot: len(cfg.Path) > 1, RemoveMode: cfg.FileRemove}
addr := ":" + itoa(cfg.Port)
log.Printf("chfs-ng listening on %s root=%s", addr, filepath.Clean(root))
log.Printf("chfs-ng listening on %s root=%s removeMode=%d", addr, filepath.Clean(root), cfg.FileRemove)
if cfg.SSLCert != "" && cfg.SSLKey != "" {
log.Fatal(http.ListenAndServeTLS(addr, cfg.SSLCert, cfg.SSLKey, srv.Handler()))
}