mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 21:23:59 +00:00
fixed npm dist subprocess problem
This commit is contained in:
@@ -3,8 +3,9 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
dbgate:
|
dbgate:
|
||||||
build: docker
|
# build: docker
|
||||||
# image: dbgate/dbgate:beta-alpine
|
# image: dbgate/dbgate:beta-alpine
|
||||||
|
image: dbgate/dbgate:alpine
|
||||||
# image: dbgate/dbgate:beta
|
# image: dbgate/dbgate:beta
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -15,8 +16,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- dbgate-data:/root/dbgate-data
|
- dbgate-data:/root/dbgate-data
|
||||||
|
|
||||||
environment:
|
# environment:
|
||||||
WEB_ROOT: /dbgate
|
# WEB_ROOT: /dbgate
|
||||||
|
|
||||||
# CONNECTIONS: mssql
|
# CONNECTIONS: mssql
|
||||||
# LABEL_mssql: MS Sql
|
# LABEL_mssql: MS Sql
|
||||||
@@ -25,11 +26,11 @@ services:
|
|||||||
# PORT_mssql: 1433
|
# PORT_mssql: 1433
|
||||||
# PASSWORD_mssql: Pwd2020Db
|
# PASSWORD_mssql: Pwd2020Db
|
||||||
# ENGINE_mssql: mssql@dbgate-plugin-mssql
|
# ENGINE_mssql: mssql@dbgate-plugin-mssql
|
||||||
proxy:
|
# proxy:
|
||||||
# image: nginx
|
# # image: nginx
|
||||||
build: test/nginx
|
# build: test/nginx
|
||||||
ports:
|
# ports:
|
||||||
- 8082:80
|
# - 8082:80
|
||||||
|
|
||||||
# volumes:
|
# volumes:
|
||||||
# - /home/jena/test/chinook:/mnt/sqt
|
# - /home/jena/test/chinook:/mnt/sqt
|
||||||
|
|||||||
@@ -47,7 +47,8 @@
|
|||||||
"ts:api": "yarn workspace dbgate-api ts",
|
"ts:api": "yarn workspace dbgate-api ts",
|
||||||
"ts:web": "yarn workspace dbgate-web ts",
|
"ts:web": "yarn workspace dbgate-web ts",
|
||||||
"ts": "yarn ts:api && yarn ts:web",
|
"ts": "yarn ts:api && yarn ts:web",
|
||||||
"postinstall": "yarn resetPackagedPlugins && yarn build:lib && patch-package && yarn fillNativeModules && yarn build:plugins:frontend"
|
"postinstall": "yarn resetPackagedPlugins && yarn build:lib && patch-package && yarn fillNativeModules && yarn build:plugins:frontend",
|
||||||
|
"dbgate-serve": "node packages/dbgate/bin/dbgate-serve.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"concurrently": "^5.1.0",
|
"concurrently": "^5.1.0",
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ module.exports = {
|
|||||||
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
DBGATE_API: global['API_PACKAGE'] || global['dbgateApiModulePath'] || process.argv[1],
|
DBGATE_API: global['API_PACKAGE'] || process.argv[1],
|
||||||
..._.fromPairs(pluginNames.map(name => [`PLUGIN_${_.camelCase(name)}`, getPluginBackendPath(name)])),
|
..._.fromPairs(pluginNames.map(name => [`PLUGIN_${_.camelCase(name)}`, getPluginBackendPath(name)])),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if (processArgs.startProcess) {
|
|||||||
const proc = require('./proc');
|
const proc = require('./proc');
|
||||||
const module = proc[processArgs.startProcess];
|
const module = proc[processArgs.startProcess];
|
||||||
module.start();
|
module.start();
|
||||||
} else if (!processArgs.checkParent && !global['API_PACKAGE'] && !global['dbgateApiModulePath']) {
|
} else if (!processArgs.checkParent && !global['API_PACKAGE']) {
|
||||||
const main = require('./main');
|
const main = require('./main');
|
||||||
|
|
||||||
main.start();
|
main.start();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ function packagedPluginsDir() {
|
|||||||
}
|
}
|
||||||
if (platformInfo.isNpmDist) {
|
if (platformInfo.isNpmDist) {
|
||||||
// node_modules
|
// node_modules
|
||||||
return global['dbgateApiPackagedPluginsPath'];
|
return global['PLUGINS_DIR'];
|
||||||
}
|
}
|
||||||
if (platformInfo.isElectronBundle) {
|
if (platformInfo.isElectronBundle) {
|
||||||
return path.resolve(__dirname, '../../plugins');
|
return path.resolve(__dirname, '../../plugins');
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const isMac = platform === 'darwin';
|
|||||||
const isLinux = platform === 'linux';
|
const isLinux = platform === 'linux';
|
||||||
const isDocker = fs.existsSync('/home/dbgate-docker/public');
|
const isDocker = fs.existsSync('/home/dbgate-docker/public');
|
||||||
const isDevMode = process.env.DEVMODE == '1';
|
const isDevMode = process.env.DEVMODE == '1';
|
||||||
const isNpmDist = !!global['dbgateApiModulePath'];
|
const isNpmDist = !!global['IS_NPM_DIST'];
|
||||||
const isForkedApi = processArgs.isForkedApi;
|
const isForkedApi = processArgs.isForkedApi;
|
||||||
|
|
||||||
// function moduleAvailable(name) {
|
// function moduleAvailable(name) {
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
global.dbgateApiModulePath = path.dirname(path.dirname(require.resolve('dbgate-api')));
|
global.API_PACKAGE = path.dirname(path.dirname(require.resolve('dbgate-api')));
|
||||||
global.dbgateApiPackagedPluginsPath = path.dirname(global.dbgateApiModulePath);
|
global.PLUGINS_DIR = path.dirname(global.API_PACKAGE);
|
||||||
|
global.IS_NPM_DIST = true;
|
||||||
|
|
||||||
const dbgateApi = require('dbgate-api');
|
const dbgateApi = require('dbgate-api');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user