mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 15:35:13 +08:00
🔥 Sync 2026-04-28 00:03:12
This commit is contained in:
1 parent
b2d20762a8
commit
767a6aeb98
8 files changed
+79
-17
No files matched your search
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=26.4.15
|
||||
PKG_RELEASE:=99
|
||||
PKG_RELEASE:=100
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
@@ -1555,3 +1555,17 @@ function fetch_cert_sha256(host, port, timeout)
|
||||
if not fp then return "" end
|
||||
return fp:upper()
|
||||
end
|
||||
|
||||
function vps_domain_exclude(domain)
|
||||
if trim(domain) == "" then return true end
|
||||
local map = {
|
||||
["engage.cloudflareclient.com"] = 1,
|
||||
["google.com"] = 1, ["www.google.com"] = 1,
|
||||
["youtube.com"] = 1, ["www.youtube.com"] = 1,
|
||||
["github.com"] = 1, ["telegram.org"] = 1,
|
||||
["cloudflare.com"] = 1, ["www.cloudflare.com"] = 1,
|
||||
["bing.com"] = 1, ["www.bing.com"] = 1, ["x.com"] = 1
|
||||
}
|
||||
if map[domain] then return true end
|
||||
return false
|
||||
end
|
||||
@@ -1828,7 +1828,7 @@ function gen_config(var)
|
||||
local domain = {}
|
||||
local nodes_domain_text = sys.exec([[uci show passwall | sed -n "s/.*\.address='\([^']*\)'/\1/p" | sort -u]])
|
||||
string.gsub(nodes_domain_text, '[^' .. "\r\n" .. ']+', function(w)
|
||||
if w and w ~= "" and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then
|
||||
if not api.vps_domain_exclude(w) and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then
|
||||
table.insert(domain, w)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -1545,7 +1545,7 @@ function gen_config(var)
|
||||
local domain = {}
|
||||
local nodes_domain_text = sys.exec([[uci show passwall | sed -n "s/.*\.\(address\|download_address\)='\([^']*\)'/\2/p" | sort -u]])
|
||||
string.gsub(nodes_domain_text, '[^' .. "\r\n" .. ']+', function(w)
|
||||
if w and w ~= "" and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then
|
||||
if not api.vps_domain_exclude(w) and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then
|
||||
table.insert(domain, "full:" .. w)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -173,7 +173,7 @@ if not is_file_nonzero(file_vpslist) then
|
||||
local f_out = io.open(file_vpslist, "w")
|
||||
local written_domains = {}
|
||||
local function process_address(address)
|
||||
if address == "engage.cloudflareclient.com" then return end
|
||||
if api.vps_domain_exclude(address) then return end
|
||||
if datatypes.hostname(address) and not written_domains[address] then
|
||||
f_out:write(address .. "\n")
|
||||
written_domains[address] = true
|
||||
|
||||
@@ -371,7 +371,7 @@ function add_rule(var)
|
||||
setflag_6 .. "passwall_vps6"
|
||||
}
|
||||
local function process_address(address)
|
||||
if address == "engage.cloudflareclient.com" then return end
|
||||
if api.vps_domain_exclude(address) then return end
|
||||
if datatypes.hostname(address) then
|
||||
set_domain_dns(address, fwd_dns)
|
||||
set_domain_ipset(address, table.concat(sets, ","))
|
||||
|
||||
@@ -333,7 +333,7 @@ if not is_file_nonzero(file_vpslist) then
|
||||
local f_out = io.open(file_vpslist, "w")
|
||||
local written_domains = {}
|
||||
local function process_address(address)
|
||||
if address == "engage.cloudflareclient.com" then return end
|
||||
if api.vps_domain_exclude(address) then return end
|
||||
if datatypes.hostname(address) and not written_domains[address] then
|
||||
f_out:write(address .. "\n")
|
||||
written_domains[address] = true
|
||||
|
||||
@@ -643,18 +643,50 @@ function getDisplayCountryCode(radioNet) {
|
||||
return radioNet.getCountryCode() || uci.get('wireless', radioNet.getWifiDeviceName(), 'country') || '00';
|
||||
}
|
||||
|
||||
function getConfiguredBand(hwtype, hwmode, channel, bandval) {
|
||||
function normalizeQcaBandValue(bandval) {
|
||||
switch (String(bandval ?? '')) {
|
||||
case '1':
|
||||
return '2g';
|
||||
case '2':
|
||||
return '5g';
|
||||
case '3':
|
||||
return '6g';
|
||||
default:
|
||||
return String(bandval || '');
|
||||
}
|
||||
}
|
||||
|
||||
function getQcaBandCode(band) {
|
||||
switch (String(band || '')) {
|
||||
case '2g':
|
||||
return '1';
|
||||
case '5g':
|
||||
return '2';
|
||||
case '6g':
|
||||
return '3';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getConfiguredBand(hwtype, hwmode, channel, bandval, htmode) {
|
||||
hwmode = String(hwmode || '');
|
||||
bandval = String(bandval || '');
|
||||
htmode = String(htmode || '');
|
||||
bandval = isQcaWifiHwtype(hwtype) ? normalizeQcaBandValue(bandval) : String(bandval || '');
|
||||
channel = +channel;
|
||||
|
||||
if (bandval)
|
||||
return bandval;
|
||||
if (/^11bea/.test(hwmode))
|
||||
if (/^11bea/.test(hwmode)) {
|
||||
if (/^(?:HT|EHT)320$/.test(htmode))
|
||||
return '6g';
|
||||
return (!isNaN(channel) && channel > 0 && channel < 36) ? '6g' : '5g';
|
||||
}
|
||||
if (/^11axa/.test(hwmode))
|
||||
return (!isNaN(channel) && channel > 0 && channel < 36) ? '6g' : '5g';
|
||||
if (/^11beg|^11axg|^11ng|^11g|^11b/.test(hwmode))
|
||||
return '2g';
|
||||
if (/^11ac|^11axa|^11na|^11a/.test(hwmode))
|
||||
if (/^11ac|^11na|^11a/.test(hwmode))
|
||||
return '5g';
|
||||
if (/a/.test(hwmode))
|
||||
return '5g';
|
||||
@@ -717,8 +749,18 @@ function getFrequencyListBand(entry, hwmode) {
|
||||
return '6g';
|
||||
}
|
||||
|
||||
if (band == 2 || band == 5 || band == 6 || band == 60)
|
||||
return '%dg'.format(band);
|
||||
switch (band) {
|
||||
case 1:
|
||||
return '2g';
|
||||
case 2:
|
||||
case 5:
|
||||
return '5g';
|
||||
case 3:
|
||||
case 6:
|
||||
return '6g';
|
||||
case 60:
|
||||
return '60g';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1542,7 +1584,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
||||
}
|
||||
}
|
||||
|
||||
const configured_band = getConfiguredBand(hwtype, statuscfg.hwmode ?? hwval, devcfg.channel ?? cfg_channel, devcfg.band ?? bandval);
|
||||
const configured_band = getConfiguredBand(hwtype, statuscfg.hwmode ?? hwval, devcfg.channel ?? cfg_channel, devcfg.band ?? bandval, statuscfg.htmode ?? htval);
|
||||
const has_band_channels = (band) => {
|
||||
const channels = this.channels[band];
|
||||
const offset = (channels?.[0] == 'auto') ? 3 : 0;
|
||||
@@ -1657,7 +1699,8 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
||||
'ac': [ '5g', '5 GHz', { available: has_band_channels('5g') } ],
|
||||
'ax': [
|
||||
'2g', '2.4 GHz', { available: has_band_channels('2g') },
|
||||
'5g', '5 GHz', { available: has_band_channels('5g') }
|
||||
'5g', '5 GHz', { available: has_band_channels('5g') },
|
||||
'6g', '6 GHz', { available: has_band_channels('6g') }
|
||||
],
|
||||
'be': [
|
||||
'2g', '2.4 GHz', { available: has_band_channels('2g') },
|
||||
@@ -1919,7 +1962,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
||||
const htval = isQcaWifiHwtype(hwtype) ? (cfg_htval || devinfo.htmode) : (devinfo.htmode || cfg_htval);
|
||||
const hwval = isQcaWifiHwtype(hwtype) ? (cfg_hwval || devinfo.hwmode) : (devinfo.hwmode || cfg_hwval);
|
||||
const chval = cfg_chval || devinfo.channel;
|
||||
const bandval = cfg_bandval || getConfiguredBand(hwtype, hwval, chval, null);
|
||||
const bandval = cfg_bandval || getConfiguredBand(hwtype, hwval, chval, null, htval);
|
||||
const forceSelectValue = function(sel, value) {
|
||||
if (value == null)
|
||||
return false;
|
||||
@@ -1961,7 +2004,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
||||
|
||||
if (isQcaWifiHwtype(hwtype)) {
|
||||
this.useBandOption = true;
|
||||
this.setSelectValue(band, getConfiguredBand(hwtype, hwval, chval, bandval));
|
||||
this.setSelectValue(band, getConfiguredBand(hwtype, hwval, chval, bandval, htval));
|
||||
}
|
||||
else if (hwtype == 'mac80211') {
|
||||
this.useBandOption = true;
|
||||
@@ -2090,6 +2133,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
||||
|
||||
if (isQcaWifiHwtype(hwtype)) {
|
||||
let hwmode = getValue('hwmode');
|
||||
const qcaBand = (hwtype == 'qcawificfg80211') ? getQcaBandCode(band) : null;
|
||||
|
||||
if (hwtype == 'qcawifi') {
|
||||
if (mode == 'ac')
|
||||
@@ -2115,7 +2159,11 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
||||
}
|
||||
|
||||
setValue('hwmode', hwmode);
|
||||
unsetValue('band');
|
||||
|
||||
if (hwtype == 'qcawificfg80211' && qcaBand != null)
|
||||
setValue('band', qcaBand);
|
||||
else
|
||||
unsetValue('band');
|
||||
}
|
||||
else if (this.useBandOption) {
|
||||
setValue('band', band);
|
||||
|
||||
Reference in new issue
Block a user