Block ads via dnscrypt-proxy

This commit is contained in:
coolneng 2023-12-12 14:56:24 +01:00
parent add2bee896
commit 1723a4a872
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 6 additions and 8 deletions

View File

@ -108,7 +108,7 @@ in {
local-ttl = 300; local-ttl = 300;
conf-file = "${pkgs.dnsmasq}/share/dnsmasq/trust-anchors.conf"; conf-file = "${pkgs.dnsmasq}/share/dnsmasq/trust-anchors.conf";
dnssec = true; dnssec = false;
address = "/coolneng.duckdns.org/192.168.13.2"; address = "/coolneng.duckdns.org/192.168.13.2";
}; };
@ -129,6 +129,8 @@ in {
minisign_key = minisign_key =
"RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
}; };
blocked_names.blocked_names_file =
"/var/lib/dnscrypt-proxy/blocklist.txt";
}; };
}; };

View File

@ -1,8 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
stateDir = "/var/lib/dnsmasq"; stateDir = "/var/lib/dnscrypt-proxy";
blocklist = "${stateDir}/dnsmasq.blacklist.txt"; blocklist = "${stateDir}/blocklist.txt";
in { in {
# PostgreSQL daily backups # PostgreSQL daily backups
@ -20,13 +20,9 @@ in {
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = with pkgs; [ curl coreutils ]; path = with pkgs; [ curl coreutils ];
script = '' script = ''
curl -L https://github.com/notracking/hosts-blocklists/raw/master/dnsmasq/dnsmasq.blacklist.txt -o ${blocklist} curl -L https://download.dnscrypt.info/blacklists/domains/mybase.txt -o ${blocklist}
sed "/cainiao/d" -i ${blocklist}
''; '';
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
postStop = ''
chown -R dnsmasq ${stateDir}
'';
startAt = "02:00:00"; startAt = "02:00:00";
}; };