Initial upload to Gitea

This commit is contained in:
antonn committed 2026-11-30 16:32:37 +00:00
1 parent 78193254ad
commit 8478998cae
1485 files changed
+461025 -42348

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
package main
import "path/filepath"
func removeUploadTemp(scopeHandle *safeRoot, tmpRel string) {
if parentFd, err := safeOpenDirAt(scopeHandle, filepath.Dir(tmpRel)); err == nil {
_ = safeRemoveAt(parentFd, filepath.Base(tmpRel))
_ = parentFd.Close()
}
}
// adpanel:upload-no-clobber - PUT must not replace a file created during transfer.
func commitStagedUpload(root *safeRoot, tmpRel, name string, createOnly bool) error {
if createOnly {
return renameNoReplaceUnderRoot(root, tmpRel, name, true)
}
return safeRenameUnderRoot(root, tmpRel, name)
}
func uploadDestinationExists() map[string]any {
return map[string]any{"ok": false, "error": "destination_exists"}
}