From 88bed3b96a033405fbc22445af874bf816cd7436 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Mon, 2 Sep 2024 13:03:19 +0300 Subject: [PATCH] Zapret : Enable autolist & new params. --- host/x86_64-linux/home/default.nix | 8 ++++++-- module/Zapret.nix | 11 ++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/host/x86_64-linux/home/default.nix b/host/x86_64-linux/home/default.nix index 37514c5..65c9d0a 100644 --- a/host/x86_64-linux/home/default.nix +++ b/host/x86_64-linux/home/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ config, ... }: { imports = [ ./Backup.nix ./Container.nix @@ -33,7 +33,8 @@ }; zapret = { enable = true; - params = "--dpi-desync=fake,split2 --dpi-desync-fooling=datanoack"; + params = "--dpi-desync=fake,disorder2 --dpi-desync-ttl=1 --dpi-desync-autottl=2"; + autolist = "${config.container.module.frkn.storage}/Autolist.txt"; whitelist = '' youtube.com googlevideo.com @@ -43,6 +44,9 @@ rutracker.cc rutrk.org t-ru.org + medium.com + quora.com + quoracdn.net ''; }; }; diff --git a/module/Zapret.nix b/module/Zapret.nix index 8524e4c..2c47d4c 100644 --- a/module/Zapret.nix +++ b/module/Zapret.nix @@ -9,6 +9,11 @@ blacklist = if cfg.blacklist != null then "--hostlist-exclude ${pkgs.writeText "ZapretBlacklist" (util.trimTabs cfg.blacklist)}" else ""; + + # ISSUE: Seems broken. Adds nothing automatically. + autolist = if cfg.autolist != null then + "--hostlist-auto ${cfg.autolist}" + else ""; in { options = { module.zapret = mkOption { @@ -28,6 +33,10 @@ in { default = null; type = types.nullOr types.str; }; + autolist = mkOption { + default = null; + type = types.nullOr types.str; + }; qnum = mkOption { default = 200; type = types.int; @@ -49,7 +58,7 @@ in { requires = [ "network.target" ]; path = with pkgs; [ zapret ]; serviceConfig = { - ExecStart = "${pkgs.zapret}/bin/nfqws --pidfile=/run/nfqws.pid ${cfg.params} ${whitelist} ${blacklist} --qnum=${toString cfg.qnum}"; + ExecStart = "${pkgs.zapret}/bin/nfqws --pidfile=/run/nfqws.pid ${cfg.params} ${whitelist} ${blacklist} ${autolist} --qnum=${toString cfg.qnum}"; Type = "simple"; PIDFile = "/run/nfqws.pid"; ExecReload = "/bin/kill -HUP $MAINPID";