update 2025-03-12 14:16:16

This commit is contained in:
kenzok8 2025-03-12 14:16:16 +08:00
parent 33fda6a5a7
commit 128372e743
4 changed files with 116 additions and 3 deletions

View File

@ -11,7 +11,7 @@ PKG_ARCH_ISTOREENHANCE:=$(ARCH)
PKG_NAME:=istoreenhance
PKG_VERSION:=0.1.9
PKG_RELEASE:=$(PKG_ARCH_ISTOREENHANCE)-1
PKG_RELEASE:=$(PKG_ARCH_ISTOREENHANCE)-2
PKG_SOURCE:=iStoreEnhance-binary-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://fw.koolcenter.com/binary/iStoreEnhance/
PKG_HASH:=846ef252e28a70f96d5051fdcdabb898d04dede37699137f439cfc77141cc072

View File

@ -6,6 +6,8 @@ USE_PROCD=1
get_config() {
config_get_bool enabled $1 enabled 1
config_get port $1 port 5443
config_get adminport $1 adminport 5003
config_get cache $1 cache
}
start_service() {
@ -16,10 +18,14 @@ start_service() {
return 1
fi
if [ -z $cache ]; then
return 2
fi
procd_open_instance
procd_set_param limits nofile="65535 65535"
procd_set_param command /usr/sbin/iStoreEnhance
[ -n "$port" ] && procd_append_param command --localAddr ":$port"
[ -n "$port" ] && procd_append_param command --localAddr ":$port" --adminAddr ":$adminport" --cachePath $cache
procd_set_param respawn
procd_close_instance
}

View File

@ -2,11 +2,50 @@
'require form';
'require poll';
'require uci';
'require ui';
'require view';
'require fchomo as hm';
'require tools.widgets as widgets';
function parseProxyGroupYaml(field, name, cfg) {
if (!cfg.type)
return null;
// key mapping
let config = hm.removeBlankAttrs({
id: cfg.hm_id,
label: cfg.hm_label,
type: cfg.type,
groups: cfg.proxies ? cfg.proxies.map((grop) => hm.preset_outbound.full.map(([key, label]) => key).includes(grop) ? grop : this.calcID(hm.glossary["proxy_group"].field, grop)) : null, // array
use: cfg.use ? cfg.use.map((prov) => this.calcID(hm.glossary["provider"].field, prov)) : null, // array
include_all: hm.bool2str(cfg["include-all"]), // bool
include_all_proxies: hm.bool2str(cfg["include-all-proxies"]), // bool
include_all_providers: hm.bool2str(cfg["include-all-providers"]), // bool
// Url-test fields
tolerance: cfg.tolerance,
// Load-balance fields
strategy: cfg.strategy,
// Override fields
disable_udp: hm.bool2str(cfg["disable-udp"]), // bool
// Health fields
url: cfg.url,
interval: cfg.interval,
timeout: cfg.timeout,
lazy: hm.bool2str(cfg.lazy), // bool
expected_status: cfg["expected-status"],
max_failed_times: cfg["max-failed-times"],
// General fields
filter: [cfg.filter], // array.string: string
exclude_filter: [cfg["exclude-filter"]], // array.string: string
exclude_type: [cfg["exclude-type"]], // array.string: string
hidden: hm.bool2str(cfg.hidden), // bool
icon: cfg.icon
});
return config;
}
function loadDNSServerLabel(section_id) {
delete this.keylist;
delete this.vallist;
@ -618,6 +657,73 @@ return view.extend({
ss.hm_prefmt = hm.glossary[ss.sectiontype].prefmt;
ss.hm_field = hm.glossary[ss.sectiontype].field;
ss.hm_lowcase_only = true;
/* Import mihomo config start */
ss.handleYamlImport = function() {
const field = this.hm_field;
const o = new hm.HandleImport(this.map, this, _('Import mihomo config'),
_('Please type <code>%s</code> fields of mihomo config.</br>')
.format(field));
o.placeholder = 'proxy-groups:\n' +
'- name: "auto"\n' +
' type: url-test\n' +
' proxies:\n' +
' - ss1\n' +
' - ss2\n' +
' - vmess1\n' +
' tolerance: 150\n' +
' lazy: true\n' +
' expected-status: 204\n' +
' url: "https://cp.cloudflare.com/generate_204"\n' +
' interval: 300\n' +
' timeout: 5000\n' +
' max-failed-times: 5\n' +
'- name: "fallback-auto"\n' +
' type: fallback\n' +
' proxies:\n' +
' - DIRECT\n' +
' - auto\n' +
' url: "https://cp.cloudflare.com/generate_204"\n' +
' interval: 300\n' +
'- name: "load-balance"\n' +
' type: load-balance\n' +
' include-all: true\n' +
' url: "https://cp.cloudflare.com/generate_204"\n' +
' interval: 300\n' +
' lazy: false\n' +
' strategy: consistent-hashin\n' +
'- name: AllProxy\n' +
' type: select\n' +
' disable-udp: true\n' +
' include-all-proxies: true\n' +
' use:\n' +
' - provider1\n' +
'- name: AllProvider\n' +
' type: select\n' +
' include-all-providers: true\n' +
' filter: "(?i)港|hk|hongkong|hong kong"\n' +
' exclude-filter: "美|日"\n' +
' exclude-type: "Shadowsocks|Http"\n' +
' ...'
o.parseYaml = function(field, name, cfg) {
let config = hm.HandleImport.prototype.parseYaml.call(this, field, name, cfg);
return config ? parseProxyGroupYaml.call(this, field, name, config) : config;
};
return o.render();
}
ss.renderSectionAdd = function(/* ... */) {
let el = hm.GridSection.prototype.renderSectionAdd.apply(this, arguments);
el.appendChild(E('button', {
'class': 'cbi-button cbi-button-add',
'title': _('mihomo config'),
'click': ui.createHandlerFn(this, 'handleYamlImport')
}, [ _('Import mihomo config') ]));
return el;
}
/* Import mihomo config end */
ss.tab('field_general', _('General fields'));
ss.tab('field_override', _('Override fields'));

View File

@ -36,6 +36,7 @@ function parseProviderYaml(field, name, cfg) {
override_prefix: hm.getValue(cfg, "override.additional-prefix"),
override_suffix: hm.getValue(cfg, "override.additional-suffix"),
override_replace: (hm.getValue(cfg, "override.proxy-name") || []).map((obj) => JSON.stringify(obj)), // array.string: array.object
// Configuration Items
override_tfo: hm.bool2str(hm.getValue(cfg, "override.tfo")), // bool
override_mptcp: hm.bool2str(hm.getValue(cfg, "override.mptcp")), // bool
override_udp: hm.bool2str(hm.getValue(cfg, "override.udp")), // bool
@ -48,7 +49,7 @@ function parseProviderYaml(field, name, cfg) {
override_routing_mark: hm.getValue(cfg, "override.routing-mark"),
override_ip_version: hm.getValue(cfg, "override.ip-version"),
/* General fields */
filter: [cfg.filter], // array: string
filter: [cfg.filter], // array.string: string
exclude_filter: [cfg["exclude-filter"]], // array.string: string
exclude_type: [cfg["exclude-type"]] // array.string: string
})