mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 19:05:13 +08:00
🎄 Sync 2026-07-26 03:59:09
This commit is contained in:
1 parent
85de1d9922
commit
6efc8c18ce
68 files changed
+1556
-9154
No files matched your search
@@ -52,12 +52,6 @@ const dns_port = uci.get(uciconfig, uciinfra, 'dns_port') || '5333';
|
||||
|
||||
const ntp_server = uci.get(uciconfig, uciinfra, 'ntp_server') || 'time.apple.com';
|
||||
|
||||
const dashboard_enabled = uci.get(uciconfig, ucimain, 'dashboard_enabled') || '0';
|
||||
const dashboard_port = uci.get(uciconfig, ucimain, 'dashboard_port') || '9090';
|
||||
const dashboard_secret = uci.get(uciconfig, ucimain, 'dashboard_secret');
|
||||
const dashboard_url = uci.get(uciconfig, ucimain, 'dashboard_url');
|
||||
const dashboard_detour = uci.get(uciconfig, ucimain, 'dashboard_detour');
|
||||
|
||||
const ipv6_support = uci.get(uciconfig, ucimain, 'ipv6_support') || '0';
|
||||
|
||||
let main_node, main_udp_node, dedicated_udp_node, default_outbound, default_outbound_dns,
|
||||
@@ -127,10 +121,10 @@ if (match(proxy_mode, /redirect/)) {
|
||||
self_mark = uci.get(uciconfig, 'infra', 'self_mark') || '100';
|
||||
redirect_port = uci.get(uciconfig, 'infra', 'redirect_port') || '5331';
|
||||
}
|
||||
if (match(proxy_mode), /tproxy/)
|
||||
if (match(proxy_mode, /tproxy/))
|
||||
if (main_udp_node !== 'nil' || routing_mode === 'custom')
|
||||
tproxy_port = uci.get(uciconfig, 'infra', 'tproxy_port') || '5332';
|
||||
if (match(proxy_mode), /tun/) {
|
||||
if (match(proxy_mode, /tun/)) {
|
||||
tun_name = uci.get(uciconfig, uciinfra, 'tun_name') || 'singtun0';
|
||||
tun_addr4 = uci.get(uciconfig, uciinfra, 'tun_addr4') || '172.19.0.1/30';
|
||||
tun_addr6 = uci.get(uciconfig, uciinfra, 'tun_addr6') || 'fdfe:dcba:9876::1/126';
|
||||
@@ -930,7 +924,6 @@ if (!isEmpty(main_node)) {
|
||||
user: cfg.user,
|
||||
rule_set: get_ruleset(cfg.rule_set),
|
||||
rule_set_ip_cidr_match_source: strToBool(cfg.rule_set_ip_cidr_match_source),
|
||||
rule_set_ip_cidr_accept_empty: strToBool(cfg.rule_set_ip_cidr_accept_empty),
|
||||
invert: strToBool(cfg.invert),
|
||||
action: cfg.action,
|
||||
outbound: get_outbound(cfg.outbound),
|
||||
@@ -976,28 +969,6 @@ if (routing_mode in ['bypass_mainland_china', 'custom']) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (dashboard_enabled === '1') {
|
||||
if (!config.experimental)
|
||||
config.experimental = {};
|
||||
|
||||
let download_detour = 'direct-out';
|
||||
if (!isEmpty(dashboard_detour)) {
|
||||
if (dashboard_detour in ['direct-out', 'main-out'])
|
||||
download_detour = dashboard_detour;
|
||||
else
|
||||
download_detour = get_outbound(dashboard_detour);
|
||||
}
|
||||
|
||||
config.experimental.clash_api = {
|
||||
external_controller: '0.0.0.0:' + dashboard_port,
|
||||
secret: !isEmpty(dashboard_secret) ? dashboard_secret : null,
|
||||
external_ui: RUN_DIR + '/ui',
|
||||
external_ui_download_url: !isEmpty(dashboard_url) ? dashboard_url :
|
||||
'https://github.com/Zephyruso/zashboard/releases/latest/download/dist-cdn.zip',
|
||||
external_ui_download_detour: download_detour,
|
||||
};
|
||||
}
|
||||
/* Experimental end */
|
||||
|
||||
system('mkdir -p ' + RUN_DIR);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
'use strict';
|
||||
|
||||
import { cursor } from 'uci';
|
||||
import { isEmpty, parseURL } from 'homeproxy';
|
||||
import { isEmpty, parseURL, validation } from 'homeproxy';
|
||||
|
||||
const uci = cursor();
|
||||
|
||||
|
||||
Reference in new issue
Block a user