@abtnode/router-provider 1.8.29 → 1.8.30
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/lib/nginx/index.js +4 -4
- package/lib/nginx/util.js +2 -4
- package/package.json +6 -6
package/lib/nginx/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const getPort = require('get-port');
|
|
|
10
10
|
const uniqBy = require('lodash/uniqBy');
|
|
11
11
|
const isEmpty = require('lodash/isEmpty');
|
|
12
12
|
const cloneDeep = require('lodash/cloneDeep');
|
|
13
|
+
const formatBackSlash = require('@abtnode/util/lib/format-back-slash');
|
|
13
14
|
const {
|
|
14
15
|
DOMAIN_FOR_DEFAULT_SITE,
|
|
15
16
|
ROUTING_RULE_TYPES,
|
|
@@ -28,7 +29,6 @@ const BaseProvider = require('../base');
|
|
|
28
29
|
const {
|
|
29
30
|
addTestServer,
|
|
30
31
|
formatError,
|
|
31
|
-
formatNginxPath,
|
|
32
32
|
getNginxLoadModuleDirectives,
|
|
33
33
|
parseNginxConfigArgs,
|
|
34
34
|
getNginxStatus,
|
|
@@ -136,8 +136,8 @@ class NginxProvider extends BaseProvider {
|
|
|
136
136
|
|
|
137
137
|
getConfTemplate() {
|
|
138
138
|
return getMainTemplate({
|
|
139
|
-
logDir: this.getRelativeConfigDir(
|
|
140
|
-
tmpDir: this.getRelativeConfigDir(
|
|
139
|
+
logDir: this.getRelativeConfigDir(formatBackSlash(this.logDir)),
|
|
140
|
+
tmpDir: this.getRelativeConfigDir(formatBackSlash(this.tmpDir)),
|
|
141
141
|
workerProcess: this.getWorkerProcess(),
|
|
142
142
|
nginxLoadModules: getNginxLoadModuleDirectives(REQUIRED_MODULES, this.readNginxConfigParams()).join(os.EOL),
|
|
143
143
|
});
|
|
@@ -315,7 +315,7 @@ class NginxProvider extends BaseProvider {
|
|
|
315
315
|
*/
|
|
316
316
|
_exec(param = '') {
|
|
317
317
|
logger.info('exec', { param });
|
|
318
|
-
let command = `${this.binPath} -c ${this.configPath} -p ${
|
|
318
|
+
let command = `${this.binPath} -c ${this.configPath} -p ${formatBackSlash(this.configDir)}`; // eslint-disable-line no-param-reassign
|
|
319
319
|
if (param) {
|
|
320
320
|
command = `${command} -s ${param}`;
|
|
321
321
|
}
|
package/lib/nginx/util.js
CHANGED
|
@@ -9,6 +9,7 @@ const shelljs = require('shelljs');
|
|
|
9
9
|
const findProcess = require('find-process');
|
|
10
10
|
const moment = require('moment');
|
|
11
11
|
const { MAX_UPLOAD_FILE_SIZE } = require('@abtnode/constant');
|
|
12
|
+
const formatBackSlash = require('@abtnode/util/lib/format-back-slash');
|
|
12
13
|
|
|
13
14
|
const logger = require('@abtnode/logger')('router:nginx:util');
|
|
14
15
|
|
|
@@ -274,15 +275,12 @@ const getUpstreamName = (port) => `server_${port}`;
|
|
|
274
275
|
|
|
275
276
|
const joinNginxPath = (...args) => {
|
|
276
277
|
const result = path.join(...args);
|
|
277
|
-
return result
|
|
278
|
+
return formatBackSlash(result);
|
|
278
279
|
};
|
|
279
280
|
|
|
280
|
-
const formatNginxPath = (filepath) => filepath.replaceAll(path.sep, '/');
|
|
281
|
-
|
|
282
281
|
module.exports = {
|
|
283
282
|
addTestServer,
|
|
284
283
|
formatError,
|
|
285
|
-
formatNginxPath,
|
|
286
284
|
getMainTemplate,
|
|
287
285
|
getNginxLoadModuleDirectives,
|
|
288
286
|
getMissingModules,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/router-provider",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.30",
|
|
4
4
|
"description": "Routing engine implementations for abt node",
|
|
5
5
|
"author": "polunzh <polunzh@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/constant": "1.8.
|
|
36
|
-
"@abtnode/logger": "1.8.
|
|
37
|
-
"@abtnode/router-templates": "1.8.
|
|
38
|
-
"@abtnode/util": "1.8.
|
|
35
|
+
"@abtnode/constant": "1.8.30",
|
|
36
|
+
"@abtnode/logger": "1.8.30",
|
|
37
|
+
"@abtnode/router-templates": "1.8.30",
|
|
38
|
+
"@abtnode/util": "1.8.30",
|
|
39
39
|
"axios": "^0.27.2",
|
|
40
40
|
"debug": "^4.3.4",
|
|
41
41
|
"find-process": "^1.4.7",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"fs-extra": "^10.1.0",
|
|
63
63
|
"needle": "^3.1.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "cb294f4ee7382c6ef7692b6c2c33ad080fced13e"
|
|
66
66
|
}
|