Skip to content
Snippets Groups Projects
Commit 5589a8ec authored by Yannis Barlas's avatar Yannis Barlas
Browse files

feat(db-manager): add POSTGRES_ALLOW_SELF_SIGNED_CERTIFICATES env variable

parent 1d88a8c5
No related branches found
No related tags found
1 merge request!91Pg ssl
const config = require('config')
const { isEnvVariableTrue } = require('../utils/env')
const connection =
process.env.DATABASE_URL ||
(config['pubsweet-server'] && config['pubsweet-server'].db)
if (isEnvVariableTrue(process.env.POSTGRES_ALLOW_SELF_SIGNED_CERTIFICATES)) {
if (!connection.ssl) connection.ssl = {}
connection.ssl.rejectUnauthorized = false
}
module.exports = connection
const isEnvVariableTrue = variable => {
return variable === '1' || variable === 1 || variable === 'true'
}
module.exports = {
isEnvVariableTrue,
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment