MediaConfig: Change s3 config

remove region as this is specified by endPoint now
add bucket in schema and actual assignment

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-02-23 16:13:33 +01:00
parent 942360ea22
commit cf6c08e3d6

View file

@ -18,7 +18,6 @@ export interface MediaConfig {
s3: { s3: {
accessKeyId: string; accessKeyId: string;
secretAccessKey: string; secretAccessKey: string;
region: string;
bucket: string; bucket: string;
endPoint: string; endPoint: string;
}; };
@ -49,9 +48,8 @@ const mediaSchema = Joi.object({
then: Joi.object({ then: Joi.object({
accessKey: Joi.string().label('HD_MEDIA_BACKEND_S3_ACCESS_KEY'), accessKey: Joi.string().label('HD_MEDIA_BACKEND_S3_ACCESS_KEY'),
secretKey: Joi.string().label('HD_MEDIA_BACKEND_S3_SECRET_KEY'), secretKey: Joi.string().label('HD_MEDIA_BACKEND_S3_SECRET_KEY'),
bucket: Joi.string().label('HD_MEDIA_BACKEND_S3_BUCKET'),
endPoint: Joi.string().label('HD_MEDIA_BACKEND_S3_ENDPOINT'), endPoint: Joi.string().label('HD_MEDIA_BACKEND_S3_ENDPOINT'),
secure: Joi.boolean().label('HD_MEDIA_BACKEND_S3_SECURE'),
port: Joi.number().label('HD_MEDIA_BACKEND_S3_PORT'),
}), }),
otherwise: Joi.optional(), otherwise: Joi.optional(),
}), }),
@ -86,9 +84,8 @@ export default registerAs('mediaConfig', () => {
s3: { s3: {
accessKey: process.env.HD_MEDIA_BACKEND_S3_ACCESS_KEY, accessKey: process.env.HD_MEDIA_BACKEND_S3_ACCESS_KEY,
secretKey: process.env.HD_MEDIA_BACKEND_S3_SECRET_KEY, secretKey: process.env.HD_MEDIA_BACKEND_S3_SECRET_KEY,
bucket: process.env.HD_MEDIA_BACKEND_S3_BUCKET,
endPoint: process.env.HD_MEDIA_BACKEND_S3_ENDPOINT, endPoint: process.env.HD_MEDIA_BACKEND_S3_ENDPOINT,
secure: process.env.HD_MEDIA_BACKEND_S3_SECURE,
port: parseInt(process.env.HD_MEDIA_BACKEND_S3_PORT) || undefined,
}, },
azure: { azure: {
connectionString: connectionString: