diff --git a/cmd/unified/main.go b/cmd/unified/main.go index dec0654..0b73fd6 100644 --- a/cmd/unified/main.go +++ b/cmd/unified/main.go @@ -643,6 +643,19 @@ func registerPublicDownloads(mux *http.ServeMux, store filesvc.MeshStore, blobs defer rc.Close() serveBlob(w, r, rc, meta, it.Name) // Download-Name aus Store! return + } else { // ########## HIER EVENTUELL PROBLEM!!! ########### + // Lokal nicht vorhanden → nur aus Mesh ziehen, wenn Owner aktiv ist + it, err := store.Get(r.Context(), filesvc.ID(id)) + if err != nil || it.Deleted { + http.NotFound(w, r) + return + } + peers := meshNode.PeerList() + ttl := 2 * time.Minute + if !isOwnerActive(it.Owner, peers, ttl) { + http.NotFound(w, r) + return + } } // 3) aus Mesh holen (signiert) und cachen diff --git a/internal/admin/tpl/partials_items.html b/internal/admin/tpl/partials_items.html index 3023b23..85d86ad 100644 --- a/internal/admin/tpl/partials_items.html +++ b/internal/admin/tpl/partials_items.html @@ -24,28 +24,19 @@ - + + + + + + + {{ range .Items }} - - - + + + {{ else }} - + {{ end }}
OwnerStatusIDNameUpdatedBlobAktionenIDNameUpdatedBlobOwnerStatusAktionen
{{ .Owner }} - {{ if .OwnerActive }} - online - {{ else }} - offline -
- - -
- {{ end }} -
{{ .ID }}{{ .ID }} {{ .Name }} {{ printf "%.19s" (timeRFC3339 .UpdatedAt) }} @@ -56,18 +47,34 @@ fehlt {{ end }} {{ .Owner }} + {{ if .OwnerActive }} + online + {{ else }} + offline + +
+ + +
+ {{ end }} +
+ hx-post="/admin/items/rename" + hx-target="#items" hx-swap="outerHTML">
+ hx-post="/admin/items/delete" + hx-target="#items" hx-swap="outerHTML" + onsubmit="return confirm('Wirklich löschen (inkl. Blob)?');">
@@ -77,17 +84,17 @@
Keine Dateien vorhanden.
Keine Dateien vorhanden.
{{ if .Next }}
- next={{ .Next }}
{{ end }} - \ No newline at end of file +