yakuza0 2.22.34-beta.0 → 2.22.34-beta.10
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/conf.js +8 -2
- package/server/proxy/tire.js +9 -4
- package/utils/inclusive.js +2 -1
package/package.json
CHANGED
package/server/proxy/conf.js
CHANGED
|
@@ -191,12 +191,18 @@ var ng_conf = exports.ng_conf = function ng_conf(_ref6) {
|
|
|
191
191
|
port = _ref6.port,
|
|
192
192
|
yk4Addr = _ref6.yk4Addr,
|
|
193
193
|
basePath = _ref6.basePath,
|
|
194
|
-
name = _ref6.name
|
|
194
|
+
name = _ref6.name,
|
|
195
|
+
resolver = _ref6.resolver;
|
|
195
196
|
|
|
196
197
|
var confRoot = '/etc/nginx/extra';
|
|
197
198
|
if (_os2.default.platform() === 'darwin') {
|
|
198
199
|
confRoot = '/opt/homebrew/etc/nginx/extra';
|
|
199
200
|
}
|
|
201
|
+
if (!resolver) {
|
|
202
|
+
resolver = '';
|
|
203
|
+
} else {
|
|
204
|
+
resolver = 'resolver ' + _server._.trimEnd(resolver, ';') + ';';
|
|
205
|
+
}
|
|
200
206
|
|
|
201
|
-
return '\n server {\n listen ' + port + ';\n server_name
|
|
207
|
+
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 + 'apiv1 {\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 include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + '/apiv1/' + name + '/client/backend;\n }\n\n location ' + basePath + 'apiv1/feapiv1 {\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 include ' + confRoot + '/proxy.conf;\n proxy_pass ' + yk4Addr + '/apiv1/' + name + '/client/feapiv1;\n }\n\n location ' + basePath + 'apiv2 {\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 ';
|
|
202
208
|
};
|
package/server/proxy/tire.js
CHANGED
|
@@ -92,7 +92,7 @@ exports.default = function () {
|
|
|
92
92
|
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(_ref) {
|
|
93
93
|
var config = _ref.config;
|
|
94
94
|
|
|
95
|
-
var appConf, guPort, appConfPort, appName, server, pIp, pHost, timeout, commonHeaders, getHeader, isFastDfs, apiVer, getUc, build, baseConfig, app, _th, th, basePath, conf;
|
|
95
|
+
var appConf, guPort, appConfPort, appName, server, pIp, pHost, timeout, commonHeaders, getHeader, isFastDfs, apiVer, getUc, build, baseConfig, app, _th, th, basePath, conf, _pathRewrite;
|
|
96
96
|
|
|
97
97
|
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
|
98
98
|
while (1) {
|
|
@@ -447,6 +447,10 @@ exports.default = function () {
|
|
|
447
447
|
});
|
|
448
448
|
|
|
449
449
|
if (_config2.default.security.isTire) {
|
|
450
|
+
try {
|
|
451
|
+
(0, _child_process.exec)(_config2.default.server.tire.guPath + ' -s stop');
|
|
452
|
+
// spawn(yConf.server.tire.guPath, ['-s', 'stop']);
|
|
453
|
+
} catch (e) {}
|
|
450
454
|
th = (_th = {}, (0, _defineProperty3.default)(_th, _def.variable.ipHeader, '127.0.0.1'), (0, _defineProperty3.default)(_th, _def.variable.childKeyHeader, _config2.default.childKey), (0, _defineProperty3.default)(_th, _def.variable.appCodeHeader, config.appConf.appCode), (0, _defineProperty3.default)(_th, _def.variable.appKeyHeader, config.appKey), (0, _defineProperty3.default)(_th, _def.variable.shareRuleHeader, (0, _stringify2.default)(_config2.default.shareRule)), _th);
|
|
451
455
|
basePath = _server._.bothAddFix(config.appConf.server.basePath, "/");
|
|
452
456
|
|
|
@@ -458,17 +462,18 @@ exports.default = function () {
|
|
|
458
462
|
yk4Addr: _config2.default.server.orbProtocol.http + "//" + _config2.default.server.orbHost + ":" + _config2.default.server.orbPort,
|
|
459
463
|
basePath: basePath,
|
|
460
464
|
name: _config2.default.name,
|
|
461
|
-
port: guPort
|
|
465
|
+
port: guPort,
|
|
466
|
+
resolver: _config2.default.server.tire.resolver
|
|
462
467
|
});
|
|
463
468
|
|
|
464
469
|
_paths2.default.write(_config2.default.server.tire.clnConf, conf);
|
|
465
|
-
// spawn(yConf.server.tire.guPath, ['-c', yConf.server.tire.guConf]);
|
|
466
470
|
(0, _child_process.exec)(_config2.default.server.tire.guPath + ' -c ' + _config2.default.server.tire.guConf + ' -g "daemon off;"');
|
|
471
|
+
// spawn(yConf.server.tire.guPath, ['-c', yConf.server.tire.guConf]);
|
|
467
472
|
} else {
|
|
468
473
|
app.use(basePath + "apiv1", createProxyMiddleware((0, _extends5.default)({}, baseConfig, {
|
|
469
474
|
target: _config2.default.server.orbProtocol.http + "//" + _config2.default.server.orbHost + ":" + _config2.default.server.orbPort,
|
|
470
475
|
headers: th,
|
|
471
|
-
pathRewrite: (0, _defineProperty3.default)(
|
|
476
|
+
pathRewrite: (_pathRewrite = {}, (0, _defineProperty3.default)(_pathRewrite, "^" + basePath + "apiv1/feapiv1", "/" + _config2.default.proxyServer.apiKey + "/" + _config2.default.name + "/client/feapiv1"), (0, _defineProperty3.default)(_pathRewrite, "^" + basePath + "apiv1", "/" + _config2.default.proxyServer.apiKey + "/" + _config2.default.name + "/client/backend"), _pathRewrite)
|
|
472
477
|
})));
|
|
473
478
|
|
|
474
479
|
app.use(basePath + "apiv2", createProxyMiddleware((0, _extends5.default)({}, baseConfig, {
|
package/utils/inclusive.js
CHANGED