mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
+12
-3
@@ -6,7 +6,14 @@
|
||||
// deleteFile(key)
|
||||
//
|
||||
// Required .env vars:
|
||||
// S3_ENDPOINT – http://127.0.0.1:3900 (internal — always used for uploads/deletes)
|
||||
// S3_ENDPOINT – address this backend uses for uploads/deletes.
|
||||
// http://127.0.0.1:3900 when co-located with Garage.
|
||||
// Otherwise (backend runs on a different machine than
|
||||
// Garage) point this at a network-reachable address that
|
||||
// terminates on Garage — e.g. the same tunneled domain as
|
||||
// S3_PUBLIC_URL, since garage-anon-proxy re-signs any
|
||||
// non-presigned request with real credentials before
|
||||
// forwarding. Never leave this blank.
|
||||
// S3_REGION – garage
|
||||
// S3_ACCESS_KEY
|
||||
// S3_SECRET_KEY
|
||||
@@ -28,8 +35,10 @@ const credentials = {
|
||||
};
|
||||
|
||||
// Internal client — uploads, deletes, direct streams from the server itself.
|
||||
// Always targets S3_ENDPOINT: these calls originate from this machine, so the
|
||||
// internal address is the correct (and only) one to use.
|
||||
// Always targets S3_ENDPOINT. When this backend is co-located with Garage,
|
||||
// that's a local address; when it isn't, S3_ENDPOINT must instead be a
|
||||
// network-reachable address that reaches Garage (e.g. the tunneled proxy
|
||||
// domain) — see the .env docs above. Do not assume co-location here.
|
||||
const s3 = new S3Client({
|
||||
endpoint: process.env.S3_ENDPOINT,
|
||||
region: process.env.S3_REGION || "garage",
|
||||
|
||||
Reference in New Issue
Block a user