mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-03 15:18:50 +03:00
Compare commits
17 Commits
v0.7.20251
...
v0.8.20251
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9717bc8ff7 | ||
|
|
61e234ab12 | ||
|
|
c11ca1ca2e | ||
|
|
dd35b5d50a | ||
|
|
072b742a13 | ||
|
|
487d92bda2 | ||
|
|
71eccc6057 | ||
|
|
5f92425261 | ||
|
|
950672426c | ||
|
|
d0c49a8e6f | ||
|
|
2da0526472 | ||
|
|
c9823adaae | ||
|
|
d14f26a8cb | ||
|
|
ecf49f1be8 | ||
|
|
3ef469b416 | ||
|
|
88665d417a | ||
|
|
35fb6e9a43 |
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -205,7 +205,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
PKGDIR=$GITHUB_WORKSPACE/zapret-openwrt
|
||||
MKFN=$PKGDIR/luci-app-zapret/Makefile
|
||||
MKFN=$PKGDIR/luci-app-zapret2/Makefile
|
||||
PKGVER=$( grep -s '^PKG_VERSION:=.*' $MKFN | cut -d'=' -f2 )
|
||||
PKGREL=$( grep -s '^PKG_RELEASE:=.*' $MKFN | cut -d'=' -f2 )
|
||||
[ "$PKGREL" != "1" ] && PKGVER=$PKGVER-r$PKGREL
|
||||
@@ -249,9 +249,9 @@ jobs:
|
||||
cat .config
|
||||
echo "------------- .config END -------------------"
|
||||
if [ "$ARCH" = "$LUCI_ARCH" ]; then
|
||||
PKGLIST=`echo package/zapret-openwrt/{zapret,zapret-mdig,zapret-ip2net,luci-app-zapret}/compile`
|
||||
PKGLIST=`echo package/zapret-openwrt/{zapret2,zapret2-mdig,zapret2-ip2net,luci-app-zapret2}/compile`
|
||||
else
|
||||
PKGLIST=`echo package/zapret-openwrt/{zapret,zapret-mdig,zapret-ip2net}/compile`
|
||||
PKGLIST=`echo package/zapret-openwrt/{zapret2,zapret2-mdig,zapret2-ip2net}/compile`
|
||||
fi
|
||||
if [ "$MAX_SPEED" = "false" ]; then
|
||||
make $PKGLIST V=s CONFIG_CCACHE=1 BUILD_LOG=1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zapret2
|
||||
PKG_VERSION:=0.7.20251224
|
||||
PKG_VERSION:=0.8.20251229
|
||||
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,32 +543,33 @@ return baseclass.extend({
|
||||
}
|
||||
value = value.replace(/˂/g, '<');
|
||||
value = value.replace(/˃/g, '>');
|
||||
let elem = document.getElementById("cbi-zapret-" + this.cfgsec + "-_" + this.cfgparam);
|
||||
if (elem) {
|
||||
let val = value.trim();
|
||||
if (this.multiline) {
|
||||
val = val.replace(/</g, '˂');
|
||||
val = val.replace(/>/g, '˃');
|
||||
val = val.replace(/\n/g, '<br/>');
|
||||
elem.querySelector('div').innerHTML = val;
|
||||
} else {
|
||||
elem.querySelector('div').textContent = val;
|
||||
try {
|
||||
let elem2 = null;
|
||||
let elem = document.getElementById("cbi-zapret-" + this.cfgsec + "-_" + this.cfgparam);
|
||||
if (elem) {
|
||||
if (!elem2) {
|
||||
elem2 = elem.querySelector('div');
|
||||
}
|
||||
if (!elem2) {
|
||||
elem2 = elem.querySelector('output');
|
||||
}
|
||||
}
|
||||
if (elem2) {
|
||||
let val = value.trim();
|
||||
if (this.multiline) {
|
||||
val = val.replace(/</g, '˂');
|
||||
val = val.replace(/>/g, '˃');
|
||||
val = val.replace(/\n/g, '<br/>');
|
||||
elem2.innerHTML = val;
|
||||
} else {
|
||||
elem2.textContent = val;
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
console.error('ERROR: cannot found elem for ' + this.cfgparam);
|
||||
}
|
||||
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 +588,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.8.20251229
|
||||
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:=71b87f749d8c372486c3177087cb623ec0b5ad87
|
||||
PKG_SOURCE_DATE:=2025-12-29
|
||||
|
||||
#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.8.20251229
|
||||
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:=71b87f749d8c372486c3177087cb623ec0b5ad87
|
||||
PKG_SOURCE_DATE:=2025-12-29
|
||||
|
||||
#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.8.20251229
|
||||
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:=71b87f749d8c372486c3177087cb623ec0b5ad87
|
||||
PKG_SOURCE_DATE:=2025-12-29
|
||||
|
||||
#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?
|
||||
@@ -64,7 +64,7 @@ endef
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(TARGET_CONFIGURE_OPTS) LUA_CFLAGS="$(LUA_INCLUDE)" LUA_LIB="$(LUA_LIBRARY)"
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(TARGET_CONFIGURE_OPTS) LUA_JIT=$(LUA_JIT) LUA_CFLAGS="$(LUA_INCLUDE)" LUA_LIB="$(LUA_LIBRARY)"
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
@@ -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
zapret2/files/fake/tls_clienthello_max_ru.bin
Normal file
BIN
zapret2/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"
|
||||
@@ -342,7 +352,7 @@ if [ "$opt_update" != "" ]; then
|
||||
fi
|
||||
fi
|
||||
ZAP_PKG_DIR=/tmp/zapret2_pkg
|
||||
rm -rf $ZAP_PKG_DIR
|
||||
rm -rf $ZAP_PKG_DIR 2>/dev/null
|
||||
ZAP_PKG_HDRS=$( curl -s -I -L --max-time $CURL_TIMEOUT -H "$CURL_HEADER2" "$ZAP_PKG_URL" )
|
||||
ZAP_PKG_SIZE=$( echo "$ZAP_PKG_HDRS" | grep -i 'content-length: ' | tail -n1 | awk '{print $2}' | tr -d '\r' )
|
||||
echo "Downloded ZIP-file size = $ZAP_PKG_SIZE bytes"
|
||||
@@ -368,30 +378,34 @@ if [ "$opt_update" != "" ]; then
|
||||
return 218
|
||||
fi
|
||||
unzip -q "$ZAP_PKG_FN" -d $ZAP_PKG_DIR
|
||||
rm -f "$ZAP_PKG_FN"
|
||||
rm -f "$ZAP_PKG_FN" 2>/dev/null
|
||||
if [ "$PKG_MGR" = "apk" ]; then
|
||||
if [ ! -d "$ZAP_PKG_DIR/apk" ]; then
|
||||
echo "ERROR: APK-files not founded"
|
||||
return 221
|
||||
fi
|
||||
rm -f "$ZAP_PKG_DIR/*.ipk"
|
||||
mv "$ZAP_PKG_DIR/apk/*" "$ZAP_PKG_DIR/"
|
||||
rm -f $ZAP_PKG_DIR/*.ipk 2>/dev/null
|
||||
mv $ZAP_PKG_DIR/apk/* $ZAP_PKG_DIR/
|
||||
else
|
||||
rm -rf "$ZAP_PKG_DIR/apk"
|
||||
rm -rf $ZAP_PKG_DIR/apk 2>/dev/null
|
||||
fi
|
||||
ZAP_PKG_LIST=$( ls -1 "$ZAP_PKG_DIR" )
|
||||
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