yakuza0 2.23.45 → 2.23.46-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.
@@ -0,0 +1,15 @@
1
+ # 三仓库统一开发基线(2026-10-28)
2
+
3
+ 三个仓库统一使用 `codex/security-config-compat-20261028`。各仓库在自己的现有代码上增量修复,不互相合并 Git 历史,也不切回旧功能分支。
4
+
5
+ | 仓库 | 原分支 | 原 HEAD | 本轮基线 |
6
+ | --- | --- | --- | --- |
7
+ | yakuza0 | del_apiv1 | 0ecacb4 | 原 HEAD + 本轮修复 |
8
+ | yakuza1 | del_apiv1 | 6a3a031 | 原 HEAD + 本轮修复 |
9
+ | yakuza4 | safe0 | b26b6df | 43e67e5 保存原有暂存、未暂存和未跟踪开发文件,再叠加本轮修复 |
10
+
11
+ 原分支保留。BFF 的 Yulink/SDK、检查策略、HTTP 调试、加密工具等原有工作完整保存在独立基线提交中;安全补丁另行提交。检查当前版本时同时记录三个仓库的 `git rev-parse HEAD`,不能用不同仓库的同名分支或包版本代替提交号。
12
+
13
+ 开始本轮前的补丁、原始暂存区补丁、未跟踪文件归档及基线信息保存在本机 `/Users/ningfujun/.codex/yakuza-security-20261028-1p8lfbv_`,该目录不进入 Git 或 npm 包。
14
+
15
+ 发布顺序、兼容范围和回归结果见 [配置泄露整改说明](docs/security-config-compat-2026-10-28.md)。本轮只做本地修复和验证,未发布 npm、推送远程或修改生产。
package/config/index.js CHANGED
@@ -54,10 +54,10 @@ var safeGet = function safeGet(options) {
54
54
  return ec(cj);
55
55
  };
56
56
 
