yakuza0 2.22.20 → 2.22.21-beta.1

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.22.20",
3
+ "version": "2.22.21-beta.1",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,6 +8,10 @@ var _regenerator = require('babel-runtime/regenerator');
8
8
 
9
9
  var _regenerator2 = _interopRequireDefault(_regenerator);
10
10
 
11
+ var _extends2 = require('babel-runtime/helpers/extends');
12
+
13
+ var _extends3 = _interopRequireDefault(_extends2);
14
+
11
15
  var _promise = require('babel-runtime/core-js/promise');
12
16
 
13
17
  var _promise2 = _interopRequireDefault(_promise);
@@ -100,10 +104,10 @@ exports.default = function () {
100
104
  _pm2.default.start({
101
105
  name: processName,
102
106
  script: _paths2.default.ykRoot + 'bin/yk.js s lite',
103
- env: {
107
+ env: (0, _extends3.default)({
104
108
  NODE_ENV: "production",
105
109
  config: config
106
- },
110
+ }, process.env),
107
111
  logDateFormat: 'YYYY-MM-DD HH:mm Z',
108
112
  output: output,
109
113
  error: error,
@@ -437,7 +437,8 @@ exports.default = function () {
437
437
  // noCache(ctx);
438
438
  clnInitCache(ctx);
439
439
  // const str = paths.read(ycp.confServer);
440
- _server.global.__yk_cln_init_server__ = __yk_cln_init_server__ || _paths2.default.read(ycp.confServer);
440
+ // global.__yk_cln_init_server__ = __yk_cln_init_server__ || paths.read(ycp.confServer)
441
+ _server.global.__yk_cln_init_server__ = _paths2.default.read(ycp.confServer);
441
442
  ctx.status = 200;
442
443
  ctx.body = _server.global.__yk_cln_init_server__;
443
444
  _context2.next = 18;
@@ -197,7 +197,7 @@ var render = function () {
197
197
  ykPkg = _ref.pkg,
198
198
  dkyModeDef = _ref.dkyModeDef;
199
199
 
200
- var _ykConfig, ykConf, processEnv, imageKeyOrigin, aliasDir, conf, cspLoop, setConfValue, setConfCSP, setConf, client, content, acmConf, hostname, port, ykServer, orbAddr, directives, tip, serverConfStr;
200
+ var _ykConfig, ykConf, processEnv, imageKeyOrigin, aliasDir, yk0EnvStr, conf, cspLoop, setConfValue, setConfCSP, setConf, client, content, acmConf, hostname, port, ykServer, orbAddr, directives, tip, serverConfStr;
201
201
 
202
202
  return _regenerator2.default.wrap(function _callee2$(_context2) {
203
203
  while (1) {
@@ -208,6 +208,7 @@ var render = function () {
208
208
  processEnv = process && process.env || {};
209
209
  imageKeyOrigin = (0, _yakuza.md5)((processEnv.YK_DOCKERNAME || '').toString());
210
210
  aliasDir = aliasFn();
211
+ yk0EnvStr = '';
211
212
  conf = {
212
213
  version: ykPkg.version,
213
214
  ak: 'ak_TjfAV7I',
@@ -729,6 +730,7 @@ var render = function () {
729
730
  // if (v === "false") {
730
731
  // v = false;
731
732
  // }
733
+ yk0EnvStr += key + v;
732
734
  key = key.replace('yk0_', '').replace('YK0_', '').replace(/__ARR/g, '"]').replace(/ARR__/g, '["').replace(/__COLON__/g, ':').replace(/__/g, '.');
733
735
 
734
736
  var cipherKey = 'cln_enc__';
@@ -748,62 +750,62 @@ var render = function () {
748
750
  });
749
751
 
750
752
  if (!conf.server.edas.enabled) {
751
- _context2.next = 27;
753
+ _context2.next = 28;
752
754
  break;
753
755
  }
754
756
 
755
- _context2.prev = 15;
757
+ _context2.prev = 16;
756
758
  client = new _acmSdk2.default(conf.server.edas.options);
757
- _context2.next = 19;
759
+ _context2.next = 20;
758
760
  return client.getConfig(conf.server.edas.dataId, conf.server.edas.group);
759
761
 
760
- case 19:
762
+ case 20:
761
763
  content = _context2.sent;
762
764
  acmConf = JSON.parse(content);
763
765
 
764
766
  setConf(acmConf);
765
- _context2.next = 27;
767
+ _context2.next = 28;
766
768
  break;
767
769
 
768
- case 24:
769
- _context2.prev = 24;
770
- _context2.t0 = _context2['catch'](15);
770
+ case 25:
771
+ _context2.prev = 25;
772
+ _context2.t0 = _context2['catch'](16);
771
773
 
772
774
  console.log(_context2.t0);
773
775
 
774
- case 27:
776
+ case 28:
775
777
  _context2.t1 = conf.dkyMode;
776
- _context2.next = _context2.t1 === "dev" ? 30 : _context2.t1 === "normal" ? 33 : _context2.t1 === "prod" ? 36 : _context2.t1 === "stupid" ? 42 : _context2.t1 === "tire" ? 49 : 54;
778
+ _context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ? 34 : _context2.t1 === "prod" ? 37 : _context2.t1 === "stupid" ? 43 : _context2.t1 === "tire" ? 50 : 55;
777
779
  break;
778
780
 
779
- case 30:
781
+ case 31:
780
782
  // conf.security.encrypt = "none";
781
783
  // conf.security.stupid = false;
782
784
  // conf.security.helmet = true;
783
785
  // conf.server.f5Offline = false;
784
786
  conf.security.isDev = true;
785
787
  conf.dev = true;
786
- return _context2.abrupt('break', 54);
788
+ return _context2.abrupt('break', 55);
787
789
 
788
- case 33:
790
+ case 34:
789
791
  // conf.security.encrypt = "none";
790
792
  // conf.security.stupid = false;
791
793
  // conf.security.helmet = true;
792
794
  // conf.server.f5Offline = false;
793
795
  conf.security.isNormal = true;
794
796
  conf.dev = false;
795
- return _context2.abrupt('break', 54);
797
+ return _context2.abrupt('break', 55);
796
798
 
797
- case 36:
799
+ case 37:
798
800
  conf.security.encrypt = "sm";
799
801
  conf.security.stupid = false;
800
802
  conf.security.helmet = true;
801
803
  // conf.server.f5Offline = false;
802
804
  conf.security.isProd = true;
803
805
  conf.dev = false;
804
- return _context2.abrupt('break', 54);
806
+ return _context2.abrupt('break', 55);
805
807
 
806
- case 42:
808
+ case 43:
807
809
  conf.security.encrypt = "sm";
808
810
  conf.security.stupid = true;
809
811
  conf.security.helmet = true;
@@ -812,18 +814,18 @@ var render = function () {
812
814
  conf.server.csp.enabled = true;
813
815
  conf.server.sri.enabled = true;
814
816
  // conf.dev = false;
815
- return _context2.abrupt('break', 54);
817
+ return _context2.abrupt('break', 55);
816
818
 
817
- case 49:
819
+ case 50:
818
820
  conf.security.encrypt = "none";
819
821
  conf.security.stupid = false;
820
822
  conf.security.helmet = false;
821
823
  // conf.server.f5Offline = false;
822
824
  conf.security.isTire = true;
823
825
  // conf.dev = false;
824
- return _context2.abrupt('break', 54);
826
+ return _context2.abrupt('break', 55);
825
827
 
826
- case 54:
828
+ case 55:
827
829
 
828
830
  // conf.router.config['app.examples'].enabled = true;
829
831
  if (conf.server.yk4Addr) {
@@ -923,7 +925,7 @@ var render = function () {
923
925
  conf.server.csp.directives = directives;
924
926
 
925
927
  // const appPortUsed = [];
926
- _context2.next = 75;
928
+ _context2.next = 76;
927
929
  return _yakuza._.asyncMap(conf.router.config, function () {
928
930
  var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
929
931
  var name, arr, length, num;
@@ -1108,7 +1110,7 @@ var render = function () {
1108
1110
  };
1109
1111
  }());
1110
1112
 
1111
- case 75:
1113
+ case 76:
1112
1114
  // console.log(conf.router.config);
1113
1115
 
1114
1116
  conf.shareRule.app = conf.shareRule.app.map(function (ap) {
@@ -1179,7 +1181,7 @@ var render = function () {
1179
1181
  conf.server = v.server;
1180
1182
  var scKeyStr = (0, _stringify2.default)(_yakuza._.omit(conf, ["cmd", "versionSha"])) + conf.childKey;
1181
1183
  if (conf.inImage) {
1182
- scKeyStr = k + conf.imageKeyOrigin;
1184
+ scKeyStr = k + conf.imageKeyOrigin + yk0EnvStr;
1183
1185
  }
1184
1186
  var scKey = (0, _yakuza.md5)(scKeyStr).substring(2, 8);
1185
1187
  conf.scKey = scKey;
@@ -1230,12 +1232,12 @@ var render = function () {
1230
1232
 
1231
1233
  return _context2.abrupt('return', { conf: conf });
1232
1234
 
1233
- case 86:
1235
+ case 87:
1234
1236
  case 'end':
1235
1237
  return _context2.stop();
1236
1238
  }
1237
1239
  }
1238
- }, _callee2, undefined, [[15, 24]]);
1240
+ }, _callee2, undefined, [[16, 25]]);
1239
1241
  }));
1240
1242
 
1241
1243
  return function render(_x) {