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.
|
||||
# PGSSLMODE=<value>
|
||||
|
||||
# Configure knex to accept SSL Certificates
|
||||
# REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
|
||||
|
||||
## Do not edit this
|
||||
|
||||
TZ=UTC
|
||||
|
|
|
@ -6,13 +6,21 @@ dotenv.config({
|
|||
path: path.resolve(__dirname, '../.env'),
|
||||
});
|
||||
|
||||
function buildSSLConfig() {
|
||||
if (process.env.REJECT_UNAUTHORIZED_SSL_CERTIFICATE) {
|
||||
return {
|
||||
rejectUnauthorized: false,
|
||||
};
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
client: 'pg',
|
||||
connection: {
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
ssl: buildSSLConfig(),
|
||||
},
|
||||
migrations: {
|
||||
tableName: 'migration',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue