update 2026-07-12 14:28:37

This commit is contained in:
action committed 2026-07-12 14:28:37 +08:00
1 parent 751a6ad6b1
commit 24c2eb6e4f
18 files changed
+1581 -1359

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ LUCI_DEPENDS:= \
PKG_NAME:=luci-app-homeproxy
PKG_VERSION=$(PKG_SRC_VERSION)
PKG_RELEASE:=7
PKG_RELEASE:=11
PKG_PO_VERSION=$(PKG_SRC_VERSION)-r$(PKG_RELEASE)
define Package/luci-app-homeproxy/conffiles
@@ -382,11 +382,6 @@ return view.extend({
for (let i in hp.dns_strategy)
so.value(i, hp.dns_strategy[i]);
so = ss.option(form.Flag, 'sniff_override', _('Override destination'),
_('Override the connection destination address with the sniffed domain.'));
so.default = so.enabled;
so.rmempty = false;
so = ss.option(form.ListValue, 'default_outbound', _('Default outbound'),
_('Default outbound for connections not matched by any routing rules.'));
so.load = function(section_id) {
@@ -395,7 +390,7 @@ return view.extend({
this.value('nil', _('Disable (the service)'));
this.value('direct-out', _('Direct'));
this.value('block-out', _('Block'));
this.value('reject', _('Reject'));
uci.sections(data[0], 'routing_node', (res) => {
if (res.enabled === '1')
this.value(res['.name'], res.label);
@@ -1018,8 +1013,8 @@ return view.extend({
so.depends('type', 'quic');
so.modalonly = true;
so = ss.option(form.ListValue, 'address_resolver', _('Address resolver'),
_('Tag of a another server to resolve the domain name in the address. Required if address contains domain.'));
so = ss.option(form.ListValue, 'domain_resolver', _('Domain resolver'),
_('Tag of another DNS server used to resolve a domain name in the server address.'));
so.load = function(section_id) {
delete this.keylist;
delete this.vallist;
@@ -1039,7 +1034,7 @@ return view.extend({
let conflict = false;
uci.sections(data[0], 'dns_server', (res) => {
if (res['.name'] !== section_id)
if (res.address_resolver === section_id && res['.name'] == value)
if (res.domain_resolver === section_id && res['.name'] == value)
conflict = true;
});
if (conflict)
@@ -1050,11 +1045,11 @@ return view.extend({
}
so.modalonly = true;
so = ss.option(form.ListValue, 'address_strategy', _('Address strategy'),
so = ss.option(form.ListValue, 'domain_strategy', _('Domain strategy'),
_('The domain strategy for resolving the domain name in the address.'));
for (let i in hp.dns_strategy)
so.value(i, hp.dns_strategy[i]);
so.depends({'address_resolver': '', '!reverse': true});
so.depends({'domain_resolver': '', '!reverse': true});
so.modalonly = true;
so = ss.option(form.ListValue, 'outbound', _('Outbound'),
@@ -31,7 +31,18 @@ const css = ' \
const hp_dir = '/var/run/homeproxy';
function getConnStat(o, site) {
const connectionSites = [
{ type: 'baidu', name: _('Baidu'), url: 'https://www.baidu.com/' },
{ type: 'bilibili', name: _('Bilibili'), url: 'https://www.bilibili.com/' },
{ type: 'jd', name: _('JD'), url: 'https://www.jd.com/' },
{ type: 'google', name: _('Google'), url: 'https://www.google.com/' },
{ type: 'github', name: _('GitHub'), url: 'https://github.com/' },
{ type: 'youtube', name: _('YouTube'), url: 'https://www.youtube.com/' }
];
const connectionTestTimeout = 10000;
function getConnectionStatus() {
const callConnStat = rpc.declare({
object: 'luci.homeproxy',
method: 'connection_check',
@@ -39,25 +50,121 @@ function getConnStat(o, site) {
expect: { '': {} }
});
o.default = E('div', { 'style': 'cbi-value-field' }, [
E('button', {
'class': 'btn cbi-button cbi-button-action',
'click': ui.createHandlerFn(this, () => {
return L.resolveDefault(callConnStat(site), {}).then((ret) => {
let ele = o.default.firstElementChild.nextElementSibling;
if (ret.result) {
ele.style.setProperty('color', 'green');
ele.innerHTML = _('passed');
} else {
ele.style.setProperty('color', 'red');
ele.innerHTML = _('failed');
}
});
})
}, [ _('Check') ]),
' ',
E('strong', { 'style': 'color:gray' }, _('unchecked')),
const table = E('table', { 'class': 'table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Website')),
E('th', { 'class': 'th' }, _('URL')),
E('th', { 'class': 'th' }, _('Connectivity')),
E('th', { 'class': 'th' }, _('Latency'))
])
]);
const statusElements = {};
const rows = connectionSites.map((site) => {
const state = E('strong', { 'style': 'color:gray' }, '-');
const latency = E('span', {}, '-');
statusElements[site.type] = { state, latency };
return [
site.name,
E('a', {
'href': site.url,
'target': '_blank',
'rel': 'noreferrer noopener',
'style': 'word-break:break-all'
}, site.url),
state,
latency
];
});
cbi_update_table(table, rows);
let running = false;
let generation = 0;
let testButton;
const updateResult = (site, result) => {
const elements = statusElements[site];
if (!elements)
return;
if (result?.result) {
elements.state.style.setProperty('color', 'green');
dom.content(elements.state, _('Connected'));
dom.content(elements.latency, _('%d ms').format(result.latency_ms));
} else {
elements.state.style.setProperty('color', 'red');
dom.content(elements.state, result?.timed_out ? _('Timed out') : _('Disconnected'));
dom.content(elements.latency, '-');
}
};
const runAllTests = () => {
if (running)
return Promise.resolve();
running = true;
testButton.disabled = true;
const currentGeneration = ++generation;
connectionSites.forEach((site) => {
const elements = statusElements[site.type];
elements.state.style.setProperty('color', 'gray');
dom.content(elements.state, _('Testing...'));
dom.content(elements.latency, '-');
});
return new Promise((resolve) => {
let settled = false;
const finish = (result) => {
if (settled)
return;
settled = true;
resolve(result);
};
const timer = window.setTimeout(() => finish({ timed_out: true }), connectionTestTimeout);
L.resolveDefault(callConnStat('all'), { results: [] }).then((result) => {
window.clearTimeout(timer);
finish(result);
});
}).then((result) => {
if (currentGeneration !== generation)
return;
const results = {};
(result.results || []).forEach((siteResult) => {
results[siteResult.site] = siteResult;
});
connectionSites.forEach((site) => {
updateResult(site.type, results[site.type] || {
result: false,
timed_out: !!result.timed_out
});
});
}).finally(() => {
if (currentGeneration === generation) {
running = false;
testButton.disabled = false;
}
});
};
testButton = E('button', {
'class': 'btn cbi-button cbi-button-action',
'style': 'margin-left:4px',
'click': ui.createHandlerFn(this, runAllTests)
}, [ _('Test all') ]);
const view = E('div', { 'class': 'cbi-map' }, [
E('h3', { 'name': 'content', 'style': 'align-items:center;display:flex' }, [
_('Connection status'),
testButton
]),
E('div', { 'class': 'cbi-section' }, [ table ])
]);
window.setTimeout(runAllTests, 0);
return view;
}
const resources = [
@@ -280,18 +387,12 @@ return view.extend({
m = new form.Map('homeproxy');
s = m.section(form.NamedSection, 'config', 'homeproxy', _('Connection check'));
s.anonymous = true;
o = s.option(form.DummyValue, '_check_baidu', _('BaiDu'));
o.cfgvalue = L.bind(getConnStat, this, o, 'baidu');
o = s.option(form.DummyValue, '_check_google', _('Google'));
o.cfgvalue = L.bind(getConnStat, this, o, 'google');
s = m.section(form.NamedSection, 'config', 'homeproxy');
s.anonymous = true;
o = s.option(form.DummyValue, '_connection_status');
o.render = L.bind(getConnectionStatus, this);
o = s.option(form.DummyValue, '_resources');
o.render = L.bind(getResources, this, o);
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+2 -4
View File
@@ -8,7 +8,6 @@ config homeproxy 'infra'
option dns_port '5333'
option dns_redirect '1'
option ntp_server 'nil'
option sniff_override '1'
option udp_timeout ''
option tun_name 'singtun0'
option tun_addr4 '172.19.0.1/30'
@@ -50,13 +49,12 @@ config homeproxy 'control'
list wan_proxy_ipv6_ips '2a0a:f280::/32'
config homeproxy 'routing'
option sniff_override '1'
option default_outbound 'direct-out'
option default_outbound_dns 'default-dns'
config homeproxy 'dns'
option dns_strategy 'prefer_ipv4'
option default_server 'local-dns'
option default_strategy 'prefer_ipv4'
option default_server 'default-dns'
option disable_cache '0'
option disable_cache_expire '0'
@@ -64,6 +64,8 @@
14.204.0.0/15
14.208.0.0/12
16.2.142.0/23
16.5.34.0/24
16.5.43.0/24
23.161.8.0/24
27.0.128.0/24
27.0.130.0/23
@@ -269,7 +271,7 @@
43.231.160.0/21
43.231.168.0/22
43.239.120.0/22
43.239.172.0/23
43.239.172.0/24
43.240.0.0/22
43.240.56.0/21
43.240.72.0/22
@@ -378,7 +380,7 @@
43.255.200.0/22
43.255.212.0/22
43.255.224.0/21
44.30.164.0/24
44.30.131.0/24
44.31.28.0/24
44.31.216.0/24
44.32.191.0/24
@@ -421,7 +423,6 @@
45.124.76.0/22
45.124.80.0/22
45.124.124.0/22
45.125.25.0/24
45.125.44.0/22
45.125.56.0/22
45.126.112.0/22
@@ -490,6 +491,7 @@
49.221.128.0/19
49.232.0.0/14
49.239.192.0/18
51.146.70.0/24
51.194.210.0/24
51.241.143.0/24
52.80.0.0/15
@@ -688,6 +690,7 @@
62.234.0.0/16
63.140.0.0/24
63.140.3.0/24
64.204.61.0/24
65.86.204.0/24
66.102.240.0/24
66.102.242.0/23
@@ -697,8 +700,6 @@
66.102.252.0/24
66.102.254.0/23
68.79.0.0/18
68.166.209.0/24
69.33.203.0/24
69.163.104.0/24
69.163.106.0/24
69.163.123.0/24
@@ -710,7 +711,7 @@
71.132.0.0/18
71.136.64.0/18
71.137.0.0/18
72.244.62.0/24
78.105.147.0/24
78.105.182.0/23
78.154.108.0/24
81.68.0.0/14
@@ -1081,7 +1082,6 @@
103.83.44.0/22
103.83.64.0/22
103.83.72.0/22
103.84.136.0/22
103.84.170.0/23
103.85.84.0/22
103.85.147.0/24
@@ -1190,7 +1190,6 @@
103.131.138.0/23
103.131.152.0/22
103.131.168.0/24
103.131.176.0/22
103.132.22.0/23
103.132.212.0/23
103.133.128.0/23
@@ -1205,7 +1204,6 @@
103.139.212.0/23
103.140.14.0/23
103.141.10.0/23
103.142.82.0/24
103.142.96.0/23
103.142.234.0/23
103.143.16.0/22
@@ -1286,8 +1284,6 @@
103.200.144.0/21
103.200.220.0/22
103.200.224.0/24
103.200.228.0/24
103.200.232.0/24
103.201.192.0/24
103.201.196.0/24
103.201.200.0/24
@@ -1410,7 +1406,8 @@
103.236.52.0/22
103.236.56.0/21
103.236.64.0/19
103.236.96.0/22
103.236.96.0/23
103.236.98.0/24
103.236.120.0/22
103.236.244.0/22
103.236.248.0/23
@@ -1438,7 +1435,8 @@
103.238.204.0/22
103.239.68.0/22
103.239.152.0/22
103.239.184.0/22
103.239.184.0/23
103.239.186.0/24
103.239.192.0/22
103.239.204.0/22
103.239.224.0/22
@@ -1467,6 +1465,7 @@
103.247.191.0/24
103.248.152.0/22
103.248.224.0/22
103.249.52.0/22
103.249.136.0/24
103.249.244.0/22
103.249.252.0/22
@@ -2279,6 +2278,7 @@
119.80.248.0/21
119.84.0.0/14
119.88.128.0/17
119.90.32.0/19
119.91.0.0/16
119.96.0.0/13
119.108.0.0/15
@@ -2593,6 +2593,7 @@
123.242.192.0/21
123.244.0.0/14
123.249.0.0/17
123.253.226.0/24
123.254.96.0/21
124.14.5.0/24
124.14.8.0/24
@@ -2626,7 +2627,10 @@
124.151.0.0/16
124.152.0.0/16
124.160.0.0/13
124.172.0.0/14
124.172.128.0/17
124.173.64.0/18
124.173.128.0/18
124.174.0.0/15
124.192.0.0/15
124.196.12.0/23
124.196.25.0/24
@@ -2826,6 +2830,7 @@
150.242.244.0/22
150.242.248.0/22
150.255.0.0/16
151.244.240.0/24
151.247.148.0/23
152.104.128.0/17
152.136.0.0/16
@@ -3065,7 +3070,6 @@
183.78.180.0/22
183.81.180.0/22
183.84.0.0/15
183.91.37.0/24
183.91.39.0/24
183.91.40.0/21
183.91.48.0/23
@@ -3107,9 +3111,9 @@
188.131.128.0/17
188.220.127.0/24
189.31.222.0/24
189.75.180.0/24
189.75.185.0/24
191.44.18.0/24
191.219.18.0/24
191.222.245.0/24
192.140.160.0/19
192.140.208.0/21
@@ -3133,7 +3137,6 @@
198.208.112.0/23
199.182.239.0/24
199.244.144.0/24
200.102.179.0/24
200.102.180.0/24
201.14.219.0/24
202.4.128.0/19
@@ -3167,7 +3170,6 @@
202.57.192.0/24
202.57.196.0/22
202.57.200.0/23
202.57.202.0/24
202.57.204.0/23
202.59.213.0/24
202.59.214.0/23
@@ -3731,6 +3733,7 @@
211.144.16.0/24
211.144.18.0/23
211.144.20.0/24
211.144.22.0/24
211.144.24.0/24
211.144.27.0/24
211.144.28.0/23
@@ -3853,7 +3856,8 @@
211.167.224.0/19
212.64.0.0/17
212.129.128.0/17
216.75.141.0/24
212.189.97.0/24
213.210.55.0/24
218.0.0.0/12
218.16.0.0/13
218.24.0.0/14
@@ -1 +1 @@
202607112323
202607042328
@@ -13,6 +13,7 @@
2001:dc7::/32
2001:dd8:1::/48
2001:dd9::/48
2001:df5:4740::/48
2001:df6:40::/48
2001:4510:400::/40
2001:4510:1480::/41
@@ -21,7 +22,6 @@
2400:3200::/32
2400:5280:f803::/48
2400:5a00::/32
2400:5a60:2::/48
2400:6000::/32
2400:6600::/32
2400:6e60:1301::/48
@@ -81,7 +81,6 @@
2400:95e0::/48
2400:9600:8800::/48
2400:9620::/32
2400:a040::/32
2400:a860:1::/48
2400:a860:2::/47
2400:a860:4::/47
@@ -98,15 +97,6 @@
2400:cb80:e40::/44
2400:da00::/32
2400:dd00::/28
2400:e3e0:aa00::/40
2400:e3e0:ab00::/41
2400:e3e0:ab80::/42
2400:e3e0:abc0::/43
2400:e3e0:abe0::/44
2400:e3e0:abf1::/48
2400:e3e0:abf2::/47
2400:e3e0:abf4::/46
2400:e3e0:abf8::/45
2400:e680::/32
2400:ee00::/32
2400:f6e0::/32
@@ -288,7 +278,6 @@
2403:ac00::/32
2403:b400::/32
2403:c980::/32
2403:cec0::/32
2403:d400::/32
2403:e7c0:3::/48
2403:f4c0::/48
@@ -383,12 +372,12 @@
2406:840:e080::/44
2406:840:e0cf::/48
2406:840:e0e0::/46
2406:840:e0e4::/47
2406:840:e0e8::/48
2406:840:e10f::/48
2406:840:e14f::/48
2406:840:e330::/44
2406:840:e600::/44
2406:840:e620::/48
2406:840:e620::/47
2406:840:e80f::/48
2406:840:eb01::/48
2406:840:eb02::/47
@@ -400,6 +389,7 @@
2406:840:ee44::/48
2406:840:ee4b::/48
2406:840:ee4d::/48
2406:840:eee5::/48
2406:840:f380::/44
2406:840:f44f::/48
2406:840:f860::/46
@@ -409,49 +399,17 @@
2406:840:fa01::/48
2406:840:fa40::/48
2406:840:fa60::/44
2406:840:fc10::/47
2406:840:fc12::/48
2406:840:fc20::/47
2406:840:fc22::/48
2406:840:fc30::/47
2406:840:fc32::/48
2406:840:fc40::/47
2406:840:fc42::/48
2406:840:fc50::/47
2406:840:fc52::/48
2406:840:fc60::/47
2406:840:fc62::/48
2406:840:fc70::/47
2406:840:fc72::/48
2406:840:fc90::/47
2406:840:fc92::/48
2406:840:fca0::/47
2406:840:fca2::/48
2406:840:fcb0::/47
2406:840:fcb2::/48
2406:840:fc10::/44
2406:840:fc20::/43
2406:840:fc40::/42
2406:840:fc90::/44
2406:840:fca0::/43
2406:840:fcd0::/48
2406:840:fcf0::/46
2406:840:fcf4::/47
2406:840:fd30::/48
2406:840:fd37::/48
2406:840:fd40::/48
2406:840:fd46::/47
2406:840:fd48::/48
2406:840:fd50::/48
2406:840:fd56::/47
2406:840:fd58::/48
2406:840:fd60::/48
2406:840:fd66::/47
2406:840:fd68::/48
2406:840:fd70::/48
2406:840:fd76::/47
2406:840:fd78::/48
2406:840:fd80::/48
2406:840:fd86::/47
2406:840:fd88::/48
2406:840:fd90::/47
2406:840:fd92::/48
2406:840:fd9f::/48
2406:840:fd30::/44
2406:840:fd40::/42
2406:840:fd80::/43
2406:840:fda0::/48
2406:840:fda7::/48
2406:840:fdb0::/48
@@ -476,7 +434,6 @@
2406:840:feca::/47
2406:840:fecf::/48
2406:840:fed1::/48
2406:840:fed7::/48
2406:840:fed8::/48
2406:840:fedb::/48
2406:840:fedc::/47
@@ -554,6 +511,7 @@
2408:4008::/29
2408:4010::/30
2408:4014::/31
2408:4016:1::/48
2408:4016:2::/47
2408:4016:4::/46
2408:4016:8::/45
@@ -1261,7 +1219,29 @@
240d:4000::/21
240e::/21
240e:800::/24
240e:900::/25
240e:900::/26
240e:940::/27
240e:960::/28
240e:970::/29
240e:978::/30
240e:97c::/32
240e:97d::/33
240e:97d:8001::/48
240e:97d:8002::/47
240e:97d:8004::/46
240e:97d:8008::/45
240e:97d:8010::/44
240e:97d:8020::/43
240e:97d:8040::/42
240e:97d:8080::/41
240e:97d:8100::/40
240e:97d:8200::/39
240e:97d:8400::/38
240e:97d:8800::/37
240e:97d:9000::/36
240e:97d:a000::/35
240e:97d:c000::/34
240e:97e::/31
240e:980::/31
240e:982::/32
240e:983::/35
@@ -1296,7 +1276,6 @@
240e:c00::/22
2602:f92a:a460::/48
2602:f92a:a462::/48
2602:f92a:a468::/48
2602:f92a:a46d::/48
2602:f92a:a47d::/48
2602:f9ba:a8::/48
@@ -1347,9 +1326,6 @@
2a06:3600:fc00::/38
2a06:3605::/32
2a06:3606::/31
2a06:9f81:4600::/42
2a06:9f81:4640::/43
2a06:9f81:4660::/44
2a06:a005:260::/43
2a06:a005:280::/43
2a06:a005:2a0::/44
@@ -1360,15 +1336,14 @@
2a0a:d681:fc00::/38
2a0a:d685:1ff::/48
2a0a:d685:200::/47
2a0a:d685:300::/40
2a0a:d685:300::/48
2a0a:d687:f001::/48
2a0a:d687:f004::/47
2a0a:d687:f007::/48
2a0a:d687:f008::/48
2a0c:b641:571::/48
2a0e:4005:ff13::/48
2a0e:4005:ff12::/47
2a0e:4005:ff20::/48
2a0e:4005:ff41::/48
2a0e:aa06::/40
2a0e:aa06:440::/48
2a0e:aa06:450::/44
@@ -1377,11 +1352,8 @@
2a0e:aa07:e144::/48
2a0e:aa07:e146::/48
2a0e:aa07:e148::/48
2a0e:aa07:e280::/47
2a0e:aa07:e284::/46
2a0e:aa07:e288::/46
2a0e:aa07:e28d::/48
2a0e:aa07:f0d0::/46
2a0e:aa07:f0d4::/47
2a0e:aa07:f0d8::/48
2a0e:aa07:f0de::/47
2a0e:b107:740::/44
@@ -1396,12 +1368,11 @@
2a0f:1cc5:600::/47
2a0f:1cc5:603::/48
2a0f:1cc5:642::/48
2a0f:1cc5:661::/48
2a0f:1cc5:662::/48
2a0f:1cc5:6a0::/48
2a0f:1cc5:f00::/46
2a0f:1cc5:f05::/48
2a0f:1cc5:f06::/47
2a0f:1cc5:f08::/47
2a0f:1cc5:6a0::/47
2a0f:1cc5:f00::/45
2a0f:1cc5:f09::/48
2a0f:1cc5:fff::/48
2a0f:1cc5:1000::/48
2a0f:1cc5:1010::/44
@@ -1409,33 +1380,23 @@
2a0f:1cc5:1034::/47
2a0f:1cc5:1c00::/47
2a0f:1cc5:1c02::/48
2a0f:1cc5:1c20::/48
2a0f:1cc5:1c30::/48
2a0f:1cc5:1cc0::/48
2a0f:1cc5:2000::/40
2a0f:1cc5:2510::/44
2a0f:1cc5:2520::/44
2a0f:1cc5:2600::/41
2a0f:1cc5:2680::/42
2a0f:1cc5:2d01::/48
2a0f:1cc5:2d03::/48
2a0f:1cc5:4508::/46
2a0f:1cc5:45ff::/48
2a0f:1cc5:4700::/40
2a0f:1cc5:3200::/46
2a0f:1cc5:3222::/48
2a0f:1cc6:b110::/47
2a0f:1cc6:b210::/47
2a0f:1cc6:b212::/48
2a0f:2706::/32
2a0f:6284:4c00::/43
2a0f:6284:4c20::/44
2a0f:6284:4c30::/48
2a0f:6284:4c40::/43
2a0f:6284:4c60::/44
2a0f:6284:4c80::/43
2a0f:6284:4ca0::/44
2a0f:6284:4cc0::/43
2a0f:85c1:bfe::/48
2a0f:9400:6110::/48
2a12:cb41::/44
2a12:cb41:1300::/44
2a12:cb41:1200::/44
2a12:cb41:1300::/43
2a12:cb41:13f0::/44
2a12:cb46::/36
2a12:cb47:ffff::/48
@@ -1449,7 +1410,6 @@
2a13:9500:194::/48
2a13:a5c3:ff41::/48
2a13:a5c3:ff50::/44
2a13:aac4:f000::/44
2a14:67c1:a110::/48
2a14:67c1:a112::/47
2a14:67c1:a114::/46
@@ -1473,11 +1433,12 @@
2a14:67c2:a50::/48
2a14:67c2:a70::/47
2a14:67c2:a90::/48
2a14:67c3:30::/44
2a14:67c3:c0::/48
2a14:67c3:1100::/47
2a14:7580:740::/44
2a14:7580:fffa::/48
2a14:7581:ffb::/48
2a14:7583:efff::/48
2a14:7583:f220::/43
2a14:7583:f240::/42
2a14:7583:f411::/48
@@ -1492,17 +1453,12 @@
2a14:7583:f743::/48
2a14:7583:f744::/48
2a14:7583:f764::/48
2a14:7586:6101::/48
2a14:7586:6100::/47
2a14:7586:6103::/48
2a14:7586:6104::/46
2a14:7586:6108::/48
2a14:7586:6110::/48
2a14:7586:6113::/48
2a14:7586:6300::/44
2a14:7586:6500::/48
2a14:7dc0:506::/48
2a14:ae00:50::/44
2a14:c380:21::/48
2c0f:f7a8:8011::/48
2c0f:f7a8:8050::/48
2c0f:f7a8:805f::/48
@@ -1 +1 @@
202607112323
202607042328
File diff suppressed because it is too large. Load diff
@@ -1 +1 @@
202607112323
202607042328
@@ -1 +1 @@
202607112323
202607042328
@@ -63,7 +63,7 @@ const ntp_server = uci.get(uciconfig, uciinfra, 'ntp_server') || 'time.apple.com
const ipv6_support = uci.get(uciconfig, ucimain, 'ipv6_support') || '0';
let main_node, main_udp_node, dedicated_udp_node, default_outbound, default_outbound_dns,
domain_strategy, sniff_override, dns_server, china_dns_server, dns_default_strategy,
domain_strategy, dns_server, china_dns_server, dns_default_strategy,
dns_default_server, dns_disable_cache, dns_disable_cache_expire, dns_independent_cache,
dns_client_subnet, cache_file_store_rdrc, cache_file_rdrc_timeout, direct_domain_list,
proxy_domain_list;
@@ -92,7 +92,6 @@ if (routing_mode !== 'custom') {
if (proxy_domain_list)
proxy_domain_list = split(proxy_domain_list, /[\r\n]/);
sniff_override = uci.get(uciconfig, uciinfra, 'sniff_override') || '1';
} else {
/* DNS settings */
dns_default_strategy = uci.get(uciconfig, ucidnssetting, 'default_strategy');
@@ -108,7 +107,6 @@ if (routing_mode !== 'custom') {
default_outbound = uci.get(uciconfig, uciroutingsetting, 'default_outbound') || 'nil';
default_outbound_dns = uci.get(uciconfig, uciroutingsetting, 'default_outbound_dns') || 'default-dns';
domain_strategy = uci.get(uciconfig, uciroutingsetting, 'domain_strategy');
sniff_override = uci.get(uciconfig, uciroutingsetting, 'sniff_override');
}
const proxy_mode = uci.get(uciconfig, ucimain, 'proxy_mode') || 'redirect_tproxy',
@@ -216,7 +214,6 @@ function get_outbound(cfg) {
return outbounds;
} else {
switch (cfg) {
case 'block-out':
case 'direct-out':
return cfg;
default:
@@ -388,9 +385,9 @@ if (!isEmpty(main_node)) {
enabled: true,
server_name: cfg.tls_sni
} : null,
domain_resolver: (cfg.address_resolver || cfg.address_strategy) ? {
server: get_resolver(cfg.address_resolver || dns_default_server),
strategy: cfg.address_strategy
domain_resolver: (cfg.domain_resolver || cfg.domain_strategy) ? {
server: get_resolver(cfg.domain_resolver || dns_default_server),
strategy: cfg.domain_strategy
} : null,
detour: outbound
});
@@ -508,10 +505,6 @@ config.outbounds = [
type: 'direct',
tag: 'direct-out',
routing_mark: strToInt(self_mark)
},
{
type: 'block',
tag: 'block-out'
}
];
@@ -835,7 +828,10 @@ if (!isEmpty(main_node)) {
});
});
config.route.final = get_outbound(default_outbound);
if (default_outbound === 'reject')
push(config.route.rules, { action: 'reject' });
else
config.route.final = get_outbound(default_outbound);
/* Rule set */
uci.foreach(uciconfig, uciruleset, (cfg) => {
@@ -59,6 +59,16 @@ if (!isEmpty(uci.get(uciconfig, uciinfra, 'tun_gso')))
if (!isEmpty(uci.get(uciconfig, ucirouting, 'endpoint_independent_nat')))
uci.delete(uciconfig, ucirouting, 'endpoint_independent_nat');
/* legacy inbound sniff fields were replaced by route actions */
if (!isEmpty(uci.get(uciconfig, uciinfra, 'sniff_override')))
uci.delete(uciconfig, uciinfra, 'sniff_override');
if (!isEmpty(uci.get(uciconfig, ucirouting, 'sniff_override')))
uci.delete(uciconfig, ucirouting, 'sniff_override');
/* block-out was replaced by the reject route action */
if (uci.get(uciconfig, ucirouting, 'default_outbound') === 'block-out')
uci.set(uciconfig, ucirouting, 'default_outbound', 'reject');
/* create migration section */
if (!uci.get(uciconfig, ucimigration))
uci.set(uciconfig, ucimigration, uciconfig);
@@ -87,6 +97,15 @@ if (uci.get(uciconfig, 'experimental'))
/* block-dns was removed from built-in dns servers */
const default_dns_server = uci.get(uciconfig, ucidns, 'default_server');
/* dns_strategy was renamed to default_strategy */
const legacy_dns_strategy = uci.get(uciconfig, ucidns, 'dns_strategy');
if (!isEmpty(legacy_dns_strategy)) {
if (isEmpty(uci.get(uciconfig, ucidns, 'default_strategy')))
uci.set(uciconfig, ucidns, 'default_strategy', legacy_dns_strategy);
uci.delete(uciconfig, ucidns, 'dns_strategy');
}
if (default_dns_server === 'block-dns') {
/* append a rule at last to block all DNS queries */
uci.set(uciconfig, '_migration_dns_final_block', ucidnsrule);
@@ -95,11 +114,24 @@ if (default_dns_server === 'block-dns') {
uci.set(uciconfig, '_migration_dns_final_block', 'mode', 'default');
uci.set(uciconfig, '_migration_dns_final_block', 'action', 'reject');
uci.set(uciconfig, ucidns, 'default_server', 'default-dns');
}
} else if (default_dns_server === 'local-dns')
uci.set(uciconfig, ucidns, 'default_server', 'default-dns');
const dns_server_migration = {};
/* DNS servers options */
uci.foreach(uciconfig, ucidnsserver, (cfg) => {
/* legacy DNS server resolver fields were moved into dial fields */
if (!isEmpty(cfg.address_resolver)) {
if (isEmpty(cfg.domain_resolver))
uci.set(uciconfig, cfg['.name'], 'domain_resolver', cfg.address_resolver);
uci.delete(uciconfig, cfg['.name'], 'address_resolver');
}
if (!isEmpty(cfg.address_strategy)) {
if (isEmpty(cfg.domain_strategy))
uci.set(uciconfig, cfg['.name'], 'domain_strategy', cfg.address_strategy);
uci.delete(uciconfig, cfg['.name'], 'address_strategy');
}
/* legacy format was deprecated in sb 1.12 */
if (cfg.address) {
const addr = parseURL((!match(cfg.address, /:\/\//) ? 'udp://' : '') + (validation('ip6addr', cfg.address) ? `[${cfg.address}]` : cfg.address));
@@ -38,7 +38,7 @@ const allow_insecure = uci.get(uciconfig, ucisubscription, 'allow_insecure') ||
user_agent = uci.get(uciconfig, ucisubscription, 'user_agent'),
via_proxy = uci.get(uciconfig, ucisubscription, 'update_via_proxy') || '0';
const routing_mode = uci.get(uciconfig, ucimain, 'routing_mode') || 'bypass_mainalnd_china';
const routing_mode = uci.get(uciconfig, ucimain, 'routing_mode') || 'bypass_mainland_china';
let main_node, main_udp_node;
if (routing_mode !== 'custom') {
main_node = uci.get(uciconfig, ucimain, 'main_node') || 'nil';
@@ -31,6 +31,14 @@ const RESOURCE_SOURCES = {
china_list: 'https://cdn.jsdelivr.net/gh/Loyalsoldier/surge-rules@release/direct.txt',
gfw_list: 'https://cdn.jsdelivr.net/gh/Loyalsoldier/surge-rules@release/gfw.txt'
};
const CONNECTION_SITES = {
baidu: 'https://www.baidu.com/',
bilibili: 'https://www.bilibili.com/',
jd: 'https://www.jd.com/',
google: 'https://www.google.com/',
github: 'https://github.com/',
youtube: 'https://www.youtube.com/'
};
const methods = {
acllist_read: {
@@ -151,20 +159,57 @@ const methods = {
connection_check: {
args: { site: 'site' },
call: function(req) {
let url;
switch(req.args?.site) {
case 'baidu':
url = 'https://www.baidu.com';
break;
case 'google':
url = 'https://www.google.com';
break;
default:
const requested_site = req.args?.site;
if (requested_site !== 'all' && !CONNECTION_SITES[requested_site])
return { result: false, error: 'illegal site' };
break;
const sites = (requested_site === 'all') ? keys(CONNECTION_SITES) : [ requested_site ];
let commands = [];
for (let site in sites) {
push(commands, sprintf(
'/usr/bin/curl --location --silent --output /dev/null --user-agent %s --connect-timeout 5 --max-time 9 --write-out %s %s',
shellquote('Mozilla/5.0'),
shellquote(sprintf('%s\\t%%{http_code}\\t%%{time_total}\\n', site)),
shellquote(CONNECTION_SITES[site])
));
}
return { result: (system(`/usr/bin/wget --spider -qT3 ${url} 2>"/dev/null"`, 3100) === 0) };
const fd = popen(sprintf('(%s & wait) 2>"/dev/null"', join(' & ', commands)));
if (!fd)
return { result: false, error: 'failed to execute connection test' };
let payload = '', line;
while (true) {
line = fd.read('line');
if (line === null || line === '')
break;
payload += line;
}
fd.close();
const responses = {};
for (let response in split(trim(payload), /[\r\n]+/)) {
const fields = split(response, '\t');
if (length(fields) !== 3 || !CONNECTION_SITES[fields[0]])
continue;
const time_parts = split(fields[2], '.');
const fraction = ((time_parts[1] || '') + '000');
const latency_ms = int(time_parts[0] || '0') * 1000 + int(substr(fraction, 0, 3));
const http_code = int(fields[1] || '0');
responses[fields[0]] = {
site: fields[0],
result: http_code >= 100 && http_code <= 599,
latency_ms,
timed_out: http_code === 0 && latency_ms >= 8900
};
}
let results = [];
for (let site in sites)
push(results, responses[site] || { site, result: false, latency_ms: 0, timed_out: false });
return { results };
}
},
@@ -456,20 +501,25 @@ const methods = {
output: log_path,
timestamp: true
},
dns: {
servers: [
{
type: 'local',
tag: 'local-dns'
}
]
},
outbounds: [
{
type: 'direct',
tag: 'direct-out'
},
{
type: 'block',
tag: 'block-out'
}
],
endpoints: [],
route: {
final: selected_tag,
auto_detect_interface: true
auto_detect_interface: true,
default_domain_resolver: 'local-dns'
},
experimental: {
clash_api: {
+1 -1
View File
@@ -4,7 +4,7 @@ LUCI_TITLE:=luci-app-ssr-plus
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=196
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \