add option to pass CA certificate for database deploys

This commit is contained in:
Amruth Pillai 2022-03-04 11:50:10 +01:00
parent 5104ea6438
commit e1529e03f9
No known key found for this signature in database
GPG Key ID: E3C57DF9B80855AD
3 changed files with 3 additions and 0 deletions

View File

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

View File

@ -6,4 +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,
}));

View File

@ -17,6 +17,7 @@ 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],
}),