mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-18 18:51:32 +10:00
feat(s3): implement non-ephemeral storage through S3/DO Spaces
This commit is contained in:
@ -7,6 +7,7 @@ import authConfig from './auth.config';
|
||||
import databaseConfig from './database.config';
|
||||
import googleConfig from './google.config';
|
||||
import sendgridConfig from './sendgrid.config';
|
||||
import storageConfig from './storage.config';
|
||||
|
||||
const validationSchema = Joi.object({
|
||||
// App
|
||||
@ -40,12 +41,20 @@ const validationSchema = Joi.object({
|
||||
SENDGRID_FORGOT_PASSWORD_TEMPLATE_ID: Joi.string().allow(''),
|
||||
SENDGRID_FROM_NAME: Joi.string().allow(''),
|
||||
SENDGRID_FROM_EMAIL: Joi.string().allow(''),
|
||||
|
||||
// Storage
|
||||
STORAGE_BUCKET: Joi.string().allow(''),
|
||||
STORAGE_REGION: Joi.string().allow(''),
|
||||
STORAGE_ENDPOINT: Joi.string().allow(''),
|
||||
STORAGE_URL_PREFIX: Joi.string().allow(''),
|
||||
STORAGE_ACCESS_KEY: Joi.string().allow(''),
|
||||
STORAGE_SECRET_KEY: Joi.string().allow(''),
|
||||
});
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
NestConfigModule.forRoot({
|
||||
load: [appConfig, authConfig, databaseConfig, googleConfig, sendgridConfig],
|
||||
load: [appConfig, authConfig, databaseConfig, googleConfig, sendgridConfig, storageConfig],
|
||||
validationSchema: validationSchema,
|
||||
}),
|
||||
],
|
||||
|
||||
10
server/src/config/storage.config.ts
Normal file
10
server/src/config/storage.config.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { registerAs } from '@nestjs/config';
|
||||
|
||||
export default registerAs('storage', () => ({
|
||||
bucket: process.env.STORAGE_BUCKET,
|
||||
region: process.env.STORAGE_REGION,
|
||||
endpoint: process.env.STORAGE_ENDPOINT,
|
||||
urlPrefix: process.env.STORAGE_URL_PREFIX,
|
||||
accessKey: process.env.STORAGE_ACCESS_KEY,
|
||||
secretKey: process.env.STORAGE_SECRET_KEY,
|
||||
}));
|
||||
Reference in New Issue
Block a user