diff --git a/public/src/modules/helpers.common.js b/public/src/modules/helpers.common.js index aa1825adda..b9c46fa3cc 100644 --- a/public/src/modules/helpers.common.js +++ b/public/src/modules/helpers.common.js @@ -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 '\n\t'; + return '\n\t'; } function stringify(obj) { diff --git a/src/database/postgres/connection.js b/src/database/postgres/connection.js index 19d796d7ed..c49e7caac4 100644 --- a/src/database/postgres/connection.js +++ b/src/database/postgres/connection.js @@ -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 || {}); }; diff --git a/src/database/redis/connection.js b/src/database/redis/connection.js index 7f0b1912f8..41a9243355 100644 --- a/src/database/redis/connection.js +++ b/src/database/redis/connection.js @@ -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) {