Compare commits

...

11 Commits

Author SHA1 Message Date
remittor
71eccc6057 Bump version to v0.7.20251226 2025-12-26 09:00:21 +03:00
remittor
5f92425261 luci: Rename handleSave to handleSaveAdv 2025-12-26 08:58:30 +03:00
remittor
950672426c updater: Update func download_releases_info 2025-12-26 08:56:45 +03:00
remittor
d0c49a8e6f def-cfg: Add new strategy v2_by_Schiz23 2025-12-26 08:03:58 +03:00
remittor
2da0526472 Bump version to v0.7.20251225-r2 2025-12-25 18:06:29 +03:00
remittor
c9823adaae luci: tools: Fix show and close modal dialog for NFQWS_OPT 2025-12-25 18:01:29 +03:00
remittor
d14f26a8cb updater: Fix find base package after ZIP unpack 2025-12-25 14:54:49 +03:00
remittor
ecf49f1be8 Bump version to v0.7.20251225 2025-12-25 09:01:37 +03:00
remittor
3ef469b416 fake: Add TLS 1.3 hello from max.ru 2025-12-25 08:25:52 +03:00
remittor
88665d417a luci: tools: Fix close modal dialog for NFQWS2_OPT 2025-12-24 18:49:41 +03:00
remittor
35fb6e9a43 luci: updater: Fix timer using 2025-12-24 14:38:07 +03:00
9 changed files with 85 additions and 43 deletions

View File

@@ -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>

View File

@@ -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);
})
},
}),

View File

@@ -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);
},

View File

@@ -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?

View File

@@ -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?

View File

@@ -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?

View File

@@ -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
}

Binary file not shown.

View File

@@ -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"