yakuza0 2.23.13 → 2.23.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.23.13",
3
+ "version": "2.23.15",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -130,7 +130,6 @@ exports.default = function () {
130
130
  if (local) {
131
131
  app.use(function (ctx, next) {
132
132
  return (0, _mid2.default)('/' + key, (0, _extends3.default)({}, defProxyOpt, {
133
- changeOrigin: true,
134
133
  target: _config2.default.server.orbProtocol.http + '//' + _config2.default.server.orbHost + ':' + _config2.default.server.orbPort + '/' + _config2.default.proxyServer.apiKey + '/' + _config2.default.name,
135
134
  rewrite: function rewrite(path, ctx) {
136
135
  var rsf = path.replace('/' + key + '/', '');
@@ -207,7 +207,7 @@ var render = function () {
207
207
  ykPkg = _ref.pkg,
208
208
  dkyModeDef = _ref.dkyModeDef;
209
209
 
210
- var _ykConfig, ykConf, processEnv, imageKeyOrigin, aliasDir, yk0EnvStr, conf, cspLoop, setConfValue, setConfCSP, setConf, client, content, acmConf, hostname, port, ykServer, orbAddr, directives, tip, serverConfStr;
210
+ var _ykConfig, ykConf, processEnv, imageKeyOrigin, aliasDir, yk0EnvStr, conf, cspLoop, setConfValue, setConfCSP, setConf, envBase, envMerge, client, content, acmConf, hostname, port, ykServer, orbAddr, directives, tip, serverConfStr;
211
211
 
212
212
  return _regenerator2.default.wrap(function _callee2$(_context2) {
213
213
  while (1) {
@@ -299,7 +299,7 @@ var render = function () {
299
299
  orbPorts: processEnv.ORBPORTS,
300
300
  yk4Addr: '',
301
301
  orbAddr: '',
302
- infoTimeout: 1000,
302
+ infoTimeout: 7000,
303
303
  orbSSL: true,
304
304
  cHost: null,
305
305
  basePath: '/',
@@ -347,7 +347,9 @@ var render = function () {
347
347
  decoration: undefined,
348
348
  corsCheck: true,
349
349
  policies: {},
350
- directives: {}
350
+ directives: {},
351
+ envType: "def",
352
+ env: {}
351
353
  },
352
354
  sri: {
353
355
  enabled: false,
@@ -597,7 +599,7 @@ var render = function () {
597
599
  baseUrl: {},
598
600
  lp: false,
599
601
  options: {
600
- changeOrigin: false,
602
+ changeOrigin: true,
601
603
  secure: false,
602
604
  logs: false,
603
605
  logsShowHeader: false
@@ -786,63 +788,79 @@ var render = function () {
786
788
  }
787
789
  });
788
790
 
791
+ if (conf.server.csp.envType !== "def") {
792
+ envBase = conf.server.csp.env['base'] || {};
793
+
794
+ delete conf.server.csp.env['base'];
795
+ envMerge = (0, _extends3.default)({}, envBase);
796
+
797
+ _yakuza._.forEach(conf.server.csp.env, function (v, key) {
798
+ if (key === conf.server.csp.envType) {
799
+ _yakuza._.forEach(v, function (ev, ek) {
800
+ envMerge[ek] = _yakuza._.uniq(_yakuza._.compact(_yakuza._.concat(ev, envMerge[ek])));
801
+ });
802
+ }
803
+ });
804
+ conf.server.csp.policies = envMerge;
805
+ }
806
+
789
807
  if (!conf.server.edas.enabled) {
790
- _context2.next = 28;
808
+ _context2.next = 29;
791
809
  break;
792
810
  }
793
811
 
794
- _context2.prev = 16;
812
+ _context2.prev = 17;
795
813
  client = new _acmSdk2.default(conf.server.edas.options);
796
- _context2.next = 20;
814
+ _context2.next = 21;
797
815
  return client.getConfig(conf.server.edas.dataId, conf.server.edas.group);
798
816
 
799
- case 20:
817
+ case 21:
800
818
  content = _context2.sent;
801
819
  acmConf = JSON.parse(content);
802
820
 
803
821
  setConf(acmConf);
804
- _context2.next = 28;
822
+ _context2.next = 29;
805
823
  break;
806
824
 
807
- case 25:
808
- _context2.prev = 25;
809
- _context2.t0 = _context2['catch'](16);
825
+ case 26:
826
+ _context2.prev = 26;
827
+ _context2.t0 = _context2['catch'](17);
810
828
 
811
829
  console.log(_context2.t0);
812
830
 
813
- case 28:
831
+ case 29:
814
832
  _context2.t1 = conf.dkyMode;
815
- _context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ? 35 : _context2.t1 === "prod" ? 39 : _context2.t1 === "stupid" ? 46 : _context2.t1 === "tire" ? 56 : 63;
833
+ _context2.next = _context2.t1 === "dev" ? 32 : _context2.t1 === "normal" ? 36 : _context2.t1 === "prod" ? 40 : _context2.t1 === "stupid" ? 47 : _context2.t1 === "tire" ? 57 : 64;
816
834
  break;
817
835
 
818
- case 31:
836
+ case 32:
819
837
  // conf.security.encrypt = "none";
820
838
  // conf.security.stupid = false;
821
839
  // conf.security.helmet = true;
822
840
  conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
823
841
  conf.security.isDev = true;
824
842
  conf.dev = true;
825
- return _context2.abrupt('break', 63);
843
+ return _context2.abrupt('break', 64);
826
844
 
827
- case 35:
845
+ case 36:
828
846
  // conf.security.encrypt = "none";
829
847
  // conf.security.stupid = false;
830
848
  // conf.security.helmet = true;
831
849
  conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
832
850
  conf.security.isNormal = true;
833
851
  conf.dev = false;
834
- return _context2.abrupt('break', 63);
852
+ return _context2.abrupt('break', 64);
835
853
 
836
- case 39:
854
+ case 40:
837
855
  conf.security.encrypt = "sm";
838
856
  conf.security.stupid = false;
839
857
  conf.security.helmet = true;
840
858
  conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
841
859
  conf.security.isProd = true;
842
860
  conf.dev = false;
843
- return _context2.abrupt('break', 63);
861
+ return _context2.abrupt('break', 64);
844
862
 
845
- case 46:
863
+ case 47:
846
864
  conf.security.encrypt = "sm";
847
865
  conf.security.stupid = true;
848
866
  conf.security.helmet = true;
@@ -853,9 +871,9 @@ var render = function () {
853
871
  conf.server.csp.decoration = checkBoolSingle(conf.server.csp.decoration, true);
854
872
  conf.server.sri.enabled = true;
855
873
  // conf.dev = false;
856
- return _context2.abrupt('break', 63);
874
+ return _context2.abrupt('break', 64);
857
875
 
858
- case 56:
876
+ case 57:
859
877
  conf.security.encrypt = "none";
860
878
  conf.security.stupid = false;
861
879
  conf.security.helmet = false;
@@ -864,9 +882,9 @@ var render = function () {
864
882
  // conf.server.heartbeat.enabled = checkBoolSingle(conf.server.heartbeat.enabled, false);
865
883
  conf.server.heartbeat.enabled = false;
866
884
  // conf.dev = false;
867
- return _context2.abrupt('break', 63);
885
+ return _context2.abrupt('break', 64);
868
886
 
869
- case 63:
887
+ case 64:
870
888
 
871
889
  conf.server.stupid.v23.enabled = conf.server.stupid.standard === 'v23';
872
890
  // conf.router.config['app.examples'].enabled = true;
@@ -969,7 +987,7 @@ var render = function () {
969
987
  conf.server.csp.directives = directives;
970
988
 
971
989
  // const appPortUsed = [];
972
- _context2.next = 85;
990
+ _context2.next = 86;
973
991
  return _yakuza._.asyncMap(conf.router.config, function () {
974
992
  var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
975
993
  var name, arr, length, num;
@@ -1156,7 +1174,7 @@ var render = function () {
1156
1174
  };
1157
1175
  }());
1158
1176
 
1159
- case 85:
1177
+ case 86:
1160
1178
  // console.log(conf.router.config);
1161
1179
 
1162
1180
  conf.shareRule.app = conf.shareRule.app.map(function (ap) {
@@ -1278,12 +1296,12 @@ var render = function () {
1278
1296
 
1279
1297
  return _context2.abrupt('return', { conf: conf });
1280
1298
 
1281
- case 96:
1299
+ case 97:
1282
1300
  case 'end':
1283
1301
  return _context2.stop();
1284
1302
  }
1285
1303
  }
1286
- }, _callee2, undefined, [[16, 25]]);
1304
+ }, _callee2, undefined, [[17, 26]]);
1287
1305
  }));
1288
1306
 
1289
1307
  return function render(_x) {