Add S3 KEY_PREFIX support

This commit is contained in:
zkldi
2021-11-13 20:36:36 +00:00
parent d83343802d
commit 94023d395f
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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,
})
);
+2
View File
@@ -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",
}
),
},