diff --git a/app/app.js b/app/app.js index 379be79..69b6be3 100644 --- a/app/app.js +++ b/app/app.js @@ -45,36 +45,45 @@ if (!config.noLDAP) { } } - - -var dbpool = new Pool({ +let dbpoolOpts = { database: config.database.name, user: config.database.user, password: config.database.pass, host: config.database.host, port: config.database.port, - ssl: { rejectUnauthorized: false }, max: 20, // set pool max size to 20 min: 4, // set min pool size to 4 idleTimeoutMillis: config.database.idleTimeoutMillis, // close idle clients after 1 second connectionTimeoutMillis: config.database.connectionTimeoutMillis, // return an error after 1 second if connection could not be established -}) +} + +if (!config.disableDBtls) { + dbpoolOpts['ssl'] = { rejectUnauthorized: false }; +} + +var dbpool = new Pool(dbpoolOpts); + + +let projectPoolOpts = { + database: config.vncproject.name, + user: config.vncproject.user, + password: config.vncproject.pass, + host: config.vncproject.host, + port: config.vncproject.port, + max: 20, // set pool max size to 20 + min: 4, // set min pool size to 4 + idleTimeoutMillis: config.database.idleTimeoutMillis, // close idle clients after 1 second + connectionTimeoutMillis: config.database.connectionTimeoutMillis, // return an error after 1 second if connection could not be established +} + +if (!config.disableDBtls) { + projectPoolOpts['ssl'] = { rejectUnauthorized: false }; +} var projectPool; if (config.vncproject) { - projectPool = new Pool({ - database: config.vncproject.name, - user: config.vncproject.user, - password: config.vncproject.pass, - host: config.vncproject.host, - port: config.vncproject.port, - ssl: { rejectUnauthorized: false }, - max: 20, // set pool max size to 20 - min: 4, // set min pool size to 4 - idleTimeoutMillis: config.database.idleTimeoutMillis, // close idle clients after 1 second - connectionTimeoutMillis: config.database.connectionTimeoutMillis, // return an error after 1 second if connection could not be established - }) + projectPool = new Pool(projectPoolOpts); } app.use(bodyParser.json()); // for parsing application/json diff --git a/config/vnc-hybrid-authenticator.js b/config/vnc-hybrid-authenticator.js index bfde2a6..522e0d2 100644 --- a/config/vnc-hybrid-authenticator.js +++ b/config/vnc-hybrid-authenticator.js @@ -4,6 +4,7 @@ module.exports = { domain: 'dev.vnc.de', xmppToken: 'xah6niighohshieKahtah', useRedmineAuth: true, + disableDBtls: false, ldap: { ldapUri: 'none', bindDn: 'uid=zimbra,cn=admins,cn=zimbra',