Fix media-backend/media-webui: re-copy from post-revert MediaCollection
The original MediaEngine extraction (later folded into this repo) had been done BEFORE the owner's decision to revert the MediaViewer/Forge/ etc. rename, and was never re-extracted afterward like the other 7 service repos were - it silently carried stale renamed-era text (e.g. 'Porter' instead of 'MediaServant') into Go doc comments, WebUI prose, project-icons.json, and app-config.ts. Re-copied both directories fresh from the current (correctly reverted) MediaCollection/backend and MediaCollection/WebUI, then re-applied the go.mod replace-directive fix and re-added SECURITY_AUDIT.md (also newly migrated from MediaCollection root - a real deployment security checklist that would otherwise have been lost when MediaCollection is deleted). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
acde180086
commit
38a349eb52
20 files changed
+74
-55
No files matched your search
@@ -213,7 +213,7 @@ func (s *Server) configuredMounts(ctx context.Context) map[string][]mountEntry {
|
||||
}
|
||||
|
||||
// mountMappings returns each project's mount configuration as project -> mount type -> path(s),
|
||||
// the shape /mounts/resolve and /mounts/paths (and Porter's own "Mount health" panel via
|
||||
// the shape /mounts/resolve and /mounts/paths (and MediaServant's own "Mount health" panel via
|
||||
// /mounts) expect. configured_mounts is the live source and wins per-project when present;
|
||||
// mounts_path_mappings is an older format nothing has written since the Mounts workspace moved
|
||||
// to configured_mounts, kept only so a deployment that hasn't resaved its mounts since upgrading
|
||||
@@ -275,8 +275,8 @@ func (s *Server) mountMappings(ctx context.Context) map[string]any {
|
||||
// opposed to a project-specific working directory like "downloads", "generated",
|
||||
// "thumbnails", or "models", which have their own dedicated Root config fields instead and
|
||||
// are deliberately left out here. A path is entered under whichever project's tab happens to
|
||||
// need it (Lookout's "images"/"videos"/"audios", Playhouse/Marquee's "media", ...)
|
||||
// but they're all describing locations Porter itself has to walk, since it's the only
|
||||
// need it (MediaAnalyzer's "images"/"videos"/"audios", MediaViewer/MediaKiosk's "media", ...)
|
||||
// but they're all describing locations MediaServant itself has to walk, since it's the only
|
||||
// service with the volume mounted - see effectiveMediaRoots.
|
||||
var mediaLibraryMountTypes = map[string]bool{
|
||||
"media": true, "images": true, "videos": true, "audios": true, "funscripts": true,
|
||||
@@ -575,7 +575,7 @@ func (s *Server) writeServantFiles(w http.ResponseWriter, r *http.Request, recen
|
||||
if recent {
|
||||
sort.Slice(files, func(i, j int) bool { return files[i].Mtime > files[j].Mtime })
|
||||
}
|
||||
// Internal callers (e.g. Lookout discovery) need to list an entire real-sized library
|
||||
// Internal callers (e.g. MediaAnalyzer discovery) need to list an entire real-sized library
|
||||
// in one pass; the public 1000-item cap stays in place for anyone without the shared secret.
|
||||
maxLimit := 1000
|
||||
if s.cfg.InternalServiceSecret != "" && r.Header.Get("X-Internal-Auth") == s.cfg.InternalServiceSecret {
|
||||
@@ -785,7 +785,7 @@ func (s *Server) servantStore(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// resolveStoreFile is Servant's own local-filesystem lookup for /api/store, which catalogs a
|
||||
// file Forge already pushed into one of Servant's mounts (InputRoot, MediaRoots,
|
||||
// file MediaTools already pushed into one of Servant's mounts (InputRoot, MediaRoots,
|
||||
// DownloadsRoot, OutputRoot) - unlike everything else in this file, it's called with a path that
|
||||
// isn't necessarily under MediaRoots, so it can't just use resolveMediaPath.
|
||||
func (s *Server) resolveStoreFile(value string) (string, error) {
|
||||
|
||||
Reference in new issue
Block a user