update where shell starts and add override -home setting

This commit is contained in:
2026-05-24 09:17:21 +00:00
parent ade413bac7
commit 6318643c25
7 changed files with 39 additions and 23 deletions
+2 -2
View File
@@ -374,7 +374,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
destDir := strings.TrimSpace(r.FormValue("dest"))
if destDir == "" {
destDir = initialCwd
destDir = shellHome
}
destPath := filepath.Join(filepath.Clean(destDir), filepath.Base(header.Filename))
@@ -400,7 +400,7 @@ func handleDownload(w http.ResponseWriter, r *http.Request) {
}
full := filepath.Clean(path)
if !filepath.IsAbs(full) {
full = filepath.Join(initialCwd, full)
full = filepath.Join(shellHome, full)
}
if _, err := os.Stat(full); err != nil {
http.Error(w, "file not found", http.StatusNotFound)