57
- var lsKey = 'cln_init';
57
+ var lsKey = 'cln_public_v1';
58
58
  var lsGet = function lsGet(appName, key) {
59
59
  // const lsk = lsKey + '_' + md5(appName).substring(2, 8);
60
- var lsk = lsKey;
60
+ var lsk = lsKey + '_' + appName;
61
61
  var lgc = localStorage.getItem(lsk);
62
62
 
63
63
  if (lgc) {
@@ -71,14 +71,14 @@ var lsGet = function lsGet(appName, key) {
71
71
  var lsSet = function lsSet(appName, key, str) {
72
72
  // const lsk = lsKey + '_' + md5(appName).substring(2, 8);
73
73
 
74
- for (var i = 0; i < localStorage.length; i++) {
74
+ for (var i = localStorage.length - 1; i >= 0; i--) {
75
75
  var k = localStorage.key(i);
76
- if (_yakuza._.startsWith(k, lsKey) && k.replace(lsKey, '').length > 0) {
76
+ if (k === 'cln_init' || _yakuza._.startsWith(k, 'cln_init_')) {
77
77
  localStorage.removeItem(k);
78
78
  }
79
79
  }
80
80
 
81
- var lsk = lsKey;
81
+ var lsk = lsKey + '_' + appName;
82
82
  var content = key + '_' + str;
83
83
  localStorage.setItem(lsk, content);
84
84
  };
@@ -130,7 +130,7 @@ var ykConfig = function ykConfig() {
130
130
  }
131
131
 
132
132
  _yakuza._.readOnly(_yakuza.global, '__enc_encryptType__', config.security && config.security.encrypt);
133
- _yakuza._.readOnly(_yakuza.global, '__yConf_ak__', config.ak);
133
+ if ((0, _yakuza.checkServer)()) _yakuza._.readOnly(_yakuza.global, '__yConf_ak__', config.ak);
134
134
 
135
135
  if (config.https && process && process.env) {
136
136
  process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
@@ -12,6 +12,10 @@ var _paths = require('../../config/paths');
12
12
 
13
13
  var _paths2 = _interopRequireDefault(_paths);
14
14
 
15
+ var _serverHttpOptions = require('../../utils/serverHttpOptions');
16
+
17
+ var _publicHttpOptions = require('../../utils/publicHttpOptions');
18
+
15
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
20
 
17
21
  var path = require('path');
@@ -89,13 +93,14 @@ function httpModule(_moduleOptions) {
89
93
  options.browserBaseURL = https(options.browserBaseURL);
90
94
  }
91
95
 
92
- options = (0, _stringify2.default)(options);
96
+ (0, _serverHttpOptions.writeServerHttpOptions)(appName, options);
97
+ var browserOptions = (0, _stringify2.default)((0, _publicHttpOptions.publicHttpOptions)(options)).replace(/</g, '\\u003c');
93
98
 
94
99
  // Register plugin
95
100
  this.addPlugin({
96
101
  src: _paths2.default.ykTemplate + 'http.plugin.js',
97
102
  fileName: 'http.js',
98
- options: options
103
+ options: browserOptions
99
104
  });
100
105
 
101
106
  // Proxy integration
@@ -107,7 +112,7 @@ function httpModule(_moduleOptions) {
107
112
  // }
108
113
  // Add `ky` to build.transpile
109
114
  this.options.build = this.options.build || {};
110
- this.options.build.transpile = this.options.build.transpile || {};
115
+ this.options.build.transpile = this.options.build.transpile || [];
111
116
  // transpile only for non-modern build
112
117
  // istanbul ignore if
113
118
  if (semver.gte(semver.coerce(this.nuxt.constructor.version), '2.9.0')) {
@@ -48,7 +48,7 @@ exports.default = function (moduleOptions) {
48
48
  src: _paths2.default.ykTemplate + 'yk.plugin.js',
49
49
  options: _encrypt.mixin.symmetry.ECB.encrypt((0, _stringify2.default)({
50
50
  appName: appName,
51
- appConf: appConf
51
+ appConf: (0, _publicConfig.publicAppConfig)(appConf, _config2.default.name, appName)
52
52
  }))
53
53
  });
54
54
  };
@@ -59,6 +59,12 @@ var _paths2 = _interopRequireDefault(_paths);
59
59
 
60
60
  var _encrypt = require('yakuza1/lib/encrypt');
61
61
 
62
+ var _config = require('../../config');
63
+
64
+ var _config2 = _interopRequireDefault(_config);
65
+
66
+ var _publicConfig = require('../../utils/publicConfig');
67
+
62
68
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
63
69
 
64
70
  var defaults = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.23.45",
3
+ "version": "2.23.46-beta.1",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,6 +11,8 @@
11
11
  "pub": "npm run build && npm version patch && npm publish",
12
12
  "test": "jest",
13
13
  "test:ssr": "node tests/zunir-ssr.js",
14
+ "test:config-values": "node tests/config-value.js && node tests/server-identity.js",
15
+ "test:public-config": "node tests/public-config.js",
14
16
  "postinstall": "yk init"
15
17
  },
16
18
  "author": "nfjbill",
@@ -116,13 +118,13 @@
116
118
  "ua-parser-js": "^0.7.40",
117
119
  "uglify-js": "^3.17.4",
118
120
  "v8-compile-cache": "^2.0.2",
119
- "yakuza1": "2.6.26"
121
+ "yakuza1": "2.6.27-beta.1"
120
122
  },
121
123
  "peerDependencies": {
122
124
  "@evolvere/nuxt": "2.15.9",
123
125
  "core-js": "3.10.1",
124
126
  "eslint": "7.2.0",
125
- "yakuza1": "2.6.26"
127
+ "yakuza1": "2.6.27-beta.1"
126
128
  },
127
129
  "__npminstall_done": false
128
130
  }
package/pxnpm-lock.yaml CHANGED
@@ -288,8 +288,8 @@ importers:
288
288
  specifier: ^2.0.2
289
289
  version: 2.4.0
290
290
  yakuza1:
291
- specifier: ^2.6.25
292
- version: 2.6.25(core-js@3.10.1)
291
+ specifier: 2.6.26
292
+ version: 2.6.26(core-js@3.10.1)
293
293
  devDependencies:
294
294
  babel-cli:
295
295
  specifier: ^6.26.0
@@ -8532,8 +8532,8 @@ packages:
8532
8532
  y18n@4.0.3:
8533
8533
  resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
8534
8534
 
8535
- yakuza1@2.6.25:
8536
- resolution: {integrity: sha512-z1OSZJBtd61d8s+IzpAi5An8/fhVy/UTxktY9nxRLmVUJ7KEw4V0TIpZ/rvD2q2EqH7l07Sdp3Vk8hvwS+UHPA==}
8535
+ yakuza1@2.6.26:
8536
+ resolution: {integrity: sha512-057phi0dejOtyXplzEqVB07r+qULLXkV2RdT8e/idFEFZlgGTXdoiMwdI5Vv7jqNH8gbt3/IdZZMSF+jn8DNvw==}
8537
8537
  peerDependencies:
8538
8538
  core-js: 3.10.1
8539
8539
 
@@ -19022,7 +19022,7 @@ snapshots:
19022
19022
 
19023
19023
  y18n@4.0.3: {}
19024
19024
 
19025
- yakuza1@2.6.25(core-js@3.10.1):
19025
+ yakuza1@2.6.26(core-js@3.10.1):
19026
19026
  dependencies:
19027
19027
  '@babel/core': 7.26.9
19028
19028
  '@babel/preset-env': 7.26.9(@babel/core@7.26.9)
@@ -220,7 +220,7 @@ var ng_conf = exports.ng_conf = function ng_conf(_ref7) {
220
220
  resolver = 'resolver ' + _server._.trimEnd(resolver, ';') + ';';
221
221
  }
222
222
 
223
- var headers = '\n proxy_set_header ' + _def.variable.projectNameHeader + ' \'' + th[_def.variable.projectNameHeader] + '\';\n proxy_set_header ' + _def.variable.ipHeader + ' \'' + th[_def.variable.ipHeader] + '\';\n proxy_set_header ' + _def.variable.childKeyHeader + ' \'' + th[_def.variable.childKeyHeader] + '\';\n proxy_set_header ' + _def.variable.appCodeHeader + ' \'' + th[_def.variable.appCodeHeader] + '\';\n proxy_set_header ' + _def.variable.appKeyHeader + ' \'' + th[_def.variable.appKeyHeader] + '\';\n proxy_set_header ' + _def.variable.shareRuleHeader + ' \'' + th[_def.variable.shareRuleHeader] + '\';\n proxy_set_header ' + _def.variable.baseURLHeader + ' \'' + th[_def.variable.baseURLHeader] + '\';\n ';
223
+ var headers = '\n proxy_set_header ' + _def.variable.projectNameHeader + ' \'' + th[_def.variable.projectNameHeader] + '\';\n proxy_set_header ' + _def.variable.ipHeader + ' \'' + th[_def.variable.ipHeader] + '\';\n proxy_set_header ' + _def.variable.childKeyHeader + ' \'' + th[_def.variable.childKeyHeader] + '\';\n proxy_set_header ' + _def.variable.appCodeHeader + ' \'' + th[_def.variable.appCodeHeader] + '\';\n proxy_set_header ' + _def.variable.appKeyHeader + ' \'' + th[_def.variable.appKeyHeader] + '\';\n proxy_set_header ' + _def.variable.appNameHeader + ' \'' + th[_def.variable.appNameHeader] + '\';\n proxy_set_header ' + _def.variable.shareRuleHeader + ' \'' + th[_def.variable.shareRuleHeader] + '\';\n proxy_set_header ' + _def.variable.baseURLHeader + ' \'' + th[_def.variable.baseURLHeader] + '\';\n ';
224
224
 
225
225
  return '\n ' + resolver + '\n\n server {\n listen ' + port + ';\n server_name cln-tire.lan;\n include ' + confRoot + '/server.conf;\n\n location ' + basePath + ' {\n proxy_pass ' + appUrl + ';\n }\n\n location ' + basePath + 'zunir {\n ' + headers + '\n include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + '/zunir/' + name + '/client/backend;\n }\n\n location ' + basePath + 'zunir/feapiv1 {\n ' + headers + '\n include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + '/zunir/' + name + '/client/feapiv1;\n }\n\n location ' + basePath + 'apiv2 {\n ' + headers + '\n include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + '/apiv2;\n }\n\n location ~ ' + basePath + 'apiv3/cln_.*feapiv1/ {\n rewrite ^' + basePath + 'apiv3/cln_(.*)feapiv1/(.*)$ ' + basePath + 'apiv3/fe/$2 last;\n include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + ';\n }\n location ~ ' + basePath + 'apiv3/cln_[a-z]+/ {\n rewrite ^' + basePath + 'apiv3/cln_[a-z]+/(.*)$ ' + basePath + 'apiv3/backend/$1 last;\n include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + ';\n }\n }\n ';
226
226
  };