feat(web): public read-only file browser — GET API public, writes require admin

- /api/v1/* GET (list buckets/objects, download) no longer requires auth
- POST/DELETE/PUT stay behind requireAuth (upload, create/delete bucket, copy, delete object)
- FE drops blocking login screen: visitors browse + download freely
- Admin-only UI (create bucket, upload dropzone, delete, S3 creds) hidden in read-only mode
- Login button in topbar to unlock admin actions
This commit is contained in:
asepharyana
2026-08-01 20:31:40 +07:00
parent 864d41d8fc
commit 91ec588a88
4 changed files with 161 additions and 53 deletions
+58 -26
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -109,8 +109,11 @@ export const routes = {
'/api/v1/auth/me': {
GET: handleMe,
},
// Read endpoints (GET) are public — anyone can list buckets/objects and
// download files. Write endpoints (POST/DELETE/PUT) require admin auth so
// visitors cannot upload, edit, copy, or delete.
'/api/v1/*': {
GET: requireAuth(handleWebApiV1),
GET: handleWebApiV1,
POST: requireAuth(handleWebApiV1),
DELETE: requireAuth(handleWebApiV1),
PUT: requireAuth(handleWebApiV1),