Browse Source

fix(gui-v2): include host from NC_DB url

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3528/head
Pranav C 2 years ago
parent
commit
1163c4580a
  1. 7
      packages/nocodb/src/lib/utils/NcConfigFactory.ts

7
packages/nocodb/src/lib/utils/NcConfigFactory.ts

@ -317,7 +317,8 @@ export default class NcConfigFactory implements NcConfig {
client: url.protocol.replace(':', ''), client: url.protocol.replace(':', ''),
connection: { connection: {
...defaultConnectionConfig, ...defaultConnectionConfig,
...parsedQuery ...parsedQuery,
host: url.hostname
}, },
acquireConnectionTimeout: 600000, acquireConnectionTimeout: 600000,
...(url.searchParams.has('search_path') ...(url.searchParams.has('search_path')
@ -658,9 +659,9 @@ export default class NcConfigFactory implements NcConfig {
if (rtConfig) { if (rtConfig) {
const { driver, ...connectionConfig } = parsedConfig; const { driver, ...connectionConfig } = parsedConfig;
const client = driverClientMapping[driver] || driver; const client = driverClientMapping[driver] || driver;
const avoidSSL = ['localhost', '127.0.0.1', 'host.docker.internal', '172.17. 0.1'] const avoidSSL = ['localhost', '127.0.0.1', 'host.docker.internal', '172.17. 0.1']
if (client === 'pg' && !connectionConfig?.ssl && !avoidSSL.includes(connectionConfig.host)) { if (client === 'pg' && !connectionConfig?.ssl && !avoidSSL.includes(connectionConfig.host)) {

Loading…
Cancel
Save