mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 12:50:35 +03:00
Compare commits
7 Commits
v72.202601
...
v72.202601
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce26fdff22 | ||
|
|
18cc8d4115 | ||
|
|
702fe4721d | ||
|
|
10997a443f | ||
|
|
d91f44c287 | ||
|
|
45974e191d | ||
|
|
42d8ee8ba6 |
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-zapret
|
||||
PKG_VERSION:=72.20260116
|
||||
PKG_VERSION:=72.20260117
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||
|
||||
@@ -18,14 +18,14 @@ const btn_style_success = 'btn cbi-button-success important';
|
||||
return view.extend({
|
||||
get_svc_buttons: function(elems = { }) {
|
||||
return {
|
||||
enable : elems.btn_enable || document.getElementById('btn_enable'),
|
||||
disable : elems.btn_disable || document.getElementById('btn_disable'),
|
||||
start : elems.btn_start || document.getElementById('btn_start'),
|
||||
restart : elems.btn_restart || document.getElementById('btn_restart'),
|
||||
stop : elems.btn_stop || document.getElementById('btn_stop'),
|
||||
reset : elems.btn_reset || document.getElementById('btn_reset'),
|
||||
diag : elems.btn_diag || document.getElementById('btn_diag'),
|
||||
update : elems.btn_update || document.getElementById('btn_update'),
|
||||
"enable" : elems.btn_enable || document.getElementById('btn_enable'),
|
||||
"disable" : elems.btn_disable || document.getElementById('btn_disable'),
|
||||
"start" : elems.btn_start || document.getElementById('btn_start'),
|
||||
"restart" : elems.btn_restart || document.getElementById('btn_restart'),
|
||||
"stop" : elems.btn_stop || document.getElementById('btn_stop'),
|
||||
"reset" : elems.btn_reset || document.getElementById('btn_reset'),
|
||||
"diag" : elems.btn_diag || document.getElementById('btn_diag'),
|
||||
"update" : elems.btn_update || document.getElementById('btn_update'),
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -157,7 +157,14 @@ return view.extend({
|
||||
if (multiline == 2) {
|
||||
desc += '<br/>' + _('Example') + ': <a target=_blank href=%s>%s</a>'.format(tools.nfqws_opt_url);
|
||||
}
|
||||
btn.onclick = () => new tools.longstrEditDialog('config', param, param, desc, rows, multiline).show();
|
||||
btn.onclick = () => new tools.longstrEditDialog({
|
||||
cfgsec: 'config',
|
||||
cfgparam: param,
|
||||
title: param,
|
||||
desc: desc,
|
||||
rows: rows,
|
||||
multiline: multiline,
|
||||
}).show();
|
||||
};
|
||||
|
||||
if (tools.appName == 'zapret2') {
|
||||
@@ -313,13 +320,12 @@ return view.extend({
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.autoHostListFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.autoHostListFN,
|
||||
_('Auto host list'),
|
||||
'',
|
||||
'',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.autoHostListFN,
|
||||
title: _('Auto host list'),
|
||||
desc: '',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
o = s.taboption(tabname, form.Flag, 'AUTOHOSTLIST_DEBUGLOG', _('DEBUGLOG'));
|
||||
o.rmempty = false;
|
||||
@@ -329,13 +335,12 @@ return view.extend({
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.autoHostListDbgFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.autoHostListDbgFN,
|
||||
_('Auto host debug list'),
|
||||
'',
|
||||
'',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.autoHostListDbgFN,
|
||||
title: _('Auto host debug list'),
|
||||
desc: '',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
/* HostList settings */
|
||||
|
||||
@@ -346,37 +351,37 @@ return view.extend({
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.hostsGoogleFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.hostsGoogleFN,
|
||||
_('Google hostname entries'),
|
||||
_('One hostname per line.<br />Examples:'),
|
||||
'<code>youtube.com<br />googlevideo.com</code>',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.hostsGoogleFN,
|
||||
title: _('Google hostname entries'),
|
||||
desc: _('One hostname per line.<br />Examples:'),
|
||||
aux: '<code>youtube.com<br />googlevideo.com</code>',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
o = s.taboption(tabname, form.Button, '_user_entries_btn', _('User hostname entries <HOSTLIST>'));
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.hostsUserFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.hostsUserFN,
|
||||
_('User entries'),
|
||||
_('One hostname per line.<br />Examples:'),
|
||||
'<code>domain.net<br />sub.domain.com<br />facebook.com</code>',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.hostsUserFN,
|
||||
title: _('User entries'),
|
||||
desc: _('One hostname per line.<br />Examples:'),
|
||||
aux: '<code>domain.net<br />sub.domain.com<br />facebook.com</code>',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
o = s.taboption(tabname, form.Button, '_user_excluded_entries_btn', _('User excluded hostname entries'));
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.hostsUserExcludeFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.hostsUserExcludeFN,
|
||||
_('User excluded entries'),
|
||||
_('One hostname per line.<br />Examples:'),
|
||||
'<code>domain.net<br />sub.domain.com<br />gosuslugi.ru</code>',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.hostsUserExcludeFN,
|
||||
title: _('User excluded entries'),
|
||||
desc: _('One hostname per line.<br />Examples:'),
|
||||
aux: '<code>domain.net<br />sub.domain.com<br />gosuslugi.ru</code>',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
add_delim(s);
|
||||
|
||||
@@ -384,37 +389,37 @@ return view.extend({
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.iplstExcludeFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.iplstExcludeFN,
|
||||
_('Excluded IP filter'),
|
||||
_('Patterns can be strings or regular expressions. Each pattern in a separate line<br />Examples:'),
|
||||
'<code>128.199.0.0/16<br />34.217.90.52<br />162.13.190.77</code>',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.iplstExcludeFN,
|
||||
title: _('Excluded IP filter'),
|
||||
desc: _('Patterns can be strings or regular expressions. Each pattern in a separate line<br />Examples:'),
|
||||
aux: '<code>128.199.0.0/16<br />34.217.90.52<br />162.13.190.77</code>',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
o = s.taboption(tabname, form.Button, '_user_ip_filter_btn', _('User IP entries'));
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.iplstUserFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.iplstUserFN,
|
||||
_('User IP filter'),
|
||||
_('Patterns can be strings or regular expressions. Each pattern in a separate line<br />Examples:'),
|
||||
'<code>128.199.0.0/16<br />34.217.90.52<br />162.13.190.77</code>',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.iplstUserFN,
|
||||
title: _('User IP filter'),
|
||||
desc: _('Patterns can be strings or regular expressions. Each pattern in a separate line<br />Examples:'),
|
||||
aux: '<code>128.199.0.0/16<br />34.217.90.52<br />162.13.190.77</code>',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
o = s.taboption(tabname, form.Button, '_user_excluded_ip_filter_btn', _('User excluded IP entries'));
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = tools.iplstUserExcludeFN;
|
||||
o.onclick = () => new tools.fileEditDialog(
|
||||
tools.iplstUserExcludeFN,
|
||||
_('User excluded IP filter'),
|
||||
_('Patterns can be strings or regular expressions. Each pattern in a separate line<br />Examples:'),
|
||||
'<code>128.199.0.0/16<br />34.217.90.52<br />162.13.190.77</code>',
|
||||
15
|
||||
).show();
|
||||
o.onclick = () => new tools.fileEditDialog({
|
||||
file: tools.iplstUserExcludeFN,
|
||||
title: _('User excluded IP filter'),
|
||||
desc: _('Patterns can be strings or regular expressions. Each pattern in a separate line<br />Examples:'),
|
||||
aux: '<code>128.199.0.0/16<br />34.217.90.52<br />162.13.190.77</code>',
|
||||
rows: 15,
|
||||
}).show();
|
||||
|
||||
add_delim(s);
|
||||
|
||||
@@ -425,7 +430,7 @@ return view.extend({
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
o.description = fn;
|
||||
o.onclick = () => new tools.fileEditDialog(fn, name, '', '', 15).show();
|
||||
o.onclick = () => new tools.fileEditDialog({ file: fn, title: name, rows: 15}).show();
|
||||
}
|
||||
|
||||
/* custom.d files */
|
||||
@@ -467,7 +472,7 @@ return view.extend({
|
||||
desc += '<a target=_blank href=' + url + '>' + filename + '</a>';
|
||||
}
|
||||
}
|
||||
o.onclick = () => new tools.fileEditDialog(fn, name, desc, '', 15).show();
|
||||
o.onclick = () => new tools.fileEditDialog({ file: fn, title: name, desc: desc, rows: 15}).show();
|
||||
}
|
||||
|
||||
let map_promise = m.render();
|
||||
|
||||
@@ -320,14 +320,18 @@ return baseclass.extend({
|
||||
},
|
||||
|
||||
fileEditDialog: baseclass.extend({
|
||||
__init__: function(file, title, desc, aux = null, rows = 10, callback, file_exists = false) {
|
||||
this.file = file;
|
||||
this.title = title;
|
||||
this.desc = desc;
|
||||
this.aux = aux;
|
||||
this.rows = rows,
|
||||
this.callback = callback;
|
||||
this.file_exists = file_exists;
|
||||
__init__: function(opts = {})
|
||||
{
|
||||
Object.assign(this, {
|
||||
file: '',
|
||||
title: '',
|
||||
desc: '',
|
||||
aux: '',
|
||||
rows: 10,
|
||||
callback: null,
|
||||
file_exists: false,
|
||||
setperm: 644,
|
||||
}, opts);
|
||||
},
|
||||
|
||||
load: function() {
|
||||
@@ -387,6 +391,12 @@ return baseclass.extend({
|
||||
throw new Error('tee failed, rc = ' + res.code);
|
||||
}
|
||||
}
|
||||
if (this.setperm) {
|
||||
let res = await fs.exec('/bin/busybox', [ 'chmod', '644', tmpFile ]);
|
||||
if (res.code != 0) {
|
||||
throw new Error('chmod failed, rc = ' + res.code);
|
||||
}
|
||||
}
|
||||
let res = await fs.exec('/bin/busybox', [ 'mv', '-f', tmpFile, fileName ]);
|
||||
if (res.code != 0) {
|
||||
throw new Error('mv failed, rc = ' + res.code);
|
||||
@@ -455,13 +465,16 @@ return baseclass.extend({
|
||||
}),
|
||||
|
||||
longstrEditDialog: baseclass.extend({
|
||||
__init__: function(cfgsec, cfgparam, title, desc, rows = 10, multiline = false) {
|
||||
this.cfgsec = cfgsec;
|
||||
this.cfgparam = cfgparam;
|
||||
this.title = title;
|
||||
this.desc = desc;
|
||||
this.rows = rows;
|
||||
this.multiline = multiline;
|
||||
__init__: function(opts = {})
|
||||
{
|
||||
Object.assign(this, {
|
||||
cfgsec: '',
|
||||
cfgparam: '',
|
||||
title: '',
|
||||
desc: '',
|
||||
rows: 10,
|
||||
multiline: false // may be 2
|
||||
}, opts);
|
||||
env_tools.load_env(this);
|
||||
},
|
||||
|
||||
@@ -525,6 +538,10 @@ return baseclass.extend({
|
||||
if (value != "" && value != "\t") {
|
||||
value = '\n' + value + '\n';
|
||||
if (this.multiline == 2) {
|
||||
if (value.includes("'") || value.includes('"')) {
|
||||
alert(_('Unable to save the contents') + ':\n' + _('text cannot contain quotes!'));
|
||||
return false;
|
||||
}
|
||||
value = value.replace(/"/g, '');
|
||||
value = value.replace(/'/g, '');
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zapret
|
||||
PKG_VERSION:=72.20260116
|
||||
PKG_VERSION:=72.20260117
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=bol-van
|
||||
@@ -15,7 +15,7 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c849e55ef0f1c244206f5a05ff7b1ab41a3824ee
|
||||
PKG_SOURCE_DATE:=2026-01-16
|
||||
PKG_SOURCE_DATE:=2026-01-17
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||
|
||||
@@ -75,7 +75,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443 <HOSTLIST>
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -104,7 +104,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443 <HOSTLIST>
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -137,7 +137,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443 <HOSTLIST>
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -170,7 +170,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -211,7 +211,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -252,7 +252,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443,2053,2083,2087,2096,8443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443,19294-19344,50000-50100'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -297,7 +297,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443,2053,2083,2087,2096,8443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443,19294-19344,50000-50100'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -348,7 +348,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
@@ -384,7 +384,7 @@ function set_cfg_nfqws_strat
|
||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||
set $cfgname.config.NFQWS_PORTS_UDP='443'
|
||||
set $cfgname.config.NFQWS_OPT="
|
||||
# Strategy $strat
|
||||
--comment=Strategy__$strat
|
||||
|
||||
--filter-tcp=443
|
||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
||||
|
||||
@@ -204,9 +204,15 @@ printf '%s\n' "$ZAP_TMP_DIR"/*.log | sort | while IFS= read -r file; do
|
||||
res=100
|
||||
fi
|
||||
fi
|
||||
if [ $res -lt 100 ] && [ -f "$FNAME.hdr" ] && [ $BODY_SIZE -eq 0 ]; then
|
||||
if grep -q 'x-amzn-waf-action: challenge' "$FNAME.hdr"; then
|
||||
status="WARN: tested site required JS-challenge"
|
||||
res=999
|
||||
fi
|
||||
fi
|
||||
printf '%12s / %-15s / %-13s: %s \n' "$TAG" "$IPADDR" "$PROVIDER" "$status"
|
||||
echo "$BODY_SIZE" > "$FNAME.size"
|
||||
if [ $res != 100 ]; then
|
||||
if [ $res -lt 100 ]; then
|
||||
URL=$( cat "$FNAME.url" )
|
||||
echo "$FILENAME : $URL" >> "$FAIL_URL_LIST"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user