Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Postgres DB connection to enable SSL #2500

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/install/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Option | Description
`db.database`| Database name on Postgres Server. Default: `flowforge`.
`db.user` | Username used when connecting to Postgres Server.
`db.password`| Password used when connecting to Postgres Server.
`db.ssl` | Client should connect with SSL/TLS. Default: `false`

## Node-RED Driver configuration

Expand Down
5 changes: 5 additions & 0 deletions forge/db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ module.exports = fp(async function (app, _opts, next) {
dbOptions.username = app.config.db.user
dbOptions.password = /* app.secrets.dbPassword || */ app.config.db.password
dbOptions.database = app.config.db.database || 'flowforge'
if (app.config.db.ssl) {
dbOptions.dialectOptions = {
ssl: true
}
}
}

dbOptions.logging = !!app.config.db.logging
Expand Down