mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-16 11:37:37 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -77,10 +77,12 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
}
|
||||
|
||||
function buildLinkTag(tag) {
|
||||
const attributes = ['link', 'rel', 'as', 'type', 'href', 'sizes', 'title', 'crossorigin'];
|
||||
const [link, rel, as, type, href, sizes, title, crossorigin] = attributes.map(attr => (tag[attr] ? `${attr}="${tag[attr]}" ` : ''));
|
||||
const attributes = [
|
||||
'link', 'rel', 'as', 'type', 'href', 'hreflang', 'sizes', 'title', 'crossorigin'
|
||||
];
|
||||
const [link, rel, as, type, href, hreflang, sizes, title, crossorigin] = attributes.map(attr => (tag[attr] ? `${attr}="${tag[attr]}" ` : ''));
|
||||
|
||||
return '<link ' + link + rel + as + type + sizes + title + href + crossorigin + '/>\n\t';
|
||||
return '<link ' + link + rel + as + type + sizes + title + href + hreflang + crossorigin + '/>\n\t';
|
||||
}
|
||||
|
||||
function stringify(obj) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const nconf = require('nconf');
|
||||
const winston = require('winston');
|
||||
const _ = require('lodash');
|
||||
@@ -32,6 +33,18 @@ connection.getConnectionOptions = function (postgres) {
|
||||
connectionTimeoutMillis: 90000,
|
||||
};
|
||||
|
||||
if (typeof postgres.ssl === 'object' && !Array.isArray(postgres.ssl) && postgres.ssl !== null) {
|
||||
const { ssl } = postgres;
|
||||
connOptions.ssl = {
|
||||
rejectUnauthorized: ssl.rejectUnauthorized,
|
||||
};
|
||||
['ca', 'key', 'cert'].forEach((prop) => {
|
||||
if (ssl.hasOwnProperty(prop)) {
|
||||
connOptions.ssl[prop] = fs.readFileSync(ssl[prop]).toString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return _.merge(connOptions, postgres.options || {});
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ connection.connect = async function (options) {
|
||||
const sentinelRootNodes = options.sentinels.map(sentinel => ({ host: sentinel.host, port: sentinel.port }));
|
||||
cxn = createSentinel({
|
||||
...options.options,
|
||||
name: 'sentinel-db',
|
||||
sentinelRootNodes,
|
||||
});
|
||||
} else if (redis_socket_or_host && String(redis_socket_or_host).indexOf('/') >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user