mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2025-12-31 21:59:06 +03:00
config: Add new options for AutoHostList
This commit is contained in:
@@ -226,6 +226,14 @@ return view.extend({
|
||||
o.write = function(section_id, value) {
|
||||
return uci.set(tools.appName, section_id, 'MODE_FILTER', value === '1' ? 'autohostlist' : 'hostlist');
|
||||
};
|
||||
|
||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_INCOMING_MAXSEQ', _('INCOMING_MAXSEQ'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'uinteger';
|
||||
|
||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_MAXSEQ', _('RETRANS_MAXSEQ'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'uinteger';
|
||||
|
||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_THRESHOLD', _('RETRANS_THRESHOLD'));
|
||||
o.rmempty = false;
|
||||
@@ -239,6 +247,14 @@ return view.extend({
|
||||
o.rmempty = false;
|
||||
o.datatype = 'uinteger';
|
||||
|
||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_UDP_IN', _('UDP_IN'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'uinteger';
|
||||
|
||||
o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_UDP_OUT', _('UDP_OUT'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'uinteger';
|
||||
|
||||
o = s.taboption(tabname, form.Button, '_auto_host_btn', _('Auto host list entries'));
|
||||
o.inputtitle = _('Edit');
|
||||
o.inputstyle = 'edit btn';
|
||||
|
||||
@@ -30,9 +30,15 @@ IP2NET_OPT4="--prefix-length=22-30 --v4-threshold=3/4"
|
||||
IP2NET_OPT6="--prefix-length=56-64 --v6-threshold=5"
|
||||
|
||||
# options for auto hostlist
|
||||
# NOTE : in order for these adjustment to work it's required to redirect enough starting packets
|
||||
# NOTE : set PKT_IN, PKT_OUT variables appropriately
|
||||
AUTOHOSTLIST_INCOMING_MAXSEQ=4096
|
||||
AUTOHOSTLIST_RETRANS_MAXSEQ=32768
|
||||
AUTOHOSTLIST_RETRANS_THRESHOLD=3
|
||||
AUTOHOSTLIST_FAIL_THRESHOLD=3
|
||||
AUTOHOSTLIST_FAIL_TIME=60
|
||||
AUTOHOSTLIST_UDP_IN=1
|
||||
AUTOHOSTLIST_UDP_OUT=4
|
||||
# 1 = debug autohostlist positives to ipset/zapret-hosts-auto-debug.log
|
||||
AUTOHOSTLIST_DEBUGLOG=0
|
||||
|
||||
|
||||
@@ -21,9 +21,13 @@ function set_cfg_reset_values
|
||||
set $cfgname.config.DAEMON_LOG_ENABLE='0'
|
||||
set $cfgname.config.DAEMON_LOG_FILE='/tmp/zapret+<DAEMON_NAME>+<DAEMON_IDNUM>+<DAEMON_CFGNAME>.log'
|
||||
# autohostlist options
|
||||
set $cfgname.config.AUTOHOSTLIST_INCOMING_MAXSEQ='4096'
|
||||
set $cfgname.config.AUTOHOSTLIST_RETRANS_MAXSEQ='32768'
|
||||
set $cfgname.config.AUTOHOSTLIST_RETRANS_THRESHOLD='3'
|
||||
set $cfgname.config.AUTOHOSTLIST_FAIL_THRESHOLD='3'
|
||||
set $cfgname.config.AUTOHOSTLIST_FAIL_TIME='60'
|
||||
set $cfgname.config.AUTOHOSTLIST_UDP_IN='1'
|
||||
set $cfgname.config.AUTOHOSTLIST_UDP_OUT='4'
|
||||
set $cfgname.config.AUTOHOSTLIST_DEBUGLOG='0'
|
||||
# nfqws options
|
||||
set $cfgname.config.NFQWS2_ENABLE='1'
|
||||
|
||||
Reference in New Issue
Block a user