From 4f37c19771cdb8030d13eec2f0b6c009e79b9f4d Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 29 Oct 2024 20:29:49 +0300 Subject: [PATCH] marker in daemons opts --- common/list.sh | 12 ++++++++---- config.default | 17 ++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/common/list.sh b/common/list.sh index a00499e..76e07a3 100644 --- a/common/list.sh +++ b/common/list.sh @@ -1,4 +1,5 @@ readonly HOSTLIST_MARKER="" +readonly HOSTLIST_NOAUTO_MARKER="" find_hostlists() { @@ -24,10 +25,10 @@ filter_apply_hostlist_target() { # $1 - var name of tpws or nfqws params - local v parm parm1 parm2 parm3 parm4 parm5 parm6 parm7 + local v parm parm1 parm2 parm3 parm4 parm5 parm6 parm7 parm8 parmNA + local hmarker hmarkerNA eval v="\$$1" - contains "$v" "$HOSTLIST_MARKER" && - { + if contains "$v" "$HOSTLIST_MARKER" || contains "$v" "$HOSTLIST_NOAUTO_MARKER"; then [ "$MODE_FILTER" = hostlist -o "$MODE_FILTER" = autohostlist ] && { find_hostlists @@ -40,13 +41,16 @@ filter_apply_hostlist_target() parm5="${AUTOHOSTLIST_FAIL_THRESHOLD:+--hostlist-auto-fail-threshold=$AUTOHOSTLIST_FAIL_THRESHOLD}" parm6="${AUTOHOSTLIST_FAIL_TIME:+--hostlist-auto-fail-time=$AUTOHOSTLIST_FAIL_TIME}" parm7="${AUTOHOSTLIST_RETRANS_THRESHOLD:+--hostlist-auto-retrans-threshold=$AUTOHOSTLIST_RETRANS_THRESHOLD}" + parm8="--hostlist=$HOSTLIST_AUTO" } parm="$parm1${parm2:+ $parm2}${parm3:+ $parm3}${parm4:+ $parm4}${parm5:+ $parm5}${parm6:+ $parm6}${parm7:+ $parm7}" + parmNA="$parm1${parm2:+ $parm2}${parm3:+ $parm3}${parm8:+ $parm8}" } + v="$(replace_str $HOSTLIST_NOAUTO_MARKER "$parmNA" "$v")" v="$(replace_str $HOSTLIST_MARKER "$parm" "$v")" [ "$MODE_FILTER" = autohostlist -a "$AUTOHOSTLIST_DEBUGLOG" = 1 ] && { v="$v --hostlist-auto-debug=$HOSTLIST_AUTO_DEBUGLOG" } eval $1=\""$v"\" - } + fi } diff --git a/config.default b/config.default index 942e248..5c66a57 100644 --- a/config.default +++ b/config.default @@ -50,8 +50,9 @@ DESYNC_MARK_POSTNAT=0x20000000 TPWS_SOCKS_ENABLE=0 # tpws socks listens on this port on localhost and LAN interfaces TPPORT_SOCKS=987 -# use placeholders to engage standard hostlists and autohostlist in ipset dir -# they are replaced to empty string if MODE_FILTER does not satisfy +# use and placeholders to engage standard hostlists and autohostlist in ipset dir +# hostlist markers are replaced to empty string if MODE_FILTER does not satisfy +# appends ipset/zapret-hosts-auto.txt as normal list TPWS_SOCKS_OPT=" --filter-tcp=80 --methodeol --new --filter-tcp=443 --split-tls=sni --disorder @@ -59,8 +60,9 @@ TPWS_SOCKS_OPT=" TPWS_ENABLE=0 TPWS_PORTS=80,443 -# use placeholders to engage standard hostlists and autohostlist in ipset dir -# they are replaced to empty string if MODE_FILTER does not satisfy +# use and placeholders to engage standard hostlists and autohostlist in ipset dir +# hostlist markers are replaced to empty string if MODE_FILTER does not satisfy +# appends ipset/zapret-hosts-auto.txt as normal list TPWS_OPT=" --filter-tcp=80 --methodeol --new --filter-tcp=443 --split-tls=sni --disorder @@ -83,12 +85,13 @@ NFQWS_UDP_PKT_IN=0 # this mode can be very CPU consuming. enable with care ! #NFQWS_PORTS_TCP_KEEPALIVE=80 #NFQWS_PORTS_UDP_KEEPALIVE= -# use placeholders to engage standard hostlists and autohostlist in ipset dir -# they are replaced to empty string if MODE_FILTER does not satisfy +# use and placeholders to engage standard hostlists and autohostlist in ipset dir +# hostlist markers are replaced to empty string if MODE_FILTER does not satisfy +# appends ipset/zapret-hosts-auto.txt as normal list NFQWS_OPT=" --filter-tcp=80 --dpi-desync=fake,split2 --dpi-desync-fooling=md5sig --new --filter-tcp=443 --dpi-desync=fake,disorder2 --dpi-desync-fooling=md5sig --new ---filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 +--filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 " # none,ipset,hostlist,autohostlist