mirror of
https://github.com/dbgate/dbgate
synced 2024-11-21 23:39:46 +00:00
dbconfig support in env variables
This commit is contained in:
parent
728a2c6a9f
commit
c135a068a2
2
packages/api/env/singledb/.env
vendored
2
packages/api/env/singledb/.env
vendored
@ -8,6 +8,8 @@ USER_mysql=root
|
||||
PASSWORD_mysql=test
|
||||
PORT_mysql=3307
|
||||
ENGINE_mysql=mysql@dbgate-plugin-mysql
|
||||
DBCONFIG_mysql=[{"name":"Chinook","connectionColor":"cyan"}]
|
||||
|
||||
|
||||
SINGLE_CONNECTION=mysql
|
||||
SINGLE_DATABASE=Chinook
|
||||
|
@ -11,6 +11,7 @@ const { pickSafeConnectionInfo } = require('../utility/crypting');
|
||||
const JsonLinesDatabase = require('../utility/JsonLinesDatabase');
|
||||
|
||||
const processArgs = require('../utility/processArgs');
|
||||
const { safeJsonParse } = require('dbgate-tools');
|
||||
|
||||
function getNamedArgs() {
|
||||
const res = {};
|
||||
@ -56,6 +57,7 @@ function getPortalCollections() {
|
||||
singleDatabase: !!process.env[`DATABASE_${id}`] || !!process.env[`FILE_${id}`],
|
||||
displayName: process.env[`LABEL_${id}`],
|
||||
isReadOnly: process.env[`READONLY_${id}`],
|
||||
databases: process.env[`DBCONFIG_${id}`] ? safeJsonParse(process.env[`DBCONFIG_${id}`]) : null,
|
||||
|
||||
// SSH tunnel
|
||||
useSshTunnel: process.env[`USE_SSH_${id}`],
|
||||
|
Loading…
Reference in New Issue
Block a user