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 @@
| Owner | Status | ID | Name | Updated | Blob | Aktionen | +ID | +Name | +Updated | +Blob | +Owner | +Status | +Aktionen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ .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 }} + | @@ -77,17 +84,17 @@ | ||||
| Keine Dateien vorhanden. | |||||||||||||
| Keine Dateien vorhanden. | |||||||||||||