mirror of
https://github.com/plankanban/planka.git
synced 2025-08-09 07:25:24 +02:00
fix: allow non SSL connections to be handled gracefully
This commit is contained in:
parent
5b47c7cef6
commit
136ba2f48f
2 changed files with 14 additions and 3 deletions
|
@ -14,6 +14,9 @@ SECRET_KEY=notsecretkey
|
||||||
# have to use environment variables in order to pass the desired values, e.g.
|
# have to use environment variables in order to pass the desired values, e.g.
|
||||||
# PGSSLMODE=<value>
|
# PGSSLMODE=<value>
|
||||||
|
|
||||||
|
# Configure knex to accept SSL Certificates
|
||||||
|
# REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
|
||||||
|
|
||||||
## Do not edit this
|
## Do not edit this
|
||||||
|
|
||||||
TZ=UTC
|
TZ=UTC
|
||||||
|
|
|
@ -6,13 +6,21 @@ dotenv.config({
|
||||||
path: path.resolve(__dirname, '../.env'),
|
path: path.resolve(__dirname, '../.env'),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function buildSSLConfig() {
|
||||||
|
if (process.env.REJECT_UNAUTHORIZED_SSL_CERTIFICATE) {
|
||||||
|
return {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
client: 'pg',
|
client: 'pg',
|
||||||
connection: {
|
connection: {
|
||||||
connectionString: process.env.DATABASE_URL,
|
connectionString: process.env.DATABASE_URL,
|
||||||
ssl: {
|
ssl: buildSSLConfig(),
|
||||||
rejectUnauthorized: false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
migrations: {
|
migrations: {
|
||||||
tableName: 'migration',
|
tableName: 'migration',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue