1646393163

This commit is contained in:
Amruth Pillai 2022-03-04 12:26:03 +01:00
parent e1529e03f9
commit 269d5206e6
No known key found for this signature in database
GPG Key ID: E3C57DF9B80855AD
4 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,7 @@ POSTGRES_PORT=5432
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=reactive_resume
CA_CERT=
POSTGRES_SSL_CERT=
# Auth
JWT_SECRET=change-me

View File

@ -25,6 +25,7 @@ const validationSchema = Joi.object({
POSTGRES_USERNAME: Joi.string().required(),
POSTGRES_PASSWORD: Joi.string().required(),
POSTGRES_DATABASE: Joi.string().required(),
POSTGRES_SSL_CERT: Joi.string().allow(''),
// Auth
JWT_SECRET: Joi.string().required(),

View File

@ -6,5 +6,5 @@ export default registerAs('postgres', () => ({
username: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
certificate: process.env.CA_CERT,
certificate: process.env.POSTGRES_SSL_CERT,
}));

View File

@ -17,9 +17,11 @@ import { User } from '@/users/entities/user.entity';
username: configService.get<string>('postgres.username'),
password: configService.get<string>('postgres.password'),
database: configService.get<string>('postgres.database'),
ssl: { ca: configService.get<string>('postgres.certtificate') },
synchronize: true,
entities: [User, Resume],
ssl: {
ca: configService.get<string>('postgres.certificate'),
},
}),
}),
],