mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-03 15:18:50 +03:00
Compare commits
11 Commits
v0.7.20251
...
v0.7.20251
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71eccc6057 | ||
|
|
5f92425261 | ||
|
|
950672426c | ||
|
|
d0c49a8e6f | ||
|
|
2da0526472 | ||
|
|
c9823adaae | ||
|
|
d14f26a8cb | ||
|
|
ecf49f1be8 | ||
|
|
3ef469b416 | ||
|
|
88665d417a | ||
|
|
35fb6e9a43 |
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zapret2
|
||||
PKG_VERSION:=0.7.20251224
|
||||
PKG_VERSION:=0.7.20251226
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||
|
||||
@@ -403,13 +403,13 @@ return baseclass.extend({
|
||||
E('button', {
|
||||
'id': 'btn_save',
|
||||
'class': 'btn cbi-button-positive important',
|
||||
'click': ui.createHandlerFn(this, this.handleSave),
|
||||
'click': ui.createHandlerFn(this, this.handleSaveAdv),
|
||||
}, _('Save')),
|
||||
]),
|
||||
]);
|
||||
},
|
||||
|
||||
handleSave: function(ev) {
|
||||
handleSaveAdv: function(ev) {
|
||||
let txt = document.getElementById('widget.modal_content');
|
||||
let value = txt.value.trim().replace(/\r\n/g, '\n') + '\n';
|
||||
|
||||
@@ -514,13 +514,13 @@ return baseclass.extend({
|
||||
E('button', {
|
||||
'id': 'btn_save',
|
||||
'class': 'btn cbi-button-positive important',
|
||||
'click': ui.createHandlerFn(this, this.handleSave),
|
||||
'click': ui.createHandlerFn(this, this.handleSaveAdv),
|
||||
}, _('Save')),
|
||||
]),
|
||||
]);
|
||||
},
|
||||
|
||||
handleSave: function(ev) {
|
||||
handleSaveAdv: function(ev) {
|
||||
let txt = document.getElementById('widget.modal_content');
|
||||
let value = txt.value.trim();
|
||||
if (this.multiline) {
|
||||
@@ -543,7 +543,7 @@ return baseclass.extend({
|
||||
}
|
||||
value = value.replace(/˂/g, '<');
|
||||
value = value.replace(/˃/g, '>');
|
||||
let elem = document.getElementById("cbi-zapret-" + this.cfgsec + "-_" + this.cfgparam);
|
||||
let elem = document.getElementById("cbi-zapret2-" + this.cfgsec + "-_" + this.cfgparam);
|
||||
if (elem) {
|
||||
let val = value.trim();
|
||||
if (this.multiline) {
|
||||
@@ -555,20 +555,8 @@ return baseclass.extend({
|
||||
elem.querySelector('div').textContent = val;
|
||||
}
|
||||
}
|
||||
uci.set('zapret', this.cfgsec, this.cfgparam, value);
|
||||
uci.save().then(() => window.location.reload());
|
||||
/*
|
||||
return uci.save()
|
||||
.then(L.bind(ui.changes.init, ui.changes))
|
||||
.then(L.bind(ui.changes.displayChanges, ui.changes))
|
||||
//.then(L.bind(ui.changes.apply, ui.changes))
|
||||
.then(ui.addNotification(null, E('p', _('Contents have been saved.')), 'info'))
|
||||
.catch(e => {
|
||||
ui.addNotification(null, E('p', _('Unable to save the contents') + ': %s'.format(e.message)));
|
||||
}).finally(() => {
|
||||
ui.hideModal();
|
||||
});
|
||||
*/
|
||||
uci.set('zapret2', this.cfgsec, this.cfgparam, value);
|
||||
uci.save().then(ui.hideModal);
|
||||
},
|
||||
|
||||
error: function(e) {
|
||||
@@ -587,13 +575,17 @@ return baseclass.extend({
|
||||
},
|
||||
|
||||
show: function() {
|
||||
//ui.showModal(null, E('p', { 'class': 'spinning' }, _('Loading')) );
|
||||
let content = this.load();
|
||||
//ui.hideModal();
|
||||
if (content === null) {
|
||||
return this.error('Cannot load parameter');
|
||||
}
|
||||
return this.render(content);
|
||||
ui.showModal(null,
|
||||
E('p', { 'class': 'spinning' }, _('Loading'))
|
||||
);
|
||||
L.resolveDefault(this.load(), null)
|
||||
.then(content => {
|
||||
ui.hideModal();
|
||||
return this.render(content);
|
||||
}).catch(e => {
|
||||
ui.hideModal();
|
||||
return this.error(e);
|
||||
})
|
||||
},
|
||||
}),
|
||||
|
||||
|
||||
@@ -132,7 +132,11 @@ return baseclass.extend({
|
||||
}
|
||||
let lastLen = 0;
|
||||
let retCode = -1;
|
||||
let timerBusy = false;
|
||||
let timer = setInterval(async () => {
|
||||
if (timerBusy)
|
||||
return; // skip iteration
|
||||
timerBusy = true;
|
||||
try {
|
||||
let res = await fs.exec('/bin/cat', [ logFile ], null, rpc_opt);
|
||||
if (res.stdout && res.stdout.length > lastLen) {
|
||||
@@ -169,7 +173,10 @@ return baseclass.extend({
|
||||
} catch (e) {
|
||||
clearInterval(timer);
|
||||
this.appendLog('ERROR: installUpdates: ' + e.message);
|
||||
this.appendLog('ERROR: installUpdates: ' + e.stack?.trim().split('\n').pop());
|
||||
this.setStage(999);
|
||||
} finally {
|
||||
timerBusy = false;
|
||||
}
|
||||
}, 500);
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret2-ip2net
|
||||
PKG_VERSION:=0.7.20251224
|
||||
PKG_VERSION:=0.7.20251226
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
@@ -10,8 +10,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret2.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=505e8ff82ca92457d18daf90671d0f589929405b
|
||||
PKG_SOURCE_DATE:=2025-12-24
|
||||
PKG_SOURCE_VERSION:=9e2222549e7c2eee6f4827f7c36fb7e7c3a07b4c
|
||||
PKG_SOURCE_DATE:=2025-12-26
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret2/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret2-mdig
|
||||
PKG_VERSION:=0.7.20251224
|
||||
PKG_VERSION:=0.7.20251226
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
@@ -10,8 +10,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret2.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=505e8ff82ca92457d18daf90671d0f589929405b
|
||||
PKG_SOURCE_DATE:=2025-12-24
|
||||
PKG_SOURCE_VERSION:=9e2222549e7c2eee6f4827f7c36fb7e7c3a07b4c
|
||||
PKG_SOURCE_DATE:=2025-12-26
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret2/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret2
|
||||
PKG_VERSION:=0.7.20251224
|
||||
PKG_VERSION:=0.7.20251226
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
@@ -14,8 +14,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret2.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=505e8ff82ca92457d18daf90671d0f589929405b
|
||||
PKG_SOURCE_DATE:=2025-12-24
|
||||
PKG_SOURCE_VERSION:=9e2222549e7c2eee6f4827f7c36fb7e7c3a07b4c
|
||||
PKG_SOURCE_DATE:=2025-12-26
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret2/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@@ -130,6 +130,35 @@ function set_cfg_nfqws_strat
|
||||
commit $cfgname
|
||||
EOF
|
||||
fi
|
||||
if [ "$strat" = "v2_by_Schiz23" ]; then
|
||||
uci batch <<-EOF
|
||||
set $cfgname.config.NFQWS2_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS2_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS2_OPT="
|
||||
# Strategy $strat
|
||||
|
||||
--filter-tcp=80
|
||||
--filter-l7=http <HOSTLIST>
|
||||
--payload=http_req
|
||||
--lua-desync=fake:blob=fake_default_http:tcp_md5
|
||||
--lua-desync=multisplit:pos=method+2
|
||||
|
||||
--new
|
||||
--filter-tcp=443
|
||||
--filter-l7=tls <HOSTLIST>
|
||||
--payload=tls_client_hello
|
||||
--lua-desync=multidisorder:payload=tls_client_hello:pos=100,midsld,sniext+1,endhost-2,-10
|
||||
--lua-desync=send:sni=.microsoft
|
||||
|
||||
--new
|
||||
--filter-udp=443
|
||||
--filter-l7=quic <HOSTLIST_NOAUTO>
|
||||
--payload=quic_initial
|
||||
--lua-desync=fake:blob=fake_default_quic:repeats=4
|
||||
"
|
||||
commit $cfgname
|
||||
EOF
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
BIN
zapret/files/fake/tls_clienthello_max_ru.bin
Normal file
BIN
zapret/files/fake/tls_clienthello_max_ru.bin
Normal file
Binary file not shown.
@@ -154,14 +154,24 @@ function pkg_version_cmp
|
||||
|
||||
function download_releases_info
|
||||
{
|
||||
local txt txtlen txtlines generated_at
|
||||
local fname resp hdr txt txtlen txtlines generated_at
|
||||
REL_JSON=
|
||||
echo "Download releases info..."
|
||||
txt=$(download_json $ZAP_REL_URL)
|
||||
fname="${ZAP_REL_URL##*/}"
|
||||
resp=$( curl -s -D - --max-time $CURL_TIMEOUT -H "$CURL_HEADER1" -H "$CURL_HEADER2" "$ZAP_REL_URL" 2>/dev/null )
|
||||
hdr="${resp%%$'\r\n\r\n'*}"
|
||||
status=$( printf '%s\n' "$hdr" | head -n 1 | awk '{print $2}' )
|
||||
if [ "$status" != 200 ]; then
|
||||
echo "ERROR: Cannot download file \"$ZAP_REL_URL\" (status = $status)"
|
||||
return 103
|
||||
fi
|
||||
txtlen=$( printf '%s\n' "$hdr" | awk -F': ' 'BEGIN{IGNORECASE=1} $1=="Content-Length"{print $2}' | tr -d '\r')
|
||||
echo "Content-Length: $txtlen bytes"
|
||||
txt="${resp#*$'\r\n\r\n'}"
|
||||
txtlen=${#txt}
|
||||
txtlines=$(printf '%s\n' "$txt" | wc -l)
|
||||
if [[ $txtlen -lt 64 ]]; then
|
||||
echo "ERROR: Cannot download releases info!"
|
||||
echo "ERROR: Cannot download releases info! (size = $txtlen)"
|
||||
return 104
|
||||
fi
|
||||
echo "Releases info downloaded! Size = $txtlen, Lines = $txtlines"
|
||||
@@ -383,15 +393,19 @@ if [ "$opt_update" != "" ]; then
|
||||
echo "------ Downloaded packages:"
|
||||
echo "$ZAP_PKG_LIST"
|
||||
echo "------"
|
||||
ZAP_PKG_BASE_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "zapret2_*.${ZAP_PKG_EXT}" | head -n 1 )
|
||||
ZAP_PKG_LUCI_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "luci-app-*.${ZAP_PKG_EXT}" | head -n 1 )
|
||||
if [ "$PKG_MGR" != "apk" ]; then
|
||||
ZAP_PKG_BASE_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "zapret2_*.${ZAP_PKG_EXT}" | head -n 1 )
|
||||
else
|
||||
ZAP_PKG_BASE_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "zapret2-[0-9]*.?*.${ZAP_PKG_EXT}" | head -n 1 )
|
||||
fi
|
||||
ZAP_PKG_LUCI_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "luci-app-zapret2*.${ZAP_PKG_EXT}" | head -n 1 )
|
||||
if [ ! -f "$ZAP_PKG_BASE_FN" ]; then
|
||||
echo "ERROR: File \"zapret2_*.${ZAP_PKG_EXT}\" not found!"
|
||||
echo "ERROR: File \"zapret2*.${ZAP_PKG_EXT}\" not found!"
|
||||
return 231
|
||||
fi
|
||||
echo "ZAP_PKG_BASE_FN = $ZAP_PKG_BASE_FN"
|
||||
if [ ! -f "$ZAP_PKG_LUCI_FN" ]; then
|
||||
echo "ERROR: File \"luci-app-*.${ZAP_PKG_EXT}\" not found!"
|
||||
echo "ERROR: File \"luci-app-zapret2*.${ZAP_PKG_EXT}\" not found!"
|
||||
return 232
|
||||
fi
|
||||
echo "ZAP_PKG_LUCI_FN = $ZAP_PKG_LUCI_FN"
|
||||
|
||||
Reference in New Issue
Block a user