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:
+2
-2
@@ -25,8 +25,8 @@
|
||||
# with the same credentials and the backend needs no change.
|
||||
# 4. Grants that key read+write on the bucket. garage-webui also browses
|
||||
# with it: it borrows the first key that has access to a bucket.
|
||||
# 5. Opens the bucket on the website endpoint, which is what nginx's
|
||||
# /uploads/ fallback reads from, anonymously.
|
||||
# 5. Opens the bucket on the website endpoint, which is what nginx serves
|
||||
# /uploads/ from, anonymously.
|
||||
#
|
||||
# ENV / .env
|
||||
# S3_ACCESS_KEY_ID required; "GK" + 24 hex chars
|
||||
|
||||
Reference in New Issue
Block a user