Skip to content

Commit

Permalink
sslconfig needs to look only one level up instead of two for certs af…
Browse files Browse the repository at this point in the history
…ter service folder restructuring (#1171)

* sslconfig needs to look only one level up instead of two for certs after service folder restructuring

* write error details to log when dependency setup fails
  • Loading branch information
cd-rite authored Jan 5, 2024
1 parent fbf6a96 commit 44f8f57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ async function startServer(app) {
;[authReturn, isNewDb] = await Promise.all([auth.initializeAuth(), db.initializeDatabase()])
}
catch (e) {
logger.writeError('index', 'shutdown', {message:'Failed to setup dependencies'});
logger.writeError('index', 'shutdown', {message:'Failed to setup dependencies', error: serializeError(e)});
process.exit(1);
}

Expand Down
6 changes: 3 additions & 3 deletions api/source/service/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ function getPoolConfig() {
if (config.database.tls.ca_file || config.database.tls.cert_file || config.database.tls.key_file) {
const sslConfig = {}
if (config.database.tls.ca_file) {
sslConfig.ca = fs.readFileSync(path.join(__dirname, '..', '..', 'tls', config.database.tls.ca_file))
sslConfig.ca = fs.readFileSync(path.join(__dirname, '..', 'tls', config.database.tls.ca_file))
}
if (config.database.tls.cert_file) {
sslConfig.cert = fs.readFileSync(path.join(__dirname, '..', '..', 'tls', config.database.tls.cert_file))
sslConfig.cert = fs.readFileSync(path.join(__dirname, '..', 'tls', config.database.tls.cert_file))
}
if (config.database.tls.key_file) {
sslConfig.key = fs.readFileSync(path.join(__dirname, '..', '..', 'tls', config.database.tls.key_file))
sslConfig.key = fs.readFileSync(path.join(__dirname, '..', 'tls', config.database.tls.key_file))
}
poolConfig.ssl = sslConfig
}
Expand Down

0 comments on commit 44f8f57

Please sign in to comment.