yakuza0 2.22.1-beta.1 → 2.22.1-beta.3
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/package.json +1 -1
- package/server/proxy/csrf.js +1 -1
- package/server/proxy/tire.js +26 -6
- package/utils/inclusive.js +24 -32
package/package.json
CHANGED
package/server/proxy/csrf.js
CHANGED
|
@@ -347,7 +347,7 @@ exports.default = function () {
|
|
|
347
347
|
while (1) {
|
|
348
348
|
switch (_context.prev = _context.next) {
|
|
349
349
|
case 0:
|
|
350
|
-
if (!(ctx.method.toUpperCase() === 'GET' && ctx.path === '/sys/health-check')) {
|
|
350
|
+
if (!(ctx.method.toUpperCase() === 'GET' && (ctx.path === '/sys/health-check' || ctx.path === config.appConf.server.basePathMU + 'sys/health-check'))) {
|
|
351
351
|
_context.next = 5;
|
|
352
352
|
break;
|
|
353
353
|
}
|
package/server/proxy/tire.js
CHANGED
|
@@ -84,7 +84,7 @@ exports.default = function () {
|
|
|
84
84
|
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(_ref) {
|
|
85
85
|
var config = _ref.config;
|
|
86
86
|
|
|
87
|
-
var appConf, appName, server, pIp, pHost, timeout, commonHeaders, getHeader, isFastDfs, apiVer, getUc, build, baseConfig, app, _headers;
|
|
87
|
+
var appConf, appName, server, pIp, pHost, timeout, commonHeaders, appHc, getHeader, isFastDfs, apiVer, getUc, build, baseConfig, app, _headers;
|
|
88
88
|
|
|
89
89
|
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
90
90
|
while (1) {
|
|
@@ -98,6 +98,26 @@ exports.default = function () {
|
|
|
98
98
|
timeout = _config2.default.server.infoTimeout + 5000;
|
|
99
99
|
commonHeaders = {};
|
|
100
100
|
|
|
101
|
+
// health-check ssl use
|
|
102
|
+
|
|
103
|
+
if (_config2.default.inImage) {
|
|
104
|
+
appHc = express();
|
|
105
|
+
|
|
106
|
+
appHc.use(function (req, res, next) {
|
|
107
|
+
var method = req.method.toUpperCase();
|
|
108
|
+
var path = req.url;
|
|
109
|
+
if (method === "GET" && path === '/sys/health-check') {
|
|
110
|
+
res.status(200).send({
|
|
111
|
+
response_status: 200,
|
|
112
|
+
data: 'alive'
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
res.status(404).send("The page was not found ~~");
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
appHc.listen(_config2.default.server.hcPort);
|
|
119
|
+
}
|
|
120
|
+
|
|
101
121
|
getHeader = function getHeader(req) {
|
|
102
122
|
if (req && req.headers) {
|
|
103
123
|
var _ref3;
|
|
@@ -108,7 +128,7 @@ exports.default = function () {
|
|
|
108
128
|
};
|
|
109
129
|
|
|
110
130
|
if (!server.generate.enabled) {
|
|
111
|
-
_context3.next =
|
|
131
|
+
_context3.next = 27;
|
|
112
132
|
break;
|
|
113
133
|
}
|
|
114
134
|
|
|
@@ -228,14 +248,14 @@ exports.default = function () {
|
|
|
228
248
|
}();
|
|
229
249
|
|
|
230
250
|
if (_config2.default.security.isTire) {
|
|
231
|
-
_context3.next =
|
|
251
|
+
_context3.next = 17;
|
|
232
252
|
break;
|
|
233
253
|
}
|
|
234
254
|
|
|
235
|
-
_context3.next =
|
|
255
|
+
_context3.next = 17;
|
|
236
256
|
return build();
|
|
237
257
|
|
|
238
|
-
case
|
|
258
|
+
case 17:
|
|
239
259
|
baseConfig = {
|
|
240
260
|
// changeOrigin: true,
|
|
241
261
|
secure: false,
|
|
@@ -551,7 +571,7 @@ exports.default = function () {
|
|
|
551
571
|
}, server.generate.maxAge * 1000);
|
|
552
572
|
}
|
|
553
573
|
|
|
554
|
-
case
|
|
574
|
+
case 27:
|
|
555
575
|
case "end":
|
|
556
576
|
return _context3.stop();
|
|
557
577
|
}
|
package/utils/inclusive.js
CHANGED
|
@@ -277,6 +277,7 @@ var render = function () {
|
|
|
277
277
|
host: processEnv.HOST || '127.0.0.1',
|
|
278
278
|
port: processEnv.PORT || 3000,
|
|
279
279
|
appPort: processEnv.PORT || 3100,
|
|
280
|
+
hcPort: 81,
|
|
280
281
|
orbHost: processEnv.ORBHOST || 'fe-dev.inner.px.nfjbill.ren',
|
|
281
282
|
orbPort: processEnv.ORBPORT || 5601,
|
|
282
283
|
orbHosts: processEnv.ORBHOSTS,
|
|
@@ -732,71 +733,62 @@ var render = function () {
|
|
|
732
733
|
});
|
|
733
734
|
|
|
734
735
|
if (!conf.server.edas.enabled) {
|
|
735
|
-
_context2.next =
|
|
736
|
+
_context2.next = 27;
|
|
736
737
|
break;
|
|
737
738
|
}
|
|
738
739
|
|
|
739
740
|
_context2.prev = 15;
|
|
740
|
-
|
|
741
|
-
console.log(1);
|
|
742
741
|
client = new _acmSdk2.default(conf.server.edas.options);
|
|
743
|
-
|
|
744
|
-
console.log(2);
|
|
745
|
-
_context2.next = 21;
|
|
742
|
+
_context2.next = 19;
|
|
746
743
|
return client.getConfig(conf.server.edas.dataId, conf.server.edas.group);
|
|
747
744
|
|
|
748
|
-
case
|
|
745
|
+
case 19:
|
|
749
746
|
content = _context2.sent;
|
|
750
|
-
|
|
751
|
-
console.log(3, content);
|
|
752
747
|
acmConf = JSON.parse(content);
|
|
753
748
|
|
|
754
|
-
console.log(4, acmConf);
|
|
755
749
|
setConf(acmConf);
|
|
756
|
-
|
|
757
|
-
_context2.next = 33;
|
|
750
|
+
_context2.next = 27;
|
|
758
751
|
break;
|
|
759
752
|
|
|
760
|
-
case
|
|
761
|
-
_context2.prev =
|
|
753
|
+
case 24:
|
|
754
|
+
_context2.prev = 24;
|
|
762
755
|
_context2.t0 = _context2['catch'](15);
|
|
763
756
|
|
|
764
|
-
console.log(6, _context2.t0);
|
|
765
757
|
console.log(_context2.t0);
|
|
766
758
|
|
|
767
|
-
case
|
|
759
|
+
case 27:
|
|
768
760
|
_context2.t1 = conf.dkyMode;
|
|
769
|
-
_context2.next = _context2.t1 === "dev" ?
|
|
761
|
+
_context2.next = _context2.t1 === "dev" ? 30 : _context2.t1 === "normal" ? 33 : _context2.t1 === "prod" ? 36 : _context2.t1 === "stupid" ? 42 : _context2.t1 === "tire" ? 50 : 56;
|
|
770
762
|
break;
|
|
771
763
|
|
|
772
|
-
case
|
|
764
|
+
case 30:
|
|
773
765
|
// conf.security.encrypt = "none";
|
|
774
766
|
// conf.security.stupid = false;
|
|
775
767
|
// conf.security.helmet = true;
|
|
776
768
|
// conf.server.f5Offline = false;
|
|
777
769
|
conf.security.isDev = true;
|
|
778
770
|
conf.dev = true;
|
|
779
|
-
return _context2.abrupt('break',
|
|
771
|
+
return _context2.abrupt('break', 56);
|
|
780
772
|
|
|
781
|
-
case
|
|
773
|
+
case 33:
|
|
782
774
|
// conf.security.encrypt = "none";
|
|
783
775
|
// conf.security.stupid = false;
|
|
784
776
|
// conf.security.helmet = true;
|
|
785
777
|
// conf.server.f5Offline = false;
|
|
786
778
|
conf.security.isNormal = true;
|
|
787
779
|
conf.dev = false;
|
|
788
|
-
return _context2.abrupt('break',
|
|
780
|
+
return _context2.abrupt('break', 56);
|
|
789
781
|
|
|
790
|
-
case
|
|
782
|
+
case 36:
|
|
791
783
|
conf.security.encrypt = "sm";
|
|
792
784
|
conf.security.stupid = false;
|
|
793
785
|
conf.security.helmet = true;
|
|
794
786
|
// conf.server.f5Offline = false;
|
|
795
787
|
conf.security.isProd = true;
|
|
796
788
|
conf.dev = false;
|
|
797
|
-
return _context2.abrupt('break',
|
|
789
|
+
return _context2.abrupt('break', 56);
|
|
798
790
|
|
|
799
|
-
case
|
|
791
|
+
case 42:
|
|
800
792
|
conf.security.encrypt = "sm";
|
|
801
793
|
conf.security.stupid = true;
|
|
802
794
|
conf.security.helmet = true;
|
|
@@ -805,18 +797,18 @@ var render = function () {
|
|
|
805
797
|
conf.server.csp.enabled = true;
|
|
806
798
|
conf.server.sri.enabled = true;
|
|
807
799
|
conf.dev = false;
|
|
808
|
-
return _context2.abrupt('break',
|
|
800
|
+
return _context2.abrupt('break', 56);
|
|
809
801
|
|
|
810
|
-
case
|
|
802
|
+
case 50:
|
|
811
803
|
conf.security.encrypt = "none";
|
|
812
804
|
conf.security.stupid = false;
|
|
813
805
|
conf.security.helmet = false;
|
|
814
806
|
// conf.server.f5Offline = false;
|
|
815
807
|
conf.security.isTire = true;
|
|
816
808
|
conf.dev = false;
|
|
817
|
-
return _context2.abrupt('break',
|
|
809
|
+
return _context2.abrupt('break', 56);
|
|
818
810
|
|
|
819
|
-
case
|
|
811
|
+
case 56:
|
|
820
812
|
|
|
821
813
|
// conf.router.config['app.examples'].enabled = true;
|
|
822
814
|
if (conf.server.yk4Addr) {
|
|
@@ -916,7 +908,7 @@ var render = function () {
|
|
|
916
908
|
conf.server.csp.directives = directives;
|
|
917
909
|
|
|
918
910
|
// const appPortUsed = [];
|
|
919
|
-
_context2.next =
|
|
911
|
+
_context2.next = 77;
|
|
920
912
|
return _yakuza._.asyncMap(conf.router.config, function () {
|
|
921
913
|
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
|
|
922
914
|
var name, arr, length, num;
|
|
@@ -1099,7 +1091,7 @@ var render = function () {
|
|
|
1099
1091
|
};
|
|
1100
1092
|
}());
|
|
1101
1093
|
|
|
1102
|
-
case
|
|
1094
|
+
case 77:
|
|
1103
1095
|
// console.log(conf.router.config);
|
|
1104
1096
|
|
|
1105
1097
|
conf.shareRule.app = conf.shareRule.app.map(function (ap) {
|
|
@@ -1221,12 +1213,12 @@ var render = function () {
|
|
|
1221
1213
|
|
|
1222
1214
|
return _context2.abrupt('return', { conf: conf });
|
|
1223
1215
|
|
|
1224
|
-
case
|
|
1216
|
+
case 88:
|
|
1225
1217
|
case 'end':
|
|
1226
1218
|
return _context2.stop();
|
|
1227
1219
|
}
|
|
1228
1220
|
}
|
|
1229
|
-
}, _callee2, undefined, [[15,
|
|
1221
|
+
}, _callee2, undefined, [[15, 24]]);
|
|
1230
1222
|
}));
|
|
1231
1223
|
|
|
1232
1224
|
return function render(_x) {
|