mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-31 14:50:48 +03:00
Compare commits
3 Commits
v72.202601
...
v72.202601
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a7784878f | ||
|
|
fc3e0ec213 | ||
|
|
9e3dbf8ef3 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -276,8 +276,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make defconfig
|
make defconfig
|
||||||
sed -i 's/CONFIG_LUCI_JSMIN=y/CONFIG_LUCI_JSMIN=n/g' .config
|
sed -i 's/CONFIG_LUCI_JSMIN=y/CONFIG_LUCI_JSMIN=n/g' .config
|
||||||
sed -i 's/CONFIG_LUCI_CSSMIN=y/CONFIG_LUCI_CSSMIN=n/g' .config
|
|
||||||
grep -q '^CONFIG_LUCI_CSSMIN=' .config || echo 'CONFIG_LUCI_CSSMIN=n' >> .config
|
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Show config
|
- name: Show config
|
||||||
|
|||||||
58
.github/workflows/releases.yml
vendored
58
.github/workflows/releases.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
workflows: ["build"]
|
workflows: ["build"]
|
||||||
types: [completed]
|
types: [completed]
|
||||||
release:
|
release:
|
||||||
types: [published, unpublished, created, edited, deleted, prereleased]
|
types: [published, created, edited]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -25,62 +25,6 @@ jobs:
|
|||||||
ref: gh-pages
|
ref: gh-pages
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Wait for GitHub API consistency (release events)
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
env:
|
|
||||||
REPO: ${{ github.repository }}
|
|
||||||
ACTION: ${{ github.event.action }}
|
|
||||||
TARGET_ID: ${{ github.event.release.id }}
|
|
||||||
TARGET_NAME: ${{ github.event.release.name }}
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
echo "Release action: $ACTION"
|
|
||||||
echo "Target release id: $TARGET_ID"
|
|
||||||
max=10
|
|
||||||
delay=6
|
|
||||||
check() {
|
|
||||||
curl -s https://api.github.com/repos/$REPO/releases
|
|
||||||
}
|
|
||||||
for iter in $(seq 1 $max); do
|
|
||||||
case "$ACTION" in
|
|
||||||
created)
|
|
||||||
echo "Release created (draft). No API wait needed."
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
published|prereleased)
|
|
||||||
if check | jq "any(.[]; .id == $TARGET_ID)"; then
|
|
||||||
echo "Release appeared in API"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
deleted)
|
|
||||||
if ! check | jq "any(.[]; .id == $TARGET_ID)"; then
|
|
||||||
echo "Release disappeared from API"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
unpublished)
|
|
||||||
if check | jq "any(.[]; .id == $TARGET_ID and .draft == true)"; then
|
|
||||||
echo "Release is now draft"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
edited)
|
|
||||||
if check | jq "any(.[]; .id == $TARGET_ID and .name == \"$TARGET_NAME\")"; then
|
|
||||||
echo "Release updated"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "No consistency wait needed for action: $ACTION"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "Retry $iter/$max..."
|
|
||||||
sleep "$delay"
|
|
||||||
done
|
|
||||||
echo "WARNING: API consistency timeout for action $ACTION"
|
|
||||||
|
|
||||||
- name: Save FULL releases.json
|
- name: Save FULL releases.json
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-zapret
|
PKG_NAME:=luci-app-zapret
|
||||||
PKG_VERSION:=72.20260115
|
PKG_VERSION:=72.20260111
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
'require uci';
|
'require uci';
|
||||||
'require ui';
|
'require ui';
|
||||||
'require view';
|
'require view';
|
||||||
'require view.zapret.tools as tools';
|
'require view.zapret2.tools as tools';
|
||||||
|
|
||||||
const btn_style_neutral = 'btn';
|
const btn_style_neutral = 'btn';
|
||||||
const btn_style_action = 'btn cbi-button-action';
|
const btn_style_action = 'btn cbi-button-action';
|
||||||
@@ -30,11 +30,6 @@ return baseclass.extend({
|
|||||||
this.appendLog('Original sources: https://github.com/hyperion-cs/dpi-checkers');
|
this.appendLog('Original sources: https://github.com/hyperion-cs/dpi-checkers');
|
||||||
this.appendLog('WEB-version: https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/');
|
this.appendLog('WEB-version: https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/');
|
||||||
let cmd = [ fn_dwc_sh ];
|
let cmd = [ fn_dwc_sh ];
|
||||||
let resolve_dns = document.getElementById('cfg_resolve_dns');
|
|
||||||
let dns_ip = resolve_dns.options[resolve_dns.selectedIndex].text;
|
|
||||||
if (dns_ip && dns_ip != 'default') {
|
|
||||||
cmd.push(...[ '-d', dns_ip.trim() ]);
|
|
||||||
}
|
|
||||||
let log = '/tmp/'+tools.appName+'_dwc.log';
|
let log = '/tmp/'+tools.appName+'_dwc.log';
|
||||||
let callback = this.execAndReadCallback;
|
let callback = this.execAndReadCallback;
|
||||||
let wnd = this;
|
let wnd = this;
|
||||||
@@ -58,6 +53,7 @@ return baseclass.extend({
|
|||||||
} else {
|
} else {
|
||||||
wnd.appendLog('ERROR: Process finished with retcode = ' + rc);
|
wnd.appendLog('ERROR: Process finished with retcode = ' + rc);
|
||||||
}
|
}
|
||||||
|
wnd.setStage(999);
|
||||||
wnd.appendLog('=========================================================');
|
wnd.appendLog('=========================================================');
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -65,19 +61,6 @@ return baseclass.extend({
|
|||||||
{
|
{
|
||||||
this.pkg_arch = pkg_arch;
|
this.pkg_arch = pkg_arch;
|
||||||
|
|
||||||
let DNS_LIST = [ '8.8.8.8', '1.1.1.1' ];
|
|
||||||
let dns_list = [ ];
|
|
||||||
dns_list.push( E('option', { value: 'dns_default' }, [ 'default' ] ) );
|
|
||||||
for (let id = 0; id < DNS_LIST.length; id++) {
|
|
||||||
let dns_ipaddr = '' + DNS_LIST[id];
|
|
||||||
let val = 'dns_' + dns_ipaddr.replace(/\./g, "_");
|
|
||||||
dns_list.push( E('option', { value: val }, [ dns_ipaddr ] ));
|
|
||||||
}
|
|
||||||
let resolve_dns = E('label', [
|
|
||||||
_('Resolve IP-Addr via') + ': ',
|
|
||||||
E('select', { id: 'cfg_resolve_dns' }, dns_list)
|
|
||||||
]);
|
|
||||||
|
|
||||||
this.logArea = E('textarea', {
|
this.logArea = E('textarea', {
|
||||||
'id': 'widget.modal_content',
|
'id': 'widget.modal_content',
|
||||||
'readonly': true,
|
'readonly': true,
|
||||||
@@ -102,8 +85,6 @@ return baseclass.extend({
|
|||||||
|
|
||||||
ui.showModal(_('Diagnostics'), [
|
ui.showModal(_('Diagnostics'), [
|
||||||
E('div', { 'class': 'cbi-section' }, [
|
E('div', { 'class': 'cbi-section' }, [
|
||||||
resolve_dns,
|
|
||||||
E('br'), E('br'),
|
|
||||||
this.logArea,
|
this.logArea,
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'right' }, [
|
E('div', { 'class': 'right' }, [
|
||||||
|
|||||||
@@ -244,18 +244,8 @@ return view.extend({
|
|||||||
' ', _('Set AutoHostList mode')
|
' ', _('Set AutoHostList mode')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let erase_autohostlist = E('label', [
|
|
||||||
E('input', { type: 'checkbox', id: 'cfg_erase_autohostlist' }),
|
|
||||||
' ', _('Erase AutoHostList (ipset)')
|
|
||||||
]);
|
|
||||||
|
|
||||||
let enable_custom_d = E('label', [
|
|
||||||
E('input', { type: 'checkbox', id: 'cfg_enable_custom_d' }),
|
|
||||||
' ', _('Enable use custom.d scripts')
|
|
||||||
]);
|
|
||||||
|
|
||||||
let strat_list = [ ];
|
let strat_list = [ ];
|
||||||
strat_list.push( E('option', { value: 'strat__skip__' }, [ 'not change' ] ) );
|
strat_list.push( E('option', { value: 'strat__skip__' }, [ '-' ] ) );
|
||||||
for (let id = 0; id < this.nfqws_strat_list.length; id++) {
|
for (let id = 0; id < this.nfqws_strat_list.length; id++) {
|
||||||
let strat = '' + this.nfqws_strat_list[id];
|
let strat = '' + this.nfqws_strat_list[id];
|
||||||
strat_list.push( E('option', { value: 'strat_' + id }, [ strat ] ) );
|
strat_list.push( E('option', { value: 'strat_' + id }, [ strat ] ) );
|
||||||
@@ -286,19 +276,10 @@ return view.extend({
|
|||||||
if (document.getElementById('cfg_autohostlist').checked) {
|
if (document.getElementById('cfg_autohostlist').checked) {
|
||||||
opt_flags += '(set_mode_autohostlist)';
|
opt_flags += '(set_mode_autohostlist)';
|
||||||
};
|
};
|
||||||
if (document.getElementById('cfg_erase_autohostlist').checked) {
|
|
||||||
opt_flags += '(erase_autohostlist)';
|
|
||||||
};
|
|
||||||
if (document.getElementById('enable_custom_d').checked) {
|
|
||||||
opt_flags += '(enable_custom_d)';
|
|
||||||
};
|
|
||||||
//console.log('RESET: opt_flags = ' + opt_flags);
|
//console.log('RESET: opt_flags = ' + opt_flags);
|
||||||
let sel_strat = document.getElementById('cfg_nfqws_strat');
|
let sel_strat = document.getElementById('cfg_nfqws_strat');
|
||||||
let opt_strat = sel_strat.options[sel_strat.selectedIndex].text;
|
let opt_strat = sel_strat.options[sel_strat.selectedIndex].text;
|
||||||
//console.log('RESET: strat = ' + opt_strat);
|
//console.log('RESET: strat = ' + opt_strat);
|
||||||
if (opt_strat == 'not change') {
|
|
||||||
opt_strat = '-';
|
|
||||||
}
|
|
||||||
opt_flags += '(sync)';
|
opt_flags += '(sync)';
|
||||||
let args = [ opt_flags, opt_strat ];
|
let args = [ opt_flags, opt_strat ];
|
||||||
return this.serviceActionEx('reset', resetcfg_btn, args, true);
|
return this.serviceActionEx('reset', resetcfg_btn, args, true);
|
||||||
@@ -312,10 +293,6 @@ return view.extend({
|
|||||||
E('br'), E('br'),
|
E('br'), E('br'),
|
||||||
set_autohostlist,
|
set_autohostlist,
|
||||||
E('br'), E('br'),
|
E('br'), E('br'),
|
||||||
erase_autohostlist,
|
|
||||||
E('br'), E('br'),
|
|
||||||
enable_custom_d,
|
|
||||||
E('br'), E('br'),
|
|
||||||
nfqws_strat,
|
nfqws_strat,
|
||||||
E('br'), E('br')
|
E('br'), E('br')
|
||||||
]),
|
]),
|
||||||
@@ -409,7 +386,7 @@ return view.extend({
|
|||||||
|
|
||||||
let btn_diag = create_btn('btn_diag', btn_style_action, _('Diagnostics'));
|
let btn_diag = create_btn('btn_diag', btn_style_action, _('Diagnostics'));
|
||||||
btn_diag.onclick = ui.createHandlerFn(this, () => { diagnost.openDiagnostDialog(this.pkg_arch) });
|
btn_diag.onclick = ui.createHandlerFn(this, () => { diagnost.openDiagnostDialog(this.pkg_arch) });
|
||||||
layout_append('Diagnostic tools', null, [ btn_diag ] );
|
layout_append('', null, [ btn_diag ] );
|
||||||
|
|
||||||
let btn_update = create_btn('btn_update', btn_style_action, _('Update'));
|
let btn_update = create_btn('btn_update', btn_style_action, _('Update'));
|
||||||
btn_update.onclick = ui.createHandlerFn(this, () => { updater.openUpdateDialog(this.pkg_arch) });
|
btn_update.onclick = ui.createHandlerFn(this, () => { updater.openUpdateDialog(this.pkg_arch) });
|
||||||
|
|||||||
@@ -7,11 +7,6 @@
|
|||||||
'require view';
|
'require view';
|
||||||
'require view.zapret.tools as tools';
|
'require view.zapret.tools as tools';
|
||||||
|
|
||||||
document.head.appendChild(E('link', {
|
|
||||||
rel: 'stylesheet',
|
|
||||||
href: L.resource('view/zapret/styles.css')
|
|
||||||
}));
|
|
||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
parsers: { },
|
parsers: { },
|
||||||
|
|
||||||
@@ -133,10 +128,8 @@ return view.extend({
|
|||||||
let btn = sec.taboption(tabname, form.Button, '_' + param + '_btn', locname);
|
let btn = sec.taboption(tabname, form.Button, '_' + param + '_btn', locname);
|
||||||
btn.inputtitle = _('Edit');
|
btn.inputtitle = _('Edit');
|
||||||
btn.inputstyle = 'edit btn';
|
btn.inputstyle = 'edit btn';
|
||||||
let val = sec.taboption(tabname, form.TextValue, '_' + param);
|
let val = sec.taboption(tabname, form.DummyValue, '_' + param);
|
||||||
val.readonly = true;
|
val.rawhtml = multiline ? true : false;
|
||||||
val.rows = rows + 5;
|
|
||||||
val.wrap = false;
|
|
||||||
val.cfgvalue = function(section_id) {
|
val.cfgvalue = function(section_id) {
|
||||||
let value = uci.get(tools.appName, section_id, param);
|
let value = uci.get(tools.appName, section_id, param);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
@@ -148,10 +141,15 @@ return view.extend({
|
|||||||
value = value.replace(/\n --/g, "\n--");
|
value = value.replace(/\n --/g, "\n--");
|
||||||
value = value.replace(/ --/g, "\n--");
|
value = value.replace(/ --/g, "\n--");
|
||||||
}
|
}
|
||||||
|
if (val.rawhtml) {
|
||||||
|
value = value.replace(/</g, '˂');
|
||||||
|
value = value.replace(/>/g, '˃');
|
||||||
|
value = value.replace(/\n/g, '<br/>');
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
val.validate = function(section_id, value) {
|
val.validate = function(section_id, value) {
|
||||||
return true;
|
return (value) ? value.trim() : "";
|
||||||
};
|
};
|
||||||
let desc = locname;
|
let desc = locname;
|
||||||
if (multiline == 2) {
|
if (multiline == 2) {
|
||||||
@@ -281,10 +279,6 @@ return view.extend({
|
|||||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_MAXSEQ', _('RETRANS_MAXSEQ'));
|
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_MAXSEQ', _('RETRANS_MAXSEQ'));
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
o.datatype = 'uinteger';
|
o.datatype = 'uinteger';
|
||||||
|
|
||||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_RESET', _('RETRANS_RESET'));
|
|
||||||
o.rmempty = false;
|
|
||||||
o.datatype = 'uinteger';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_THRESHOLD', _('RETRANS_THRESHOLD'));
|
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_THRESHOLD', _('RETRANS_THRESHOLD'));
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
textarea, .cbi-value textarea
|
|
||||||
{
|
|
||||||
white-space: pre;
|
|
||||||
overflow-x: auto;
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
@@ -370,40 +370,21 @@ return baseclass.extend({
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSaveAdv: async function(ev) {
|
handleSaveAdv: function(ev) {
|
||||||
let txt = document.getElementById('widget.modal_content');
|
let txt = document.getElementById('widget.modal_content');
|
||||||
let value = txt.value.trim().replace(/\r\n/g, '\n');
|
let value = txt.value.trim().replace(/\r\n/g, '\n') + '\n';
|
||||||
if (value.length > 0) {
|
|
||||||
value += '\n';
|
return fs.write(this.file, value).then(async rc => {
|
||||||
}
|
|
||||||
let data = value.replace(/'/g, `'\"'\"'`);
|
|
||||||
let chunkSize = 8000;
|
|
||||||
try {
|
|
||||||
for (let wsize = -1; wsize < data.length; wsize += chunkSize) {
|
|
||||||
let chunk = '';
|
|
||||||
if (wsize < 0) {
|
|
||||||
wsize = 0;
|
|
||||||
}
|
|
||||||
if (data.length > 0) {
|
|
||||||
chunk = data.slice(wsize, wsize + chunkSize);
|
|
||||||
}
|
|
||||||
let teeArg = (wsize === 0) ? '' : '-a ';
|
|
||||||
let cmd = `printf %s '${chunk}' | tee ${teeArg} '${this.file}'`;
|
|
||||||
let res = await fs.exec('/bin/busybox', [ 'sh', '-c', cmd ]);
|
|
||||||
if (res.code !== 0) {
|
|
||||||
throw new Error('tee failed, rc = ' + res.code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
txt.value = value;
|
txt.value = value;
|
||||||
ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
|
ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
|
||||||
if (this.callback) {
|
if (this.callback) {
|
||||||
return this.callback(rc);
|
return this.callback(rc);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
}).catch(e => {
|
||||||
ui.addNotification(null, E('p', _('Unable to save the contents') + ': %s'.format(e.message)));
|
ui.addNotification(null, E('p', _('Unable to save the contents') + ': %s'.format(e.message)));
|
||||||
} finally {
|
}).finally(() => {
|
||||||
ui.hideModal();
|
ui.hideModal();
|
||||||
}
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function(e) {
|
error: function(e) {
|
||||||
@@ -525,10 +506,24 @@ return baseclass.extend({
|
|||||||
value = value.replace(/˂/g, '<');
|
value = value.replace(/˂/g, '<');
|
||||||
value = value.replace(/˃/g, '>');
|
value = value.replace(/˃/g, '>');
|
||||||
try {
|
try {
|
||||||
let elem = document.getElementById("widget.cbid." + this.appName + ".config._" + this.cfgparam);
|
let elem = document.getElementById("cbi-" + this.appName + "-" + this.cfgsec + "-_" + this.cfgparam);
|
||||||
|
if (elem) {
|
||||||
|
if (elem.querySelector('div')) {
|
||||||
|
elem = elem.querySelector('div');
|
||||||
|
} else {
|
||||||
|
elem = elem.querySelector('output');
|
||||||
|
}
|
||||||
|
}
|
||||||
if (elem) {
|
if (elem) {
|
||||||
let val = value.trim();
|
let val = value.trim();
|
||||||
elem.textContent = val;
|
if (this.multiline) {
|
||||||
|
val = val.replace(/</g, '˂');
|
||||||
|
val = val.replace(/>/g, '˃');
|
||||||
|
val = val.replace(/\n/g, '<br/>');
|
||||||
|
elem.innerHTML = val;
|
||||||
|
} else {
|
||||||
|
elem.textContent = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.error('ERROR: cannot found elem for ' + this.cfgsec + '.' + this.cfgparam);
|
console.error('ERROR: cannot found elem for ' + this.cfgsec + '.' + this.cfgparam);
|
||||||
|
|||||||
137
zapret/Makefile
137
zapret/Makefile
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zapret
|
PKG_NAME:=zapret
|
||||||
PKG_VERSION:=72.20260115
|
PKG_VERSION:=72.20260111
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_MAINTAINER:=bol-van
|
PKG_MAINTAINER:=bol-van
|
||||||
@@ -14,8 +14,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
|||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=76764ad6b0ee7d3991c97e7b8c24d53189d25c28
|
PKG_SOURCE_VERSION:=a775aa7aaa4903a8c0870f9c16918e9d19d83772
|
||||||
PKG_SOURCE_DATE:=2026-01-15
|
PKG_SOURCE_DATE:=2026-01-11
|
||||||
|
|
||||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
#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?
|
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
@@ -57,17 +57,10 @@ define Build/Compile
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/conffiles
|
define Package/$(PKG_NAME)/conffiles
|
||||||
|
/etc/config/zapret
|
||||||
/opt/zapret/config
|
/opt/zapret/config
|
||||||
/opt/zapret/ipset/zapret-hosts-google.txt
|
/opt/zapret/ipset/
|
||||||
/opt/zapret/ipset/zapret-hosts-user.txt
|
/opt/zapret/init.d/openwrt/custom.d/
|
||||||
/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
|
||||||
/opt/zapret/ipset/zapret-ip-exclude.txt
|
|
||||||
/opt/zapret/ipset/zapret-hosts-auto.txt
|
|
||||||
/opt/zapret/init.d/openwrt/custom.d/10-script.sh
|
|
||||||
/opt/zapret/init.d/openwrt/custom.d/20-script.sh
|
|
||||||
/opt/zapret/init.d/openwrt/custom.d/50-script.sh
|
|
||||||
/opt/zapret/init.d/openwrt/custom.d/60-script.sh
|
|
||||||
/opt/zapret/init.d/openwrt/custom.d/90-script.sh
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/install
|
define Package/$(PKG_NAME)/install
|
||||||
@@ -97,7 +90,6 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./init.d.sh $(1)/etc/init.d/zapret
|
$(INSTALL_BIN) ./init.d.sh $(1)/etc/init.d/zapret
|
||||||
$(INSTALL_DATA) ./config.default $(1)/opt/zapret/config.default
|
$(INSTALL_DATA) ./config.default $(1)/opt/zapret/config.default
|
||||||
$(INSTALL_DATA) ./config.default $(1)/opt/zapret/config
|
|
||||||
$(INSTALL_DATA) ./ipset/zapret-hosts-google.txt $(1)/opt/zapret/ipset/zapret-hosts-google.txt
|
$(INSTALL_DATA) ./ipset/zapret-hosts-google.txt $(1)/opt/zapret/ipset/zapret-hosts-google.txt
|
||||||
$(INSTALL_DATA) ./ipset/zapret-hosts-user.txt $(1)/opt/zapret/ipset/zapret-hosts-user.txt
|
$(INSTALL_DATA) ./ipset/zapret-hosts-user.txt $(1)/opt/zapret/ipset/zapret-hosts-user.txt
|
||||||
$(INSTALL_DATA) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
$(INSTALL_DATA) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
||||||
@@ -113,96 +105,42 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(CP) ./custom.d/* $(1)/opt/zapret/init.d/openwrt/custom.d/
|
$(CP) ./custom.d/* $(1)/opt/zapret/init.d/openwrt/custom.d/
|
||||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/etc/uci-defaults/zapret-uci-def-cfg.sh
|
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/etc/uci-defaults/zapret-uci-def-cfg.sh
|
||||||
# install all sh-scripts
|
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/opt/zapret/uci-def-cfg.sh
|
||||||
$(CP) ./*.sh $(1)/opt/zapret/
|
$(INSTALL_BIN) ./comfunc.sh $(1)/opt/zapret/comfunc.sh
|
||||||
rm -f $(1)/opt/zapret/init.d.sh
|
$(INSTALL_BIN) ./def-cfg.sh $(1)/opt/zapret/def-cfg.sh
|
||||||
# Create empty conf files
|
$(INSTALL_BIN) ./renew-cfg.sh $(1)/opt/zapret/renew-cfg.sh
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/ipset/zapret-hosts-auto.txt
|
$(INSTALL_BIN) ./restore-def-cfg.sh $(1)/opt/zapret/restore-def-cfg.sh
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/ipset/cust1.txt
|
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/ipset/cust2.txt
|
$(INSTALL_BIN) ./script-exec.sh $(1)/opt/zapret/script-exec.sh
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/ipset/cust3.txt
|
$(INSTALL_BIN) ./update-pkg.sh $(1)/opt/zapret/update-pkg.sh
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/ipset/cust4.txt
|
# Fix permisions
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/init.d/openwrt/custom.d/10-script.sh
|
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/init.d/openwrt/custom.d/20-script.sh
|
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/init.d/openwrt/custom.d/60-script.sh
|
|
||||||
$(INSTALL_DATA) /dev/null $(1)/opt/zapret/init.d/openwrt/custom.d/90-script.sh
|
|
||||||
# Fix permissions
|
|
||||||
chmod 644 $(1)/opt/zapret/ipset/*.txt
|
chmod 644 $(1)/opt/zapret/ipset/*.txt
|
||||||
chmod 644 $(1)/opt/zapret/ipset_def/*.txt
|
chmod 644 $(1)/opt/zapret/ipset_def/*.txt
|
||||||
chmod 644 $(1)/opt/zapret/init.d/openwrt/custom.d/*.sh
|
chmod 644 $(1)/opt/zapret/init.d/openwrt/custom.d/*.sh
|
||||||
chmod 644 $(1)/opt/zapret/config*
|
chmod 644 $(1)/opt/zapret/config.default
|
||||||
chmod 755 $(1)/opt/zapret/*.sh
|
chmod 755 $(1)/opt/zapret/*.sh
|
||||||
chmod 755 $(1)/opt/zapret/$(MAKE_PATH)/*
|
chmod 755 $(1)/opt/zapret/$(MAKE_PATH)/*
|
||||||
chmod 755 $(1)/opt/zapret/ip2net/*
|
chmod 755 $(1)/opt/zapret/ip2net/*
|
||||||
chmod 755 $(1)/opt/zapret/mdig/*
|
chmod 755 $(1)/opt/zapret/mdig/*
|
||||||
# Disable TPWS in blockcheck
|
|
||||||
grep -q '^SKIP_TPWS=' $(1)/opt/zapret/blockcheck.sh || sed -i '/^NFT_TABLE=blockcheck$$$$/a SKIP_TPWS=$$$${SKIP_TPWS:-1}' $(1)/opt/zapret/blockcheck.sh
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/preinst
|
define Package/$(PKG_NAME)/preinst
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# check if we are on real system
|
# check if we are on real system
|
||||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
ZAPRET_DIR=/opt/zapret
|
if [ -f "/etc/init.d/zapret" ]; then
|
||||||
ZAPRET_INITD=/etc/init.d/zapret
|
SCRIPT=$$( readlink /etc/init.d/zapret )
|
||||||
ZAPRET_CFG=/etc/config/zapret
|
|
||||||
if [ -f "$${ZAPRET_INITD}" ]; then
|
|
||||||
SCRIPT=$$( readlink "$${ZAPRET_INITD}" )
|
|
||||||
if [ -n "$${SCRIPT}" ]; then
|
if [ -n "$${SCRIPT}" ]; then
|
||||||
echo "Please uninstall incompatible \"zapret\" service!"
|
echo "Please uninstall original zapret utility!"
|
||||||
exit 44
|
exit 44
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if command -v apk >/dev/null; then
|
|
||||||
PKG_MGR="apk"
|
|
||||||
PKG_CHECK="apk info -e "
|
|
||||||
PKG_REMOVE="apk del --force "
|
|
||||||
else
|
|
||||||
PKG_MGR="opkg"
|
|
||||||
PKG_CHECK="opkg status "
|
|
||||||
PKG_REMOVE="opkg remove --force-remove "
|
|
||||||
fi
|
|
||||||
if [ "$${PKG_UPGRADE}" = "1" ]; then
|
if [ "$${PKG_UPGRADE}" = "1" ]; then
|
||||||
# stop service if PKG_UPGRADE
|
# stop service if PKG_UPGRADE
|
||||||
if [ -x "$${ZAPRET_INITD}" ]; then
|
if [ -x "/etc/init.d/zapret" ]; then
|
||||||
$${ZAPRET_INITD} running && $${ZAPRET_INITD} stop >/dev/null 2>&1
|
/etc/init.d/zapret running && /etc/init.d/zapret stop >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if $${PKG_CHECK} zapret >/dev/null 2>&1; then
|
|
||||||
if [ ! -f "/opt/zapret/sync_config.sh" ]; then
|
|
||||||
echo "Please uninstall incompatible \"zapret\" package!"
|
|
||||||
exit 47
|
|
||||||
fi
|
|
||||||
if [ -f "$${ZAPRET_CFG}" ] && ! grep -q "run_on_boot" "$${ZAPRET_CFG}"; then
|
|
||||||
echo "Please uninstall incompatible \"zapret\" package!"
|
|
||||||
exit 48
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if $${PKG_CHECK} luci-app-zapret >/dev/null 2>&1; then
|
|
||||||
SVC_FILE=/www/luci-static/resources/view/zapret/service.js
|
|
||||||
if [ ! -f "$${SVC_FILE}" ] || ! grep -Fq "/remittor/zapret-openwrt" "$${SVC_FILE}"; then
|
|
||||||
echo "Please uninstall incompatible \"luci-app-zapret\" package!"
|
|
||||||
exit 55
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ -f "$${ZAPRET_CFG}" ] && ! grep -q "run_on_boot" "$${ZAPRET_CFG}"; then
|
|
||||||
if [ -x "$${ZAPRET_INITD}" ]; then
|
|
||||||
$${ZAPRET_INITD} running && $${ZAPRET_INITD} stop >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
rm -f $${ZAPRET_CFG}
|
|
||||||
rm -f $${ZAPRET_INITD}
|
|
||||||
[ -d "$${ZAPRET_DIR}" ] && rm -rf $${ZAPRET_DIR}
|
|
||||||
echo "All files of the previously installed package have been removed!"
|
|
||||||
fi
|
|
||||||
if $${PKG_CHECK} zapret-mdig >/dev/null 2>&1; then
|
|
||||||
$${PKG_REMOVE} zapret-mdig
|
|
||||||
fi
|
|
||||||
if $${PKG_CHECK} zapret-ip2net >/dev/null 2>&1; then
|
|
||||||
$${PKG_REMOVE} zapret-ip2net
|
|
||||||
fi
|
|
||||||
if [ ! -d "$${ZAPRET_DIR}" ]; then
|
|
||||||
mkdir -p $${ZAPRET_DIR}
|
|
||||||
fi
|
|
||||||
if [ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ]; then
|
if [ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ]; then
|
||||||
if [ -f "/opt/zapret/ipset/zapret-hosts-user.txt" ]; then
|
if [ -f "/opt/zapret/ipset/zapret-hosts-user.txt" ]; then
|
||||||
CFGLISTHASH=$$( md5sum "/opt/zapret/ipset/zapret-hosts-user.txt" | awk '{print $$1;}' )
|
CFGLISTHASH=$$( md5sum "/opt/zapret/ipset/zapret-hosts-user.txt" | awk '{print $$1;}' )
|
||||||
@@ -219,17 +157,8 @@ define Package/$(PKG_NAME)/postinst
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# check if we are on real system
|
# check if we are on real system
|
||||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
ZAPRET_DIR=/opt/zapret
|
|
||||||
ZAPRET_INITD=/etc/init.d/zapret
|
|
||||||
ZAPRET_CFG=/etc/config/zapret
|
|
||||||
ZAPRET_CONFIG=/opt/zapret/config
|
ZAPRET_CONFIG=/opt/zapret/config
|
||||||
ZAPRET_CONFIG_DEF="/opt/zapret/config.default"
|
ZAPRET_CONFIG_DEF="/opt/zapret/config.default"
|
||||||
# Fix permissions
|
|
||||||
chmod 644 $${ZAPRET_CFG} >/dev/null 2>&1
|
|
||||||
chmod 644 $${ZAPRET_DIR}/ipset/*.txt >/dev/null 2>&1
|
|
||||||
chmod 644 $${ZAPRET_DIR}/ipset_def/*.txt >/dev/null 2>&1
|
|
||||||
chmod 644 $${ZAPRET_DIR}/init.d/openwrt/custom.d/*.sh >/dev/null 2>&1
|
|
||||||
chmod 644 $${ZAPRET_DIR}/config* >/dev/null 2>&1
|
|
||||||
# creating main config if its not exists
|
# creating main config if its not exists
|
||||||
if [ ! -f "$${ZAPRET_CONFIG}" ]; then
|
if [ ! -f "$${ZAPRET_CONFIG}" ]; then
|
||||||
cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
||||||
@@ -242,10 +171,8 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
|||||||
echo "Current file $${ZAPRET_CONFIG} backuped to $${ZAPRET_CONFIG_BACKUP}"
|
echo "Current file $${ZAPRET_CONFIG} backuped to $${ZAPRET_CONFIG_BACKUP}"
|
||||||
cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
||||||
fi
|
fi
|
||||||
# remove fake uci-config
|
|
||||||
[ -f "$${ZAPRET_CFG}" ] && [ ! -s "$${ZAPRET_CFG}" ] && rm -f "$${ZAPRET_CFG}"
|
|
||||||
# check existing uci-config
|
# check existing uci-config
|
||||||
[ -f "$${ZAPRET_CFG}" ] && ZAPRET_CFG_EXISTS=1 || ZAPRET_CFG_EXISTS=0
|
[ -f "/etc/config/zapret" ] && ZAPRET_CFG_EXISTS=1 || ZAPRET_CFG_EXISTS=0
|
||||||
# create or merge uci-config
|
# create or merge uci-config
|
||||||
/opt/zapret/uci-def-cfg.sh
|
/opt/zapret/uci-def-cfg.sh
|
||||||
[ "$${ZAPRET_CFG_EXISTS}" = "1" ] && echo "Config /etc/config/zapret merged with default uci-config"
|
[ "$${ZAPRET_CFG_EXISTS}" = "1" ] && echo "Config /etc/config/zapret merged with default uci-config"
|
||||||
@@ -257,13 +184,13 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
|||||||
sh -n "$${ZAPRET_CONFIG}" 2>/dev/null || cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
sh -n "$${ZAPRET_CONFIG}" 2>/dev/null || cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
||||||
sh -n "$${ZAPRET_CONFIG}" 2>/dev/null || exit 58
|
sh -n "$${ZAPRET_CONFIG}" 2>/dev/null || exit 58
|
||||||
# enable main service
|
# enable main service
|
||||||
$${ZAPRET_INITD} enable
|
/etc/init.d/zapret enable
|
||||||
# stop all
|
# stop all
|
||||||
$${ZAPRET_INITD} stop_fw >/dev/null 2>&1
|
/etc/init.d/zapret stop_fw
|
||||||
$${ZAPRET_INITD} stop_daemons >/dev/null 2>&1
|
/etc/init.d/zapret stop_daemons
|
||||||
ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9
|
ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9
|
||||||
# start main service
|
# start main service
|
||||||
$${ZAPRET_INITD} start
|
/etc/init.d/zapret start
|
||||||
# restart firewall
|
# restart firewall
|
||||||
[ -x /sbin/fw4 ] && fw4 -q restart || fw3 -q restart
|
[ -x /sbin/fw4 ] && fw4 -q restart || fw3 -q restart
|
||||||
fi
|
fi
|
||||||
@@ -274,10 +201,8 @@ define Package/$(PKG_NAME)/prerm
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# check if we are on real system
|
# check if we are on real system
|
||||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
ZAPRET_DIR=/opt/zapret
|
EXEDIR=/opt/zapret
|
||||||
ZAPRET_BASE=/opt/zapret
|
ZAPRET_BASE=/opt/zapret
|
||||||
ZAPRET_INITD=/etc/init.d/zapret
|
|
||||||
ZAPRET_CFG=/etc/config/zapret
|
|
||||||
ZAPRET_CONFIG=/opt/zapret/config
|
ZAPRET_CONFIG=/opt/zapret/config
|
||||||
ZAPRET_CONFIG_DEF="/opt/zapret/config.default"
|
ZAPRET_CONFIG_DEF="/opt/zapret/config.default"
|
||||||
OPENWRT_FW_INCLUDE=/etc/firewall.zapret
|
OPENWRT_FW_INCLUDE=/etc/firewall.zapret
|
||||||
@@ -292,8 +217,8 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
|||||||
. "$${ZAPRET_BASE}/common/fwtype.sh"
|
. "$${ZAPRET_BASE}/common/fwtype.sh"
|
||||||
. "$${ZAPRET_BASE}/common/nft.sh"
|
. "$${ZAPRET_BASE}/common/nft.sh"
|
||||||
. "$${ZAPRET_BASE}/common/installer.sh"
|
. "$${ZAPRET_BASE}/common/installer.sh"
|
||||||
$${ZAPRET_INITD} running && $${ZAPRET_INITD} stop >/dev/null 2>&1
|
/etc/init.d/zapret running && /etc/init.d/zapret stop
|
||||||
$${ZAPRET_INITD} disable >/dev/null 2>&1
|
/etc/init.d/zapret disable
|
||||||
ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9
|
ps w | grep '/opt/zapret/nfq/nfqws' | grep -v grep | awk '{print $$1}' | xargs -r kill -9
|
||||||
remove_openwrt_firewall
|
remove_openwrt_firewall
|
||||||
nft_del_table
|
nft_del_table
|
||||||
@@ -306,9 +231,7 @@ define Package/$(PKG_NAME)/postrm
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# check if we are on real system
|
# check if we are on real system
|
||||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
rm -f /etc/config/zapret-opkg*
|
[ -f "/etc/config/zapret-opkg" ] && rm -f "/etc/config/zapret-opkg"
|
||||||
rm -f /etc/config/zapret.opkg*
|
|
||||||
rm -f /etc/config/zapret.apk*
|
|
||||||
[ -f "/opt/zapret/config" ] && cp -f /opt/zapret/config "/opt/zapret/config.backup"
|
[ -f "/opt/zapret/config" ] && cp -f /opt/zapret/config "/opt/zapret/config.backup"
|
||||||
#rm -rf /opt/zapret
|
#rm -rf /opt/zapret
|
||||||
#echo "Directory /opt/zapret removed!"
|
#echo "Directory /opt/zapret removed!"
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ function restore_all_ipset_cfg
|
|||||||
restore_ipset_txt zapret-hosts-google.txt
|
restore_ipset_txt zapret-hosts-google.txt
|
||||||
restore_ipset_txt zapret-hosts-user.txt
|
restore_ipset_txt zapret-hosts-user.txt
|
||||||
restore_ipset_txt zapret-hosts-user-exclude.txt
|
restore_ipset_txt zapret-hosts-user-exclude.txt
|
||||||
restore_ipset_txt zapret-ip-exclude.txt
|
restore_ipset_txt zapret-ip-exclude.txt.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_default_cfg
|
function create_default_cfg
|
||||||
@@ -179,7 +179,7 @@ function insert_cron_task_logs
|
|||||||
{
|
{
|
||||||
[ ! -f "$CRONTAB_FILE" ] && touch "$CRONTAB_FILE"
|
[ ! -f "$CRONTAB_FILE" ] && touch "$CRONTAB_FILE"
|
||||||
[ ! -f "$CRONTAB_FILE" ] && return 1
|
[ ! -f "$CRONTAB_FILE" ] && return 1
|
||||||
if ! grep -q -e "-name '$ZAPRET_CFG_NAME+\*\.log' -size \+" "$CRONTAB_FILE"; then
|
if ! grep -q -e "-name '$ZAPRET_CFG_NAME\*\.log' -size \+" "$CRONTAB_FILE"; then
|
||||||
echo "*/2 * * * * /usr/bin/find /tmp -maxdepth 1 -type f -name '$ZAPRET_CFG_NAME+*.log' -size +2600k -exec rm -f {} \;" >> "$CRONTAB_FILE"
|
echo "*/2 * * * * /usr/bin/find /tmp -maxdepth 1 -type f -name '$ZAPRET_CFG_NAME+*.log' -size +2600k -exec rm -f {} \;" >> "$CRONTAB_FILE"
|
||||||
/etc/init.d/cron restart 2> /dev/null
|
/etc/init.d/cron restart 2> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
function set_cfg_reset_values
|
function set_cfg_reset_values
|
||||||
{
|
{
|
||||||
local cfgname=${1:-$ZAPRET_CFG_NAME}
|
local cfgname=${1:-$ZAPRET_CFG_NAME}
|
||||||
local TAB="$( printf '\t' )"
|
local TAB="$( echo -n -e '\t' )"
|
||||||
uci batch <<-EOF
|
uci batch <<-EOF
|
||||||
set $cfgname.config.run_on_boot='0'
|
set $cfgname.config.run_on_boot='0'
|
||||||
# settings for zapret service
|
# settings for zapret service
|
||||||
@@ -47,7 +47,7 @@ function set_cfg_reset_values
|
|||||||
function clear_nfqws_strat
|
function clear_nfqws_strat
|
||||||
{
|
{
|
||||||
local cfgname=${1:-$ZAPRET_CFG_NAME}
|
local cfgname=${1:-$ZAPRET_CFG_NAME}
|
||||||
local TAB="$( printf '\t' )"
|
local TAB="$( echo -n -e '\t' )"
|
||||||
uci batch <<-EOF
|
uci batch <<-EOF
|
||||||
set $cfgname.config.MODE_FILTER='hostlist'
|
set $cfgname.config.MODE_FILTER='hostlist'
|
||||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||||
@@ -61,7 +61,7 @@ function set_cfg_nfqws_strat
|
|||||||
{
|
{
|
||||||
local strat=${1:--}
|
local strat=${1:--}
|
||||||
local cfgname=${2:-$ZAPRET_CFG_NAME}
|
local cfgname=${2:-$ZAPRET_CFG_NAME}
|
||||||
local TAB="$( printf '\t' )"
|
local TAB="$( echo -n -e '\t' )"
|
||||||
|
|
||||||
uci batch <<-EOF
|
uci batch <<-EOF
|
||||||
set $cfgname.config.MODE_FILTER='hostlist'
|
set $cfgname.config.MODE_FILTER='hostlist'
|
||||||
@@ -292,57 +292,6 @@ function set_cfg_nfqws_strat
|
|||||||
commit $cfgname
|
commit $cfgname
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ "$strat" = "v7_by_StressOzz" ]; then
|
|
||||||
uci batch <<-EOF
|
|
||||||
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
|
|
||||||
|
|
||||||
--filter-tcp=443
|
|
||||||
--hostlist=/opt/zapret/ipset/zapret-hosts-google.txt
|
|
||||||
--dpi-desync=fake,multisplit
|
|
||||||
--dpi-desync-split-pos=2,sld
|
|
||||||
--dpi-desync-fake-tls=0x0F0F0F0F
|
|
||||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
|
||||||
--dpi-desync-fake-tls-mod=rnd,dupsid,sni=ggpht.com
|
|
||||||
--dpi-desync-split-seqovl=620
|
|
||||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
|
||||||
--dpi-desync-fooling=badsum,badseq
|
|
||||||
|
|
||||||
--new
|
|
||||||
--filter-tcp=443 <HOSTLIST>
|
|
||||||
--dpi-desync=fake,multisplit
|
|
||||||
--dpi-desync-split-seqovl=654
|
|
||||||
--dpi-desync-split-pos=1
|
|
||||||
--dpi-desync-fooling=ts
|
|
||||||
--dpi-desync-repeats=8
|
|
||||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/max.bin
|
|
||||||
--dpi-desync-fake-tls=/opt/zapret/files/fake/max.bin
|
|
||||||
|
|
||||||
--new
|
|
||||||
--filter-udp=443 <HOSTLIST_NOAUTO>
|
|
||||||
--dpi-desync=fake
|
|
||||||
--dpi-desync-repeats=6
|
|
||||||
--dpi-desync-fake-quic=/opt/zapret/files/fake/quic_initial_www_google_com.bin
|
|
||||||
|
|
||||||
--new
|
|
||||||
--filter-udp=19294-19344,50000-50100
|
|
||||||
--filter-l7=discord,stun
|
|
||||||
--dpi-desync=fake
|
|
||||||
--dpi-desync-repeats=6
|
|
||||||
|
|
||||||
--new
|
|
||||||
--filter-tcp=2053,2083,2087,2096,8443
|
|
||||||
--hostlist-domains=discord.media
|
|
||||||
--dpi-desync=multisplit
|
|
||||||
--dpi-desync-split-seqovl=652
|
|
||||||
--dpi-desync-split-pos=2
|
|
||||||
--dpi-desync-split-seqovl-pattern=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin
|
|
||||||
"
|
|
||||||
commit $cfgname
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
if [ "$strat" = "ALT7_by_Flowseal" ]; then
|
if [ "$strat" = "ALT7_by_Flowseal" ]; then
|
||||||
uci batch <<-EOF
|
uci batch <<-EOF
|
||||||
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
set $cfgname.config.NFQWS_PORTS_TCP='80,443'
|
||||||
@@ -442,17 +391,5 @@ function set_cfg_default_values
|
|||||||
commit $cfgname
|
commit $cfgname
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if echo "$opt_flags" | grep -q "(enable_custom_d)"; then
|
|
||||||
uci batch <<-EOF
|
|
||||||
set $cfgname.config.DISABLE_CUSTOM='0'
|
|
||||||
commit $cfgname
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
if echo "$opt_flags" | grep -q "(disable_custom_d)"; then
|
|
||||||
uci batch <<-EOF
|
|
||||||
set $cfgname.config.DISABLE_CUSTOM='1'
|
|
||||||
commit $cfgname
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
147
zapret/dwc.sh
147
zapret/dwc.sh
@@ -1,25 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (c) 2026 remittor
|
# Copyright (c) 2026 remittor
|
||||||
|
|
||||||
|
. /opt/zapret/comfunc.sh
|
||||||
|
|
||||||
ZAP_TMP_DIR=/tmp/zapret_dwc
|
ZAP_TMP_DIR=/tmp/zapret_dwc
|
||||||
|
|
||||||
opt_dig=
|
|
||||||
opt_test=
|
|
||||||
|
|
||||||
while getopts "d:t" opt; do
|
|
||||||
case $opt in
|
|
||||||
d) opt_dig="$OPTARG";;
|
|
||||||
t) opt_test="true";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf $ZAP_TMP_DIR
|
rm -rf $ZAP_TMP_DIR
|
||||||
|
|
||||||
CURL_TIMEOUT=5
|
CURL_TIMEOUT=5
|
||||||
CURL_RANGETO=65535
|
CURL_RANGETO=65535
|
||||||
CURL_NOCACHE='cache-control: no-cache'
|
|
||||||
CURL_NOCACHE2='pragma: no-cache'
|
|
||||||
CURL_USERAGENT='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36'
|
|
||||||
|
|
||||||
if ! command -v curl >/dev/null 2>&1; then
|
if ! command -v curl >/dev/null 2>&1; then
|
||||||
echo "ERROR: package \"curl\" not installed!"
|
echo "ERROR: package \"curl\" not installed!"
|
||||||
@@ -35,16 +24,6 @@ if ! echo "$CURL_INFO" | grep -q 'https'; then
|
|||||||
return 11
|
return 11
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$opt_dig" != "" ]; then
|
|
||||||
if ! command -v dig >/dev/null 2>&1; then
|
|
||||||
echo "ERROR: package \"bind-dig\" not installed!"
|
|
||||||
return 12
|
|
||||||
fi
|
|
||||||
[ "$opt_dig" = "@" ] && opt_dig='8.8.8.8'
|
|
||||||
[ "$opt_dig" = "8" ] && opt_dig='8.8.8.8'
|
|
||||||
[ "$opt_dig" = "1" ] && opt_dig='1.1.1.1'
|
|
||||||
fi
|
|
||||||
|
|
||||||
#echo 'Original sources: https://github.com/hyperion-cs/dpi-checkers'
|
#echo 'Original sources: https://github.com/hyperion-cs/dpi-checkers'
|
||||||
#echo 'WEB-version: https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/'
|
#echo 'WEB-version: https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/'
|
||||||
|
|
||||||
@@ -66,7 +45,7 @@ TEST_SUITE='[
|
|||||||
{ id: "DE.AWS-01", provider: "🇩🇪 AWS", times: 1, url: "https://www.getscope.com/assets/fonts/fa-solid-900.woff2" },
|
{ id: "DE.AWS-01", provider: "🇩🇪 AWS", times: 1, url: "https://www.getscope.com/assets/fonts/fa-solid-900.woff2" },
|
||||||
{ id: "US.AWS-01", provider: "🇺🇸 AWS", times: 1, url: "https://corp.kaltura.com/wp-content/cache/min/1/wp-content/themes/airfleet/dist/styles/theme.css" },
|
{ id: "US.AWS-01", provider: "🇺🇸 AWS", times: 1, url: "https://corp.kaltura.com/wp-content/cache/min/1/wp-content/themes/airfleet/dist/styles/theme.css" },
|
||||||
{ id: "US.GC-01", provider: "🇺🇸 Google Cloud", times: 1, url: "https://api.usercentrics.eu/gvl/v3/en.json" },
|
{ id: "US.GC-01", provider: "🇺🇸 Google Cloud", times: 1, url: "https://api.usercentrics.eu/gvl/v3/en.json" },
|
||||||
{ id: "US.FST-01", provider: "🇺🇸 Fastly", times: 1, url: "https://www.jetblue.com/footer/footer-element-es2015.js" },
|
{ id: "US.FST-01", provider: "🇺🇸 Fastly", times: 1, url: "https://www.jetblue.com/main.c7b61d59416f714f.js" },
|
||||||
{ id: "CA.FST-01", provider: "🇨🇦 Fastly", times: 1, url: "https://www.cnn10.com/" },
|
{ id: "CA.FST-01", provider: "🇨🇦 Fastly", times: 1, url: "https://www.cnn10.com/" },
|
||||||
{ id: "US.AKM-01", provider: "🇺🇸 Akamai", times: 1, url: "https://www.roxio.com/static/roxio/images/products/creator/nxt9/call-action-footer-bg.jpg" },
|
{ id: "US.AKM-01", provider: "🇺🇸 Akamai", times: 1, url: "https://www.roxio.com/static/roxio/images/products/creator/nxt9/call-action-footer-bg.jpg" },
|
||||||
{ id: "PL.AKM-01", provider: "🇵🇱 Akamai", times: 1, url: "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$" },
|
{ id: "PL.AKM-01", provider: "🇵🇱 Akamai", times: 1, url: "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$" },
|
||||||
@@ -81,109 +60,59 @@ function trim
|
|||||||
echo "$1" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'
|
echo "$1" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p "$ZAP_TMP_DIR"
|
mkdir -p $ZAP_TMP_DIR
|
||||||
|
|
||||||
TARGET_LIST_FILE="$ZAP_TMP_DIR/targets"
|
ID=0
|
||||||
: > "$TARGET_LIST_FILE"
|
while IFS='|' read -r TAG PROVIDER TIMES URL; do
|
||||||
IDX=0
|
|
||||||
while IFS= read -r line; do
|
|
||||||
case "$line" in
|
|
||||||
*id:*provider:*url:*)
|
|
||||||
IDX=$((IDX + 1))
|
|
||||||
TAG=$( printf '%s\n' "$line" | cut -d'"' -f2 )
|
|
||||||
COUNTRY="${TAG%%.*}"
|
|
||||||
PROVIDER_RAW=$( printf '%s\n' "$line" | cut -d'"' -f4 )
|
|
||||||
PROVIDER="${PROVIDER_RAW#* }"
|
|
||||||
TIMES=$( printf '%s\n' "$line" | cut -d':' -f4 | cut -d',' -f1 | tr -d ' ')
|
|
||||||
URL=$( printf '%s\n' "$line" | cut -d'"' -f6 )
|
|
||||||
echo "${IDX}|${TAG}|${COUNTRY}|${PROVIDER}|${TIMES}|${URL}" >> "$TARGET_LIST_FILE"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done <<EOF
|
|
||||||
$TEST_SUITE
|
|
||||||
EOF
|
|
||||||
|
|
||||||
CURL_CON_TIMEOUT=$((CURL_TIMEOUT-2))
|
|
||||||
CURL_SPEED_TIME=$((CURL_TIMEOUT-2))
|
|
||||||
CURL_SPEED_LIMIT=1
|
|
||||||
|
|
||||||
while IFS='|' read -r ID TAG COUNTRY PROVIDER TIMES URL; do
|
|
||||||
[ -z "$TAG" ] && continue
|
[ -z "$TAG" ] && continue
|
||||||
ID=$((ID+1))
|
ID=$((ID+1))
|
||||||
ID3=$( printf '%03d' "$ID" )
|
ID3=$(printf '%03d' "$ID")
|
||||||
COUNTRY=$( echo "$TAG" | cut -d. -f1 )
|
COUNTRY="$(echo "$TAG" | cut -d. -f1)"
|
||||||
CNTFLAG=$( echo "$PROVIDER" | awk '{print $1}' )
|
CNTFLAG="$(echo "$PROVIDER" | awk '{print $1}')"
|
||||||
|
PROVIDER="$(echo "$PROVIDER" | cut -d' ' -f2-)"
|
||||||
URL_NO_PROTO="${URL#*://}"
|
URL_NO_PROTO="${URL#*://}"
|
||||||
DOMAIN="${URL_NO_PROTO%%/*}"
|
DOMAIN="${URL_NO_PROTO%%/*}"
|
||||||
URLPATH="/${URL_NO_PROTO#*/}"
|
URLPATH="/${URL_NO_PROTO#*/}"
|
||||||
[ "$URLPATH" = "/$URL_NO_PROTO" ] && URLPATH="/"
|
[ "$URLPATH" = "/$URL_NO_PROTO" ] && URLPATH="/"
|
||||||
#echo "TAG=$TAG , COUNTRY=$COUNTRY , PROVIDER=$PROVIDER , DOMAIN=$DOMAIN , URL=$URL"
|
#echo "TAG=$TAG , COUNTRY=$COUNTRY , PROVIDER=$PROVIDER , TIMES=$TIMES , URL=$URL"
|
||||||
FNAME="$ZAP_TMP_DIR/$ID3=$TAG=$PROVIDER"
|
|
||||||
(
|
(
|
||||||
DST_IP=
|
DST_IP=$( curl -4 -s -o /dev/null -w '%{remote_ip}\n' $DOMAIN )
|
||||||
RESOLVE_OPT=
|
if [ -z "$DST_IP" ]; then
|
||||||
if [ "$opt_dig" != "" ]; then
|
DST_IP="$( ping -c1 "$DOMAIN" 2>/dev/null | sed -n '1s/.*(\([0-9.]*\)).*/\1/p')"
|
||||||
DST_IP=$( dig +time=2 +retry=1 @$opt_dig +short "$DOMAIN" 2>/dev/null | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | head -n1 )
|
|
||||||
else
|
|
||||||
CURL_TIMEOUTS="--connect-timeout 5 --max-time 6 --speed-time 5 --speed-limit 1"
|
|
||||||
DST_IP=$( curl -4 -I -s $CURL_TIMEOUTS -o /dev/null -w '%{remote_ip}\n' "$URL" )
|
|
||||||
if [ -z "$DST_IP" ]; then
|
|
||||||
DST_IP=$( curl -4 -s $CURL_TIMEOUTS -o /dev/null -r 0-0 -w '%{remote_ip}\n' "$URL" )
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if [ "$DST_IP" = "" ]; then
|
curl -k $URL --resolve $DOMAIN:443:$DST_IP -o /dev/null -s -w '%{size_download}\n' --max-time $CURL_TIMEOUT --range 0-$CURL_RANGETO
|
||||||
DST_IP=$( ping -c1 "$DOMAIN" 2>/dev/null | sed -n '1s/.*(\([0-9.]*\)).*/\1/p' )
|
) >"$ZAP_TMP_DIR/$ID3.$TAG.txt" 2>&1 &
|
||||||
fi
|
done <<EOF
|
||||||
[ "$DST_IP" != "" ] && RESOLVE_OPT="--resolve $DOMAIN:443:$DST_IP"
|
$(printf '%s\n' "$TEST_SUITE" | sed -n '
|
||||||
echo "$DST_IP" > "$FNAME.ip"
|
s/.*id:[[:space:]]*"\([^"]*\)".*provider:[[:space:]]*"\([^"]*\)".*times:[[:space:]]*\([0-9]\+\).*url:[[:space:]]*"\([^"]*\)".*/\1|\2|\3|\4/p
|
||||||
echo "$URL" > "$FNAME.url"
|
')
|
||||||
curl "$URL" \
|
EOF
|
||||||
$RESOLVE_OPT \
|
|
||||||
--connect-timeout $CURL_CON_TIMEOUT \
|
|
||||||
--max-time $CURL_TIMEOUT \
|
|
||||||
--speed-time $CURL_SPEED_TIME \
|
|
||||||
--speed-limit $CURL_SPEED_LIMIT \
|
|
||||||
--range 0-$CURL_RANGETO \
|
|
||||||
-A "$CURL_USERAGENT" \
|
|
||||||
-D "$FNAME.hdr" \
|
|
||||||
-o "$FNAME.body"
|
|
||||||
) > "$FNAME.txt" 2>&1 &
|
|
||||||
done < "$TARGET_LIST_FILE"
|
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|
||||||
printf '%s\n' "$ZAP_TMP_DIR"/*.txt | sort | while IFS= read -r file; do
|
for file in $(ls "$ZAP_TMP_DIR"/*.txt | sort); do
|
||||||
[ -f "$file" ] || continue
|
[ -f "$file" ] || continue
|
||||||
FNAME="${file##*/}"
|
tag="${file##*/}"
|
||||||
FNAME="${FNAME%.txt}"
|
tag="${tag%.txt}"
|
||||||
ID=$( echo "$FNAME" | cut -d= -f1)
|
tag="${tag#*.}"
|
||||||
TAG=$( echo "$FNAME" | cut -d= -f2)
|
res=$( cat "$file" )
|
||||||
PROVIDER=$(echo "$FNAME" | cut -d= -f3 )
|
res=$( trim "$res" )
|
||||||
FNAME="$ZAP_TMP_DIR/$FNAME"
|
|
||||||
BODY_SIZE=0
|
|
||||||
[ -f "$FNAME.body" ] && BODY_SIZE=$( wc -c < "$FNAME.body" )
|
|
||||||
IPADDR="x.x.x.x"
|
|
||||||
[ -s "$FNAME.ip" ] && IPADDR=$( cat "$FNAME.ip" )
|
|
||||||
status=
|
status=
|
||||||
if [ ! -f "$FNAME.hdr" ]; then
|
case "$res" in
|
||||||
status="ERROR: cannot Get Headers"
|
''|*[!0-9]*)
|
||||||
elif [ ! -s "$FNAME.hdr" ]; then
|
status="Error (incorrect value)"
|
||||||
status="ERROR: cannot get headers"
|
;;
|
||||||
elif [ ! -f "$FNAME.body" ]; then
|
esac
|
||||||
status="ERROR: cannot get body"
|
if [ -z "$status" ]; then
|
||||||
elif [ ! -s "$FNAME.body" ]; then
|
if [ "$res" = 0 ]; then
|
||||||
status="Possibly detected"
|
status="Possibly detected"
|
||||||
else
|
elif [ "$res" -lt $CURL_RANGETO ]; then
|
||||||
if [ "$BODY_SIZE" -le $CURL_RANGETO ]; then
|
status="Failed to complete detection"
|
||||||
status="Failed to complete detection (recv $BODY_SIZE bytes)"
|
|
||||||
else
|
else
|
||||||
status="[ OK ]"
|
status="[ OK ]"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
printf '%12s / %-15s / %-13s: %s \n' "$TAG" "$IPADDR" "$PROVIDER" "$status"
|
printf '%12s: %s \n' "$tag" "$status"
|
||||||
echo "$BODY_SIZE" > "$FNAME.size"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f "$ZAP_TMP_DIR"/*.body >/dev/null 2>&1
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ gosuslugi.ru
|
|||||||
mos-gorsud.ru
|
mos-gorsud.ru
|
||||||
gov.ru
|
gov.ru
|
||||||
sudrf.ru
|
sudrf.ru
|
||||||
ottai.com
|
|
||||||
ipstream.one
|
ipstream.one
|
||||||
vkusvill.ru
|
|
||||||
kinopoisk.ru
|
|
||||||
#################################### Epicgames
|
#################################### Epicgames
|
||||||
easy.ac
|
easy.ac
|
||||||
fab.com
|
fab.com
|
||||||
@@ -39,14 +36,45 @@ cubicmotion.com
|
|||||||
playparagon.com
|
playparagon.com
|
||||||
realityscan.com
|
realityscan.com
|
||||||
epicgamescdn.com
|
epicgamescdn.com
|
||||||
|
et.epicgames.com
|
||||||
|
ol.epicgames.com
|
||||||
radgametools.com
|
radgametools.com
|
||||||
unrealengine.com
|
unrealengine.com
|
||||||
|
api.epicgames.dev
|
||||||
easyanticheat.net
|
easyanticheat.net
|
||||||
shadowcomplex.com
|
shadowcomplex.com
|
||||||
battlebreakers.com
|
battlebreakers.com
|
||||||
|
store.epicgames.com
|
||||||
capturingreality.com
|
capturingreality.com
|
||||||
unrealtournament.com
|
unrealtournament.com
|
||||||
|
cdn1.unrealengine.com
|
||||||
|
cdn2.unrealengine.com
|
||||||
|
accounts.epicgames.com
|
||||||
|
download.epicgames.com
|
||||||
|
tracking.epicgames.com
|
||||||
|
download2.epicgames.com
|
||||||
|
download3.epicgames.com
|
||||||
|
download4.epicgames.com
|
||||||
|
metrics.ol.epicgames.com
|
||||||
|
datarouter.ol.epicgames.com
|
||||||
|
fastly-download.epicgames.com
|
||||||
|
store-content.ak.epicgames.com
|
||||||
|
static-assets-prod.epicgames.com
|
||||||
epicgames-download1.akamaized.net
|
epicgames-download1.akamaized.net
|
||||||
|
launcher-website-prod07.ol.epicgames.com
|
||||||
|
ut-public-service-prod10.ol.epicgames.com
|
||||||
|
store-site-backend-static.ak.epicgames.com
|
||||||
|
library-service.live.use1a.on.epicgames.com
|
||||||
|
accountportal-website-prod07.ol.epicgames.com
|
||||||
|
account-public-service-prod03.ol.epicgames.com
|
||||||
|
catalog-public-service-prod06.ol.epicgames.com
|
||||||
|
friends-public-service-prod06.ol.epicgames.com
|
||||||
|
launcher-public-service-prod06.ol.epicgames.com
|
||||||
|
entitlement-public-service-prod08.ol.epicgames.com
|
||||||
|
lightswitch-public-service-prod06.ol.epicgames.com
|
||||||
|
orderprocessor-public-service-ecomprod01.ol.epicgames.com
|
||||||
|
launcherwaitingroom-public-service-prod06.ol.epicgames.com
|
||||||
|
datastorage-public-service-liveegs.live.use1a.on.epicgames.com
|
||||||
#################################### Steam
|
#################################### Steam
|
||||||
s.team
|
s.team
|
||||||
steam.tv
|
steam.tv
|
||||||
@@ -74,49 +102,99 @@ valvesoftware.net
|
|||||||
steam.cdn.webra.ru
|
steam.cdn.webra.ru
|
||||||
steambroadcast.com
|
steambroadcast.com
|
||||||
steamcommunity.com
|
steamcommunity.com
|
||||||
|
cdn.steamstatic.com
|
||||||
|
cs.steampowered.com
|
||||||
dl.steam.clngaa.com
|
dl.steam.clngaa.com
|
||||||
steam.ru.qtlglb.com
|
steam.ru.qtlglb.com
|
||||||
|
api.steampowered.com
|
||||||
steam.eca.qtlglb.com
|
steam.eca.qtlglb.com
|
||||||
steamusercontent.com
|
steamusercontent.com
|
||||||
|
help.steampowered.com
|
||||||
steam.apac.qtlglb.com
|
steam.apac.qtlglb.com
|
||||||
steam.naeu.qtlglb.com
|
steam.naeu.qtlglb.com
|
||||||
cdn.steamcommunity.com
|
cdn.steamcommunity.com
|
||||||
gstore.val.manlaxy.com
|
gstore.val.manlaxy.com
|
||||||
|
login.steampowered.com
|
||||||
|
media.steampowered.com
|
||||||
partner.steamgames.com
|
partner.steamgames.com
|
||||||
|
shared.steamstatic.com
|
||||||
steam.cdn.orcon.net.nz
|
steam.cdn.orcon.net.nz
|
||||||
|
store.steampowered.com
|
||||||
steamcdn-a.akamaihd.net
|
steamcdn-a.akamaihd.net
|
||||||
steampipe.akamaized.net
|
steampipe.akamaized.net
|
||||||
|
partner.steampowered.com
|
||||||
steamcdn-a.akamaized.net
|
steamcdn-a.akamaized.net
|
||||||
steamdeckusercontent.com
|
steamdeckusercontent.com
|
||||||
|
support.steampowered.com
|
||||||
|
checkout.steampowered.com
|
||||||
|
community.steamstatic.com
|
||||||
steam.cdn.slingshot.co.nz
|
steam.cdn.slingshot.co.nz
|
||||||
steammobile.akamaized.net
|
steammobile.akamaized.net
|
||||||
steamstatic.akamaized.net
|
steamstatic.akamaized.net
|
||||||
steamstore-a.akamaihd.net
|
steamstore-a.akamaihd.net
|
||||||
steamvideo-a.akamaihd.net
|
steamvideo-a.akamaihd.net
|
||||||
|
workshop.steampowered.com
|
||||||
|
cdn.akamai.steamstatic.com
|
||||||
|
cdn.fastly.steamstatic.com
|
||||||
client-update.queniuqe.com
|
client-update.queniuqe.com
|
||||||
|
community.steampowered.com
|
||||||
steamdeckcdn.akamaized.net
|
steamdeckcdn.akamaized.net
|
||||||
steampipe-kr.akamaized.net
|
steampipe-kr.akamaized.net
|
||||||
|
clan.fastly.steamstatic.com
|
||||||
steamcontent-a.akamaihd.net
|
steamcontent-a.akamaihd.net
|
||||||
steambroadcast.akamaized.net
|
steambroadcast.akamaized.net
|
||||||
steamcommunity.akamaized.net
|
steamcommunity.akamaized.net
|
||||||
|
store.akamai.steamstatic.com
|
||||||
|
store.fastly.steamstatic.com
|
||||||
scontent.steamusercontent.com
|
scontent.steamusercontent.com
|
||||||
|
shared.fastly.steamstatic.com
|
||||||
steamcommunity-a.akamaihd.net
|
steamcommunity-a.akamaihd.net
|
||||||
|
avatars.fastly.steamstatic.com
|
||||||
|
cdn.cloudflare.steamstatic.com
|
||||||
edge.steam-dns.top.comcast.net
|
edge.steam-dns.top.comcast.net
|
||||||
steamcommunity-a.akamaized.net
|
steamcommunity-a.akamaized.net
|
||||||
steamuserimages-a.akamaihd.net
|
steamuserimages-a.akamaihd.net
|
||||||
steampipe-partner.akamaized.net
|
steampipe-partner.akamaized.net
|
||||||
steamusercontent-a.akamaihd.net
|
steamusercontent-a.akamaihd.net
|
||||||
|
client-download.steampowered.com
|
||||||
|
community.fastly.steamstatic.com
|
||||||
|
store.cloudflare.steamstatic.com
|
||||||
|
community.cloudflare.steamstatic.com
|
||||||
steamcdn-a.akamaihd.net.edgesuite.net
|
steamcdn-a.akamaihd.net.edgesuite.net
|
||||||
steamcloudsweden.blob.core.windows.net
|
steamcloudsweden.blob.core.windows.net
|
||||||
|
steamcommunity.cloudflare.steamstatic.com
|
||||||
steamcommunity-a.akamaihd.net.edgesuite.net
|
steamcommunity-a.akamaihd.net.edgesuite.net
|
||||||
#################################### OpenWRT
|
#################################### OpenWRT
|
||||||
|
github.com
|
||||||
openwrt.org
|
openwrt.org
|
||||||
|
gh.openwrt.org
|
||||||
|
cdn.openwrt.org
|
||||||
|
dev.openwrt.org
|
||||||
|
git.openwrt.org
|
||||||
lede-project.org
|
lede-project.org
|
||||||
|
wiki.openwrt.org
|
||||||
|
forum.openwrt.org
|
||||||
|
lists.openwrt.org
|
||||||
|
openwrt.gitlab.io
|
||||||
|
archive.openwrt.org
|
||||||
|
downloads.openwrt.org
|
||||||
|
fwdownloads.openwrt.org
|
||||||
|
mirror-01.infra.openwrt.org
|
||||||
|
mirror-02.infra.openwrt.org
|
||||||
|
mirror-03.infra.openwrt.org
|
||||||
|
mirror-04.infra.openwrt.org
|
||||||
#################################### UbisoftConnect
|
#################################### UbisoftConnect
|
||||||
ubi.com
|
ubi.com
|
||||||
ubisoft.com
|
ubisoft.com
|
||||||
|
store.ubi.com
|
||||||
ubisoftconnect.com
|
ubisoftconnect.com
|
||||||
connect.ubisoft.comubisoft-orbit-savegames.s3.amazonaws.com
|
connect.ubisoft.com
|
||||||
|
drops-register.ubi.com
|
||||||
|
public-ubiservices.ubi.com
|
||||||
|
ubisoftconnect.cdn.ubi.com
|
||||||
|
uplaypc-s-ubisoft.cdn.ubi.com
|
||||||
|
uplaypc-s-ubisoft-ww.cdn.ubi.com
|
||||||
|
ubisoft-orbit-savegames.s3.amazonaws.com
|
||||||
ubisoft-uplay-savegames.s3.amazonaws.com
|
ubisoft-uplay-savegames.s3.amazonaws.com
|
||||||
#################################### Aliexpress
|
#################################### Aliexpress
|
||||||
ae.com
|
ae.com
|
||||||
@@ -136,152 +214,43 @@ playstation.net
|
|||||||
playstation.com
|
playstation.com
|
||||||
account.sony.com
|
account.sony.com
|
||||||
psremoteplay.com
|
psremoteplay.com
|
||||||
|
ps4.playstation.com
|
||||||
|
ps5.playstation.com
|
||||||
playstationcloud.com
|
playstationcloud.com
|
||||||
|
psapi.playstation.net
|
||||||
|
store.playstation.com
|
||||||
|
media.playstation.com
|
||||||
|
auth.np.ac.playstation.net
|
||||||
sonyentertainmentnetwork.com
|
sonyentertainmentnetwork.com
|
||||||
|
np.community.playstation.net
|
||||||
|
id.sonyentertainmentnetwork.com
|
||||||
#################################### Twitch
|
#################################### Twitch
|
||||||
twitch.tv
|
twitch.tv
|
||||||
ttvnw.net
|
ttvnw.net
|
||||||
jtvnw.net
|
jtvnw.net
|
||||||
|
twimg.com
|
||||||
|
m.twitch.tv
|
||||||
|
id.twitch.tv
|
||||||
|
www.twitch.tv
|
||||||
twitchcdn.net
|
twitchcdn.net
|
||||||
ext-twitch.tv
|
ext-twitch.tv
|
||||||
twitchsvc.net
|
twitchsvc.net
|
||||||
|
api.twitch.tv
|
||||||
|
gql.twitch.tv
|
||||||
|
dev.twitch.tv
|
||||||
live-video.net
|
live-video.net
|
||||||
twitch.a2z.com
|
twitch.a2z.com
|
||||||
|
chat.twitch.tv
|
||||||
|
help.twitch.tv
|
||||||
|
assets.twitch.tv
|
||||||
twitch-shadow.net
|
twitch-shadow.net
|
||||||
|
passport.twitch.tv
|
||||||
|
irc.chat.twitch.tv
|
||||||
|
vod-metro.twitch.tv
|
||||||
twitchcdn-shadow.net
|
twitchcdn-shadow.net
|
||||||
#################################### Valorant
|
static.twitchcdn.net
|
||||||
qq.com
|
vod-secure.twitch.tv
|
||||||
pvp.net
|
irc-ws.chat.twitch.tv
|
||||||
vivox.com
|
pubsub-edge.twitch.tv
|
||||||
sd-rtn.com
|
vod-pop-secure.twitch.tv
|
||||||
adjust.com
|
|
||||||
riotcdn.net
|
|
||||||
adobess.com
|
|
||||||
valorant.com
|
|
||||||
akamaihd.net
|
|
||||||
myqcloud.com
|
|
||||||
riotgames.com
|
|
||||||
playvalorant.com
|
|
||||||
wildrift-na.akamaized.net
|
|
||||||
#################################### TikTok
|
|
||||||
musical.ly
|
|
||||||
tiktok.com
|
|
||||||
tiktokv.eu
|
|
||||||
tiktokv.us
|
|
||||||
tiktokw.eu
|
|
||||||
tiktokw.us
|
|
||||||
muscdn.com
|
|
||||||
tiktokd.net
|
|
||||||
tiktokd.org
|
|
||||||
tiktokv.com
|
|
||||||
tiktokcdn.com
|
|
||||||
ibytedtos.com
|
|
||||||
ttwstatic.com
|
|
||||||
tik-tokapi.com
|
|
||||||
tiktok-row.net
|
|
||||||
tiktokminis.us
|
|
||||||
byteoversea.com
|
|
||||||
tiktok-minis.com
|
|
||||||
tiktokcdn-eu.com
|
|
||||||
tiktokcdn-us.com
|
|
||||||
tiktokeu-cdn.com
|
|
||||||
tiktokrow-cdn.com
|
|
||||||
tiktokglobalshopv.com
|
|
||||||
tiktokcdn.com.akamaized.net
|
|
||||||
tiktokcdn.com.edgesuite.net
|
|
||||||
tiktokcdn-us.com.edgesuite.net
|
|
||||||
#################################### Hoyoverse
|
|
||||||
hoyo.link
|
|
||||||
hoyolab.com
|
|
||||||
yuanshen.com
|
|
||||||
hoyoverse.com
|
|
||||||
genshinimpact.com
|
|
||||||
zenlesszonezero.com
|
|
||||||
#################################### Xiaomi
|
|
||||||
mi.com
|
|
||||||
miui.com
|
|
||||||
wali.com
|
|
||||||
c.mi.com
|
|
||||||
mgslb.com
|
|
||||||
mifile.cn
|
|
||||||
xiaomi.cn
|
|
||||||
mipay.com
|
|
||||||
youpin.cn
|
|
||||||
zmifi.com
|
|
||||||
mi-idc.com
|
|
||||||
mi-img.com
|
|
||||||
mijia.tech
|
|
||||||
mitvos.com
|
|
||||||
miwifi.com
|
|
||||||
xiaomi.com
|
|
||||||
xiaomi.net
|
|
||||||
duokan.com
|
|
||||||
saxyit.com
|
|
||||||
mi-fan.com
|
|
||||||
mihome.com
|
|
||||||
xiaomisa.cn
|
|
||||||
migames.com
|
|
||||||
miaibox.com
|
|
||||||
mi-home.com
|
|
||||||
xiaomicp.com
|
|
||||||
xiaomidns.cn
|
|
||||||
xiaomiev.com
|
|
||||||
xiaomiinc.cn
|
|
||||||
xiaominr.com
|
|
||||||
xiaomisa.com
|
|
||||||
xiaomisa.net
|
|
||||||
xiaomisa.org
|
|
||||||
roborock.com
|
|
||||||
mi-robot.com
|
|
||||||
yeelight.com
|
|
||||||
miot-spec.cn
|
|
||||||
xiaomidns.com
|
|
||||||
xiaomidns.net
|
|
||||||
xiaomiinc.com
|
|
||||||
xiaomiinc.net
|
|
||||||
duokanbox.com
|
|
||||||
youpin.com.cn
|
|
||||||
miot-spec.org
|
|
||||||
miot-spec.com
|
|
||||||
xiaomiwear.com
|
|
||||||
xiaomimimo.com
|
|
||||||
dreamehome.com
|
|
||||||
xiaomiprint.com
|
|
||||||
xiaomidns.com.cn
|
|
||||||
xiaomiinc.com.cn
|
|
||||||
xiaomimobile.com
|
|
||||||
xiaomixiaoai.com
|
|
||||||
xiaomiyoupin.com
|
|
||||||
xiaoaiassist.com
|
|
||||||
xiaomi-mijia.com
|
|
||||||
xiaomifactory.com
|
|
||||||
airstarfinance.net
|
|
||||||
dreame-technology.cn
|
|
||||||
dreame-technology.com
|
|
||||||
#################################### Picooc
|
|
||||||
picoocru.com
|
|
||||||
picooc-g.com
|
|
||||||
picooc-int.com
|
|
||||||
#################################### Huawei
|
|
||||||
hc-cdn.cn
|
|
||||||
huawei.ru
|
|
||||||
huawei.com
|
|
||||||
hc-cdn.com
|
|
||||||
huawei.net
|
|
||||||
dbankcdn.ru
|
|
||||||
hicloud.com
|
|
||||||
dbankcdn.com
|
|
||||||
dbankcloud.ru
|
|
||||||
dbankcloud.cn
|
|
||||||
dbankcloud.com
|
|
||||||
huaweicloud.com
|
|
||||||
huaweistatic.com
|
|
||||||
hwclouds-dns.com
|
|
||||||
hwclouds-dns.net
|
|
||||||
myhuaweicloud.cn
|
|
||||||
myhuaweicloud.com
|
|
||||||
huaweicloud-dns.cn
|
|
||||||
huaweicloud-dns.ru
|
|
||||||
huaweicloud-dns.com
|
|
||||||
huaweicloud-dns.org
|
|
||||||
####################################
|
####################################
|
||||||
|
|||||||
@@ -14,11 +14,6 @@ if echo "$opt_flags" | grep -q "(reset_ipset)"; then
|
|||||||
restore_all_ipset_cfg
|
restore_all_ipset_cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo "$opt_flags" | grep -q "(erase_autohostlist)"; then
|
|
||||||
: > $ZAPRET_BASE/ipset/zapret-hosts-auto.txt
|
|
||||||
: > $ZAPRET_BASE/ipset/zapret-hosts-auto-debug.log
|
|
||||||
fi
|
|
||||||
|
|
||||||
create_default_cfg "$opt_flags" "$opt_strat"
|
create_default_cfg "$opt_flags" "$opt_strat"
|
||||||
|
|
||||||
if [ "$cfg_run_on_boot" = "1" ]; then
|
if [ "$cfg_run_on_boot" = "1" ]; then
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function sync_param
|
|||||||
local value="$( uci -q get $ZAPRET_CFG_SEC.$param )"
|
local value="$( uci -q get $ZAPRET_CFG_SEC.$param )"
|
||||||
uncomment_param $param
|
uncomment_param $param
|
||||||
append_param $param
|
append_param $param
|
||||||
local TAB="$( printf '\t' )"
|
local TAB="$( echo -n -e '\t' )"
|
||||||
if [ "$value" = "$TAB" ]; then
|
if [ "$value" = "$TAB" ]; then
|
||||||
value=""
|
value=""
|
||||||
fi
|
fi
|
||||||
@@ -101,7 +101,6 @@ sync_param AUTOHOSTLIST_FAIL_TIME
|
|||||||
if [ $ZAPRET_CFG_NAME = "zapret2" ]; then
|
if [ $ZAPRET_CFG_NAME = "zapret2" ]; then
|
||||||
sync_param AUTOHOSTLIST_INCOMING_MAXSEQ
|
sync_param AUTOHOSTLIST_INCOMING_MAXSEQ
|
||||||
sync_param AUTOHOSTLIST_RETRANS_MAXSEQ
|
sync_param AUTOHOSTLIST_RETRANS_MAXSEQ
|
||||||
sync_param AUTOHOSTLIST_RETRANS_RESET
|
|
||||||
sync_param AUTOHOSTLIST_UDP_IN
|
sync_param AUTOHOSTLIST_UDP_IN
|
||||||
sync_param AUTOHOSTLIST_UDP_OUT
|
sync_param AUTOHOSTLIST_UDP_OUT
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (c) 2024 remittor
|
# Copyright (c) 2024 remittor
|
||||||
|
|
||||||
[ ! -f /opt/zapret/comfunc.sh ] && exit 0
|
|
||||||
|
|
||||||
. /opt/zapret/comfunc.sh
|
. /opt/zapret/comfunc.sh
|
||||||
|
|
||||||
mkdir -p $ZAPRET_BASE/ipset
|
|
||||||
|
|
||||||
# create empty txt files into ipset directory
|
# create empty txt files into ipset directory
|
||||||
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-google.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-google.txt"
|
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-google.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-google.txt"
|
||||||
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-auto.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-auto.txt"
|
#[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-auto.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-auto.txt"
|
||||||
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-user.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-user.txt"
|
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-user.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-user.txt"
|
||||||
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-user-ipban.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-user-ipban.txt"
|
[ ! -f "$ZAPRET_BASE/ipset/zapret-hosts-user-ipban.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-hosts-user-ipban.txt"
|
||||||
#[ ! -f "$ZAPRET_BASE/ipset/zapret-ip.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-ip.txt"
|
#[ ! -f "$ZAPRET_BASE/ipset/zapret-ip.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-ip.txt"
|
||||||
@@ -18,6 +14,5 @@ mkdir -p $ZAPRET_BASE/ipset
|
|||||||
[ ! -f "$ZAPRET_BASE/ipset/zapret-ip-user-ipban.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-ip-user-ipban.txt"
|
[ ! -f "$ZAPRET_BASE/ipset/zapret-ip-user-ipban.txt" ] && touch "$ZAPRET_BASE/ipset/zapret-ip-user-ipban.txt"
|
||||||
|
|
||||||
# create or merge uci-config
|
# create or merge uci-config
|
||||||
[ ! -f "$ZAPRET_BASE/renew-cfg.sh" ] && exit 0
|
|
||||||
$ZAPRET_BASE/renew-cfg.sh
|
$ZAPRET_BASE/renew-cfg.sh
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ if [ "$opt_update" != "" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! command -v unzip >/dev/null 2>&1; then
|
if ! command -v unzip >/dev/null 2>&1; then
|
||||||
echo "ERROR: package \"unzip\" not installed!"
|
echo "ERROR: package \"upzip\" not installed!"
|
||||||
return 218
|
return 218
|
||||||
fi
|
fi
|
||||||
unzip -q "$ZAP_PKG_FN" -d $ZAP_PKG_DIR
|
unzip -q "$ZAP_PKG_FN" -d $ZAP_PKG_DIR
|
||||||
|
|||||||
Reference in New Issue
Block a user