mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
Added Postgres SSL Support (#7887)
* [Added] Postgres SSL Support * [Added]Postgres SSL Support * [Added] Postgres SSL Support
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
2d24153933
commit
9b4ae4c04a
@@ -83,6 +83,7 @@ function saveDatabaseConfig(config, databaseConfig, callback) {
|
|||||||
username: databaseConfig['postgres:username'],
|
username: databaseConfig['postgres:username'],
|
||||||
password: databaseConfig['postgres:password'],
|
password: databaseConfig['postgres:password'],
|
||||||
database: databaseConfig['postgres:database'],
|
database: databaseConfig['postgres:database'],
|
||||||
|
ssl: databaseConfig['postgres:ssl'],
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return callback(new Error('unknown database : ' + config.database));
|
return callback(new Error('unknown database : ' + config.database));
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ postgresModule.questions = [
|
|||||||
description: 'PostgreSQL database name',
|
description: 'PostgreSQL database name',
|
||||||
default: nconf.get('postgres:database') || 'nodebb',
|
default: nconf.get('postgres:database') || 'nodebb',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'postgres:ssl',
|
||||||
|
description: 'Enable SSL for PostgreSQL database access',
|
||||||
|
default: nconf.get('postgres:ssl') || false,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
postgresModule.init = function (callback) {
|
postgresModule.init = function (callback) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ connection.getConnectionOptions = function (postgres) {
|
|||||||
user: postgres.username,
|
user: postgres.username,
|
||||||
password: postgres.password,
|
password: postgres.password,
|
||||||
database: postgres.database,
|
database: postgres.database,
|
||||||
|
ssl: postgres.ssl,
|
||||||
};
|
};
|
||||||
|
|
||||||
return _.merge(connOptions, postgres.options || {});
|
return _.merge(connOptions, postgres.options || {});
|
||||||
|
|||||||
Reference in New Issue
Block a user