Give uploads one path end to end, and serve /uploads/ from Garage first
Frontend: src/uploads.js is the one way to store or show a file (uploadFile, ACCEPT, kindOf, isUploadUrl, tagFor, mediaSize). Chat, the box editor, canvas drops and the background editor all use it; views/home3/upload.js and the chat store's own axios call are gone. Backend: POST /api/uploads (was /messages/upload) is a thin wrapper over services.Uploads.Save, which owns validation, naming and storage. The three per-extension maps are now one UploadTypes table, and a refused file is an *UploadError whose message is safe to show. nginx now fetches /uploads/ from Garage first and falls back to the volume on a 404 or any 5xx, so the bucket is the source of truth and deleting a file in garage-webui unpublishes it, while a Garage outage still only affects bucket-only files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@
|
||||
# garage/bootstrap.sh imports); garage-webui browses through it.
|
||||
# 3901 RPC between Garage nodes. Only this node talks to itself.
|
||||
# 3902 Website endpoint. Serves a bucket ANONYMOUSLY, choosing it from the
|
||||
# Host header: "<bucket><root_domain>", so nginx's /uploads/ fallback
|
||||
# Host header: "<bucket><root_domain>", so nginx's /uploads/ location
|
||||
# sends `Host: uploads.web.garage`. Only buckets that bootstrap.sh
|
||||
# opened with `garage bucket website --allow` are served.
|
||||
# 3903 Admin API, used by garage-webui and authenticated by admin_token.
|
||||
|
||||
Reference in New Issue
Block a user