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_PORT=5432
|
||||||
POSTGRES_HOST=localhost
|
POSTGRES_HOST=localhost
|
||||||
POSTGRES_USERNAME=automatish_development_user
|
POSTGRES_USERNAME=automatish_development_user
|
||||||
POSTGRESS_PASSWORD=
|
POSTGRES_PASSWORD=
|
||||||
|
POSTGRES_ENABLE_SSL=false
|
||||||
|
@@ -8,7 +8,7 @@ const knexConfig = {
|
|||||||
user: appConfig.postgresUsername,
|
user: appConfig.postgresUsername,
|
||||||
password: appConfig.postgresPassword,
|
password: appConfig.postgresPassword,
|
||||||
database: appConfig.postgresDatabase,
|
database: appConfig.postgresDatabase,
|
||||||
ssl: true,
|
ssl: appConfig.postgresEnableSsl
|
||||||
},
|
},
|
||||||
migrations: {
|
migrations: {
|
||||||
directory: __dirname + '/src/db/migrations',
|
directory: __dirname + '/src/db/migrations',
|
||||||
|
@@ -12,6 +12,7 @@ type AppConfig = {
|
|||||||
postgresHost: string,
|
postgresHost: string,
|
||||||
postgresUsername: string,
|
postgresUsername: string,
|
||||||
postgresPassword: string,
|
postgresPassword: string,
|
||||||
|
postgresEnableSsl: boolean,
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +26,8 @@ const appConfig: AppConfig = {
|
|||||||
postgresPort: parseInt(process.env.POSTGRES_PORT) || 5432,
|
postgresPort: parseInt(process.env.POSTGRES_PORT) || 5432,
|
||||||
postgresHost: process.env.POSTGRES_HOST || 'localhost',
|
postgresHost: process.env.POSTGRES_HOST || 'localhost',
|
||||||
postgresUsername: process.env.POSTGRES_USERNAME || 'automatish_development_user',
|
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}`;
|
const baseUrl = `${appConfig.protocol}://${appConfig.host}:${appConfig.port}`;
|
||||||
|
Reference in New Issue
Block a user