Zapret : Enable autolist & new params.

This commit is contained in:
Dmitry Voronin 2024-09-02 13:03:19 +03:00
parent 0b5bddca2a
commit 88bed3b96a
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 16 additions and 3 deletions

View file

@ -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
'';
};
};

View file

@ -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";