clean up completed
This commit is contained in:
parent
a763e32e42
commit
c7b97b23ae
@ -6,6 +6,8 @@
|
|||||||
servers = {
|
servers = {
|
||||||
|
|
||||||
nixd.enable = true;
|
nixd.enable = true;
|
||||||
|
gopls.enable = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
grimblast
|
grimblast
|
||||||
vlc
|
vlc
|
||||||
|
|
||||||
# Personal love
|
|
||||||
nautilus
|
|
||||||
|
|
||||||
# Social stuff
|
# Social stuff
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
services.privoxy = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
forward = [ ".i2p localhost:4444" ".i2p localhost:4445" "/ 35.185.196.38:3128" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,49 +1,60 @@
|
|||||||
{ pkgs, ... }: {
|
{ ... }:
|
||||||
disabledModules = [ "services/networking/zapret.nix" ]; # необходимо если версия nixpkgs новее 5a5c04d
|
{
|
||||||
|
services = {
|
||||||
imports = [ ./zapret_service.nix ];
|
zapret = {
|
||||||
|
enable = true;
|
||||||
services.zapret = {
|
params = [
|
||||||
enable = true;
|
"--dpi-desync-autottl=3"
|
||||||
mode = "nfqws";
|
"--wssize 1:6"
|
||||||
|
"--dpi-desync-fake-tls=0x00000000"
|
||||||
settings = ''
|
"--dpi-desync-split-pos=1"
|
||||||
SET_MAXELEM=522288
|
"--dpi-desync=syndata,fake,split2"
|
||||||
IPSET_OPT="hashsize 262144 maxelem $SET_MAXELEM"
|
"--dpi-desync-repeats=6"
|
||||||
|
"--dpi-desync-fooling=md5sig"
|
||||||
IP2NET_OPT4="--prefix-length=22-30 --v4-threshold=3/4"
|
"--new"
|
||||||
IP2NET_OPT6="--prefix-length=56-64 --v6-threshold=5"
|
];
|
||||||
AUTOHOSTLIST_RETRANS_THRESHOLD=3
|
whitelist = [
|
||||||
AUTOHOSTLIST_FAIL_THRESHOLD=3
|
"googlevideo.com"
|
||||||
AUTOHOSTLIST_FAIL_TIME=60
|
"youtu.be"
|
||||||
AUTOHOSTLIST_DEBUGLOG=0
|
"youtube.com"
|
||||||
|
"youtubei.googleapis.com"
|
||||||
MDIG_THREADS=30
|
"googlevideo.com"
|
||||||
|
"youtu.be"
|
||||||
GZIP_LISTS=1
|
"youtube.com"
|
||||||
QUIC_PORTS=50000-65535
|
"youtubei.googleapis.com"
|
||||||
|
"youtubeembeddedplayer.googleapis.com"
|
||||||
MODE=nfqws
|
"ytimg.l.google.com"
|
||||||
MODE_HTTP=1
|
"ytimg.com"
|
||||||
MODE_HTTP_KEEPALIVE=0
|
"jnn-pa.googleapis.com"
|
||||||
MODE_HTTPS=1
|
"youtube-nocookie.com"
|
||||||
MODE_QUIC=1
|
"youtube-ui.l.google.com"
|
||||||
MODE_FILTER=none
|
"yt-video-upload.l.google.com"
|
||||||
|
"wide-youtube.l.google.com"
|
||||||
DESYNC_MARK=0x40000000
|
"youtubekids.com"
|
||||||
DESYNC_MARK_POSTNAT=0x20000000
|
"ggpht.com"
|
||||||
NFQWS_OPT_DESYNC="--dpi-desync=fake --dpi-desync-ttl=0 --dpi-desync-ttl6=0 --dpi-desync-fooling=badseq"
|
"discord.com"
|
||||||
NFQWS_OPT_DESYNC_HTTP="--dpi-desync=fake --dpi-desync-ttl=5"
|
"gateway.discord.gg"
|
||||||
NFQWS_OPT_DESYNC_HTTPS="--dpi-desync=fake --dpi-desync-ttl=5"
|
"cdn.discordapp.com"
|
||||||
NFQWS_OPT_DESYNC_QUIC="--dpi-desync=fake,tamper --dpi-desync-repeats=6 --dpi-desync-any-protocol"
|
"discordapp.net"
|
||||||
|
"discordapp.com"
|
||||||
TPWS_OPT="--hostspell=HOST --split-http-req=method --split-pos=3 --hostcase --oob"
|
"discord.gg"
|
||||||
|
"media.discordapp.net"
|
||||||
FLOWOFFLOAD=donttouch
|
"images-ext-1.discordapp.net"
|
||||||
|
"discord.app"
|
||||||
INIT_APPLY_FW=1
|
"discord.media"
|
||||||
|
"discordcdn.com"
|
||||||
DISABLE_IPV6=1
|
"discord.dev"
|
||||||
'';
|
"discord.new"
|
||||||
};
|
"discord.gift"
|
||||||
|
"discordstatus.com"
|
||||||
|
"dis.gd"
|
||||||
|
"discord.co"
|
||||||
|
"discord-attachments-uploads-prd.storage.googleapis.com"
|
||||||
|
"7tv.app"
|
||||||
|
"7tv.io"
|
||||||
|
"10tv.app"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,127 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.services.zapret;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.services.zapret = {
|
|
||||||
enable = mkEnableOption "DPI bypass multi platform service";
|
|
||||||
|
|
||||||
package = mkPackageOption pkgs "zapret" { };
|
|
||||||
|
|
||||||
settings = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = "";
|
|
||||||
|
|
||||||
example = ''
|
|
||||||
TPWS_OPT="--hostspell=HOST --split-http-req=method --split-pos=3 --oob"
|
|
||||||
NFQWS_OPT_DESYNC="--dpi-desync-ttl=5"
|
|
||||||
'';
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Rules for zapret to work. Run ```nix-shell -p zapret --command blockcheck``` to get values to pass here.
|
|
||||||
Config example can be found here https://github.com/bol-van/zapret/blob/master/config.default
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
firewallType = mkOption {
|
|
||||||
type = types.enum [
|
|
||||||
"iptables"
|
|
||||||
"nftables"
|
|
||||||
];
|
|
||||||
default = "iptables";
|
|
||||||
description = ''
|
|
||||||
Which firewall zapret should use
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
disableIpv6 = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
# recommended by upstream
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Disable or enable usage of IpV6 by zapret
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
mode = mkOption {
|
|
||||||
type = types.enum [
|
|
||||||
"tpws"
|
|
||||||
"tpws-socks"
|
|
||||||
"nfqws"
|
|
||||||
"filter"
|
|
||||||
"custom"
|
|
||||||
];
|
|
||||||
default = "tpws";
|
|
||||||
description = ''
|
|
||||||
Which mode zapret should use
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
users.users.tpws = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "tpws";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.tpws = { };
|
|
||||||
|
|
||||||
systemd.services.zapret = {
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wants = [ "network-online.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
path = with pkgs; [
|
|
||||||
(if cfg.firewallType == "iptables" then iptables else nftables)
|
|
||||||
gawk
|
|
||||||
ipset
|
|
||||||
];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "forking";
|
|
||||||
Restart = "no";
|
|
||||||
TimeoutSec = "30sec";
|
|
||||||
IgnoreSIGPIPE = "no";
|
|
||||||
KillMode = "none";
|
|
||||||
GuessMainPID = "no";
|
|
||||||
RemainAfterExit = "no";
|
|
||||||
ExecStart = "${cfg.package}/bin/zapret start";
|
|
||||||
ExecStop = "${cfg.package}/bin/zapret stop";
|
|
||||||
|
|
||||||
EnvironmentFile = pkgs.writeText "${cfg.package.pname}-environment" (concatStrings [
|
|
||||||
''
|
|
||||||
MODE=${cfg.mode}
|
|
||||||
FWTYPE=${cfg.firewallType}
|
|
||||||
DISABLE_IPV6=${if cfg.disableIpv6 then "1" else "0"}
|
|
||||||
''
|
|
||||||
cfg.settings
|
|
||||||
]);
|
|
||||||
|
|
||||||
# hardening
|
|
||||||
DevicePolicy = "closed";
|
|
||||||
KeyringMode = "private";
|
|
||||||
PrivateTmp = true;
|
|
||||||
PrivateMounts = true;
|
|
||||||
ProtectHome = true;
|
|
||||||
ProtectHostname = true;
|
|
||||||
ProtectKernelModules = true;
|
|
||||||
ProtectKernelTunables = true;
|
|
||||||
ProtectSystem = "strict";
|
|
||||||
ProtectProc = "invisible";
|
|
||||||
RemoveIPC = true;
|
|
||||||
RestrictNamespaces = true;
|
|
||||||
RestrictRealtime = true;
|
|
||||||
RestrictSUIDSGID = true;
|
|
||||||
SystemCallArchitectures = "native";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
services = {
|
|
||||||
zapret = {
|
|
||||||
enable = true;
|
|
||||||
params = [
|
|
||||||
"--dpi-desync-autottl=3"
|
|
||||||
"--wssize 1:6"
|
|
||||||
"--dpi-desync-fake-tls=0x00000000"
|
|
||||||
"--dpi-desync-split-pos=1"
|
|
||||||
"--dpi-desync=syndata,fake,split2"
|
|
||||||
"--dpi-desync-repeats=6"
|
|
||||||
"--dpi-desync-fooling=md5sig"
|
|
||||||
"--new"
|
|
||||||
];
|
|
||||||
whitelist = [
|
|
||||||
"googlevideo.com"
|
|
||||||
"youtu.be"
|
|
||||||
"youtube.com"
|
|
||||||
"youtubei.googleapis.com"
|
|
||||||
"googlevideo.com"
|
|
||||||
"youtu.be"
|
|
||||||
"youtube.com"
|
|
||||||
"youtubei.googleapis.com"
|
|
||||||
"youtubeembeddedplayer.googleapis.com"
|
|
||||||
"ytimg.l.google.com"
|
|
||||||
"ytimg.com"
|
|
||||||
"jnn-pa.googleapis.com"
|
|
||||||
"youtube-nocookie.com"
|
|
||||||
"youtube-ui.l.google.com"
|
|
||||||
"yt-video-upload.l.google.com"
|
|
||||||
"wide-youtube.l.google.com"
|
|
||||||
"youtubekids.com"
|
|
||||||
"ggpht.com"
|
|
||||||
"discord.com"
|
|
||||||
"gateway.discord.gg"
|
|
||||||
"cdn.discordapp.com"
|
|
||||||
"discordapp.net"
|
|
||||||
"discordapp.com"
|
|
||||||
"discord.gg"
|
|
||||||
"media.discordapp.net"
|
|
||||||
"images-ext-1.discordapp.net"
|
|
||||||
"discord.app"
|
|
||||||
"discord.media"
|
|
||||||
"discordcdn.com"
|
|
||||||
"discord.dev"
|
|
||||||
"discord.new"
|
|
||||||
"discord.gift"
|
|
||||||
"discordstatus.com"
|
|
||||||
"dis.gd"
|
|
||||||
"discord.co"
|
|
||||||
"discord-attachments-uploads-prd.storage.googleapis.com"
|
|
||||||
"7tv.app"
|
|
||||||
"7tv.io"
|
|
||||||
"10tv.app"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
|||||||
./modules/gaming-tweaks.nix
|
./modules/gaming-tweaks.nix
|
||||||
./modules/pipewire.nix
|
./modules/pipewire.nix
|
||||||
./modules/auto-cpufreq.nix
|
./modules/auto-cpufreq.nix
|
||||||
./modules/privoxy.nix
|
./modules/zapret.nix
|
||||||
./modules/zapret_test.nix
|
|
||||||
|
|
||||||
./modules/hardware/nvidia.nix
|
./modules/hardware/nvidia.nix
|
||||||
./modules/hardware/battery-threshold.nix
|
./modules/hardware/battery-threshold.nix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user