mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-08 06:48:04 +03:00
Add S3 KEY_PREFIX support
This commit is contained in:
@@ -35,7 +35,7 @@ export function PushToS3(path: string, content: Buffer | string) {
|
||||
return s3.send(
|
||||
new PutObjectCommand({
|
||||
Bucket: ServerConfig.CDN_CONFIG.SAVE_LOCATION.BUCKET,
|
||||
Key: path,
|
||||
Key: (ServerConfig.CDN_CONFIG.SAVE_LOCATION.KEY_PREFIX ?? "") + path,
|
||||
Body: content,
|
||||
})
|
||||
);
|
||||
|
||||
@@ -108,6 +108,7 @@ export interface TachiServerConfig {
|
||||
ACCESS_KEY: string;
|
||||
SECRET_ACCESS_KEY: string;
|
||||
BUCKET: string;
|
||||
KEY_PREFIX?: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -184,6 +185,7 @@ const err = p(config, {
|
||||
ACCESS_KEY: "string",
|
||||
SECRET_ACCESS_KEY: "string",
|
||||
BUCKET: "string",
|
||||
KEY_PREFIX: "*string",
|
||||
}
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user