1
0
Fork 0
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:
nilsorbat 2023-02-28 08:47:16 +01:00
parent 5b47c7cef6
commit 136ba2f48f
No known key found for this signature in database
GPG key ID: 0F9E4305534A2380
2 changed files with 14 additions and 3 deletions

View file

@ -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

View file

@ -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',