yakuza0 2.20.7 → 2.20.11
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/nuxt/buildModules/stylelint.js +0 -1
- package/nuxt/style.js +1 -0
- package/package.json +4 -4
- package/server/proxy/web.js +25 -2
- package/utils/inclusive.js +12 -5
package/nuxt/style.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.default = function (config) {
|
|
|
37
37
|
|
|
38
38
|
config.buildModules = ['@rdc/nuxtjs-style-resources'];
|
|
39
39
|
|
|
40
|
+
console.warn = function () {};
|
|
40
41
|
if (stylelint.enabled) {
|
|
41
42
|
var sm = ['yakuza0/nuxt/buildModules/stylelint', stylelint.options];
|
|
42
43
|
config.buildModules.push(sm);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yakuza0",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.11",
|
|
4
4
|
"description": "yakuza0 with nuxt",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "babel --no-babelrc src -d . --presets=env --plugins=transform-runtime,transform-object-rest-spread,add-module-exports",
|
|
8
|
-
"pub:beta": "npm run build && npm version prerelease --preid=beta &&
|
|
8
|
+
"pub:beta": "npm run build && npm version prerelease --preid=beta && pxnpm publish --tag beta",
|
|
9
9
|
"pub": "npm run build && npm version patch && npm publish",
|
|
10
10
|
"postinstall": "yk verify commit-init",
|
|
11
11
|
"test": "jest"
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
"tcp-port-used": "^1.0.1",
|
|
98
98
|
"ua-parser-js": "^0.7.20",
|
|
99
99
|
"v8-compile-cache": "^2.0.2",
|
|
100
|
-
"yakuza1": "2.6.
|
|
100
|
+
"yakuza1": "2.6.6"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@rdc/nuxt": "2.15.8-0",
|
|
104
104
|
"core-js": "3.10.1",
|
|
105
105
|
"eslint": "7.2.0",
|
|
106
|
-
"yakuza1": "2.6.
|
|
106
|
+
"yakuza1": "2.6.6"
|
|
107
107
|
}
|
|
108
108
|
}
|
package/server/proxy/web.js
CHANGED
|
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
var _keys = require('babel-runtime/core-js/object/keys');
|
|
8
|
+
|
|
9
|
+
var _keys2 = _interopRequireDefault(_keys);
|
|
10
|
+
|
|
7
11
|
var _regenerator = require('babel-runtime/regenerator');
|
|
8
12
|
|
|
9
13
|
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
@@ -101,7 +105,7 @@ exports.default = function () {
|
|
|
101
105
|
proxyConf = _ref.proxyConf,
|
|
102
106
|
nuxt = _ref.nuxt,
|
|
103
107
|
config = _ref.config;
|
|
104
|
-
var pKey, servers;
|
|
108
|
+
var pKey, servers, wsProxyKeys;
|
|
105
109
|
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
106
110
|
while (1) {
|
|
107
111
|
switch (_context3.prev = _context3.next) {
|
|
@@ -240,6 +244,10 @@ exports.default = function () {
|
|
|
240
244
|
}
|
|
241
245
|
});
|
|
242
246
|
|
|
247
|
+
if (_config2.default.security.isStupid) {
|
|
248
|
+
proxyReq.setHeader(_def.variable.adjoinIpHeader, (0, _server.getClientIP)(req, { stupid: true }));
|
|
249
|
+
}
|
|
250
|
+
|
|
243
251
|
// const keys = Object.keys(yConf.proxyServer.proxy).join('|')
|
|
244
252
|
// if (req.crossParams.originUrl.match(new RegExp(`^\/(${keys})\/`))) {
|
|
245
253
|
// _.forEach(yConf.proxyServer.proxyHeaders, dt => {
|
|
@@ -323,6 +331,8 @@ exports.default = function () {
|
|
|
323
331
|
}, getCert()), app.callback()).listen(config.appConf.appPort));
|
|
324
332
|
}
|
|
325
333
|
|
|
334
|
+
wsProxyKeys = (0, _keys2.default)(_config2.default.proxyServer.ws.proxy);
|
|
335
|
+
|
|
326
336
|
servers.forEach(function (ser) {
|
|
327
337
|
ser.on('upgrade', function (req, socket, head) {
|
|
328
338
|
if (_config2.default.server.om.enabled && _server.global.__cpm__ && (0, _om.isOmOpen)(req)) {
|
|
@@ -349,13 +359,26 @@ exports.default = function () {
|
|
|
349
359
|
headers: headers
|
|
350
360
|
}, defProxyOpt));
|
|
351
361
|
}
|
|
362
|
+
|
|
363
|
+
var wsProxyKey = '';
|
|
364
|
+
wsProxyKeys.forEach(function (key) {
|
|
365
|
+
if (req.url.indexOf(key) !== -1) {
|
|
366
|
+
wsProxyKey = key;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
if (wsProxyKey && wsProxyKey.startsWith(_config2.default.proxyServer.ws.prefix)) {
|
|
370
|
+
req.url = req.url.replace('/' + wsProxyKey, '');
|
|
371
|
+
_mid.proxy.ws(req, socket, head, (0, _extends3.default)({
|
|
372
|
+
target: _config2.default.proxyServer.ws.proxy[wsProxyKey]
|
|
373
|
+
}, defProxyOpt));
|
|
374
|
+
}
|
|
352
375
|
}
|
|
353
376
|
|
|
354
377
|
socket.on('error', function (err) {});
|
|
355
378
|
});
|
|
356
379
|
});
|
|
357
380
|
|
|
358
|
-
case
|
|
381
|
+
case 8:
|
|
359
382
|
case 'end':
|
|
360
383
|
return _context3.stop();
|
|
361
384
|
}
|
package/utils/inclusive.js
CHANGED
|
@@ -193,6 +193,7 @@ var render = function () {
|
|
|
193
193
|
version: ykPkg.version,
|
|
194
194
|
ak: 'ak_TjfAV7I',
|
|
195
195
|
name: pkg.name,
|
|
196
|
+
group: '',
|
|
196
197
|
dev: processEnv.NODE_ENV === 'development',
|
|
197
198
|
cmd: process.env.NODE_CMD,
|
|
198
199
|
processKey: '.' + (0, _yakuza.md5)(appDirectory).substring(2, 18),
|
|
@@ -494,7 +495,9 @@ var render = function () {
|
|
|
494
495
|
baseUrl: {},
|
|
495
496
|
lp: false,
|
|
496
497
|
ws: {
|
|
497
|
-
key: 'api-ws'
|
|
498
|
+
key: 'api-ws',
|
|
499
|
+
prefix: 'proxy-ws-',
|
|
500
|
+
proxy: {}
|
|
498
501
|
},
|
|
499
502
|
app: {},
|
|
500
503
|
// ...(mainConf && mainConf.proxyServer ? mainConf.proxyServer : {}),
|
|
@@ -725,6 +728,10 @@ var render = function () {
|
|
|
725
728
|
}
|
|
726
729
|
}
|
|
727
730
|
|
|
731
|
+
if (conf.group) {
|
|
732
|
+
conf.imageKey = (0, _yakuza.md5)(conf.group);
|
|
733
|
+
}
|
|
734
|
+
|
|
728
735
|
if (conf.ak.startsWith('ak_docker') || conf.inImage) {
|
|
729
736
|
// conf.env = 'docker';
|
|
730
737
|
conf.server.mockIP = true;
|
|
@@ -772,11 +779,11 @@ var render = function () {
|
|
|
772
779
|
|
|
773
780
|
conf.proxyServer.proxy.apiv2 = orbAddr;
|
|
774
781
|
conf.proxyServer.proxy.apiv3 = orbAddr;
|
|
775
|
-
conf.proxyServer.proxy[
|
|
782
|
+
conf.proxyServer.proxy[conf.proxyServer.ws.key] = orbAddr;
|
|
776
783
|
|
|
777
784
|
conf.server.csp.imgSrc = _yakuza._.uniq([].concat((0, _toConsumableArray3.default)(conf.server.csp.imgSrc || []), (0, _toConsumableArray3.default)(conf.server.tfs.fastdfs.domain)));
|
|
778
785
|
|
|
779
|
-
_context2.next =
|
|
786
|
+
_context2.next = 49;
|
|
780
787
|
return _yakuza._.asyncMap(conf.router.config, function () {
|
|
781
788
|
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
|
|
782
789
|
var name, arr, length, num;
|
|
@@ -933,7 +940,7 @@ var render = function () {
|
|
|
933
940
|
};
|
|
934
941
|
}());
|
|
935
942
|
|
|
936
|
-
case
|
|
943
|
+
case 49:
|
|
937
944
|
// console.log(conf.router.config);
|
|
938
945
|
|
|
939
946
|
conf.shareRule.app = conf.shareRule.app.map(function (ap) {
|
|
@@ -1014,7 +1021,7 @@ var render = function () {
|
|
|
1014
1021
|
|
|
1015
1022
|
return _context2.abrupt('return', { conf: conf });
|
|
1016
1023
|
|
|
1017
|
-
case
|
|
1024
|
+
case 56:
|
|
1018
1025
|
case 'end':
|
|
1019
1026
|
return _context2.stop();
|
|
1020
1027
|
}
|