chore: Add env variable to toggle postgresql ssl flag
This commit is contained in:
@@ -7,4 +7,5 @@ POSTGRES_DATABASE=automatisch_development
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_HOST=localhost
|
||||
POSTGRES_USERNAME=automatish_development_user
|
||||
POSTGRESS_PASSWORD=
|
||||
POSTGRES_PASSWORD=
|
||||
POSTGRES_ENABLE_SSL=false
|
||||
|
@@ -8,7 +8,7 @@ const knexConfig = {
|
||||
user: appConfig.postgresUsername,
|
||||
password: appConfig.postgresPassword,
|
||||
database: appConfig.postgresDatabase,
|
||||
ssl: true,
|
||||
ssl: appConfig.postgresEnableSsl
|
||||
},
|
||||
migrations: {
|
||||
directory: __dirname + '/src/db/migrations',
|
||||
|
@@ -12,6 +12,7 @@ type AppConfig = {
|
||||
postgresHost: string,
|
||||
postgresUsername: string,
|
||||
postgresPassword: string,
|
||||
postgresEnableSsl: boolean,
|
||||
baseUrl?: string
|
||||
}
|
||||
|
||||
@@ -25,7 +26,8 @@ const appConfig: AppConfig = {
|
||||
postgresPort: parseInt(process.env.POSTGRES_PORT) || 5432,
|
||||
postgresHost: process.env.POSTGRES_HOST || 'localhost',
|
||||
postgresUsername: process.env.POSTGRES_USERNAME || 'automatish_development_user',
|
||||
postgresPassword: process.env.POSTGRESS_PASSWORD,
|
||||
postgresPassword: process.env.POSTGRES_PASSWORD,
|
||||
postgresEnableSsl: process.env.POSTGRES_ENABLE_SSL === 'true' ? true : false,
|
||||
}
|
||||
|
||||
const baseUrl = `${appConfig.protocol}://${appConfig.host}:${appConfig.port}`;
|
||||
|
Reference in New Issue
Block a user