mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-16 19:47:34 +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) {
|
function buildLinkTag(tag) {
|
||||||
const attributes = ['link', 'rel', 'as', 'type', 'href', 'sizes', 'title', 'crossorigin'];
|
const attributes = [
|
||||||
const [link, rel, as, type, href, sizes, title, crossorigin] = attributes.map(attr => (tag[attr] ? `${attr}="${tag[attr]}" ` : ''));
|
'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) {
|
function stringify(obj) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
const winston = require('winston');
|
const winston = require('winston');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
@@ -32,6 +33,18 @@ connection.getConnectionOptions = function (postgres) {
|
|||||||
connectionTimeoutMillis: 90000,
|
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 || {});
|
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 }));
|
const sentinelRootNodes = options.sentinels.map(sentinel => ({ host: sentinel.host, port: sentinel.port }));
|
||||||
cxn = createSentinel({
|
cxn = createSentinel({
|
||||||
...options.options,
|
...options.options,
|
||||||
name: 'sentinel-db',
|
|
||||||
sentinelRootNodes,
|
sentinelRootNodes,
|
||||||
});
|
});
|
||||||
} else if (redis_socket_or_host && String(redis_socket_or_host).indexOf('/') >= 0) {
|
} else if (redis_socket_or_host && String(redis_socket_or_host).indexOf('/') >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user