dbgate-api 4.7.4-alpha.12 → 4.7.4-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -4,11 +4,12 @@ DEVMODE=1
4
4
  # HIDE_APP_EDITOR=1
5
5
 
6
6
 
7
- DEVWEB=1
8
- LOGINS=admin,test
7
+ # DEVWEB=1
8
+ # LOGINS=admin,test
9
9
 
10
- LOGIN_PASSWORD_admin=admin
11
- LOGIN_PERMISSIONS_admin=*
10
+ # LOGIN_PASSWORD_admin=admin
11
+ # LOGIN_PERMISSIONS_admin=*
12
12
 
13
- LOGIN_PASSWORD_test=test
14
- LOGIN_PERMISSIONS_test=~*, widgets/database
13
+ # LOGIN_PASSWORD_test=test
14
+ # LOGIN_PERMISSIONS_test=~*, widgets/database
15
+ # WORKSPACE_DIR=/home/jena/dbgate-data-2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-api",
3
3
  "main": "src/index.js",
4
- "version": "4.7.4-alpha.12",
4
+ "version": "4.7.4-alpha.16",
5
5
  "homepage": "https://dbgate.org/",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,9 +25,9 @@
25
25
  "compare-versions": "^3.6.0",
26
26
  "cors": "^2.8.5",
27
27
  "cross-env": "^6.0.3",
28
- "dbgate-query-splitter": "^4.7.4-alpha.12",
29
- "dbgate-sqltree": "^4.7.4-alpha.12",
30
- "dbgate-tools": "^4.7.4-alpha.12",
28
+ "dbgate-query-splitter": "^4.7.4-alpha.16",
29
+ "dbgate-sqltree": "^4.7.4-alpha.16",
30
+ "dbgate-tools": "^4.7.4-alpha.16",
31
31
  "diff": "^5.0.0",
32
32
  "diff2html": "^3.4.13",
33
33
  "eslint": "^6.8.0",
@@ -63,7 +63,7 @@
63
63
  "devDependencies": {
64
64
  "@types/fs-extra": "^9.0.11",
65
65
  "@types/lodash": "^4.14.149",
66
- "dbgate-types": "^4.7.4-alpha.12",
66
+ "dbgate-types": "^4.7.4-alpha.16",
67
67
  "env-cmd": "^10.1.0",
68
68
  "node-loader": "^1.0.2",
69
69
  "nodemon": "^2.0.2",
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '4.7.4-alpha.12',
4
- buildTime: '2022-03-24T08:15:55.138Z'
3
+ version: '4.7.4-alpha.16',
4
+ buildTime: '2022-03-24T18:01:13.346Z'
5
5
  };
package/src/main.js CHANGED
@@ -88,7 +88,7 @@ function start() {
88
88
  app.use(getExpressPath('/'), express.static('/home/dbgate-docker/public'));
89
89
 
90
90
  const port = process.env.PORT || 3000;
91
- console.log('DbGate API listening on port', port);
91
+ console.log('DbGate API listening on port (docker build)', port);
92
92
  server.listen(port);
93
93
  } else if (platformInfo.isNpmDist) {
94
94
  app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../dbgate-web/public')));
@@ -99,7 +99,7 @@ function start() {
99
99
  ),
100
100
  }).then(port => {
101
101
  server.listen(port, () => {
102
- console.log(`DbGate API listening on port ${port}`);
102
+ console.log(`DbGate API listening on port ${port} (NPM build)`);
103
103
  });
104
104
  });
105
105
  } else if (process.env.DEVWEB) {
@@ -108,7 +108,7 @@ function start() {
108
108
  app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../web/public')));
109
109
 
110
110
  const port = process.env.PORT || 3000;
111
- console.log('DbGate API & web listening on port', port);
111
+ console.log('DbGate API & web listening on port (dev web build)', port);
112
112
  server.listen(port);
113
113
  } else {
114
114
  app.get(getExpressPath('/'), (req, res) => {
@@ -116,7 +116,7 @@ function start() {
116
116
  });
117
117
 
118
118
  const port = process.env.PORT || 3000;
119
- console.log('DbGate API listening on port', port);
119
+ console.log('DbGate API listening on port (dev API build)', port);
120
120
  server.listen(port);
121
121
  }
122
122
 
@@ -3,6 +3,7 @@ const path = require('path');
3
3
  const fs = require('fs');
4
4
  const cleanDirectory = require('./cleanDirectory');
5
5
  const platformInfo = require('./platformInfo');
6
+ const processArgs = require('./processArgs');
6
7
 
7
8
  const createDirectories = {};
8
9
  const ensureDirectory = (dir, clean) => {
@@ -19,8 +20,18 @@ const ensureDirectory = (dir, clean) => {
19
20
  }
20
21
  };
21
22
 
23
+ function datadirCore() {
24
+ if (process.env.WORKSPACE_DIR) {
25
+ return process.env.WORKSPACE_DIR;
26
+ }
27
+ if (processArgs.workspaceDir) {
28
+ return processArgs.workspaceDir;
29
+ }
30
+ return path.join(os.homedir(), 'dbgate-data');
31
+ }
32
+
22
33
  function datadir() {
23
- const dir = path.join(os.homedir(), 'dbgate-data');
34
+ const dir = datadirCore();
24
35
  ensureDirectory(dir);
25
36
 
26
37
  return dir;
@@ -56,6 +67,9 @@ function packagedPluginsDir() {
56
67
  // node_modules
57
68
  return global['PLUGINS_DIR'];
58
69
  }
70
+ if (processArgs.pluginsDir) {
71
+ return processArgs.pluginsDir;
72
+ }
59
73
  if (platformInfo.isElectronBundle) {
60
74
  return path.resolve(__dirname, '../../plugins');
61
75
 
@@ -9,10 +9,18 @@ function getNamedArg(name) {
9
9
  const checkParent = process.argv.includes('--checkParent');
10
10
  const startProcess = getNamedArg('--start-process');
11
11
  const isForkedApi = process.argv.includes('--is-forked-api');
12
+ const pluginsDir = getNamedArg('--plugins-dir');
13
+ const workspaceDir = getNamedArg('--workspace-dir');
12
14
 
13
15
  function getPassArgs() {
14
- if (global['NATIVE_MODULES']) return ['--native-modules', global['NATIVE_MODULES']];
15
- return [];
16
+ const res = [];
17
+ if (global['NATIVE_MODULES']) {
18
+ res.push('--native-modules', global['NATIVE_MODULES']);
19
+ }
20
+ if (global['PLUGINS_DIR']) {
21
+ res.push('--plugins-dir', global['PLUGINS_DIR']);
22
+ }
23
+ return res;
16
24
  }
17
25
 
18
26
  module.exports = {
@@ -20,4 +28,6 @@ module.exports = {
20
28
  startProcess,
21
29
  isForkedApi,
22
30
  getPassArgs,
31
+ pluginsDir,
32
+ workspaceDir,
23
33
  };