Block ads via dnscrypt-proxy
This commit is contained in:
parent
add2bee896
commit
1723a4a872
|
@ -108,7 +108,7 @@ in {
|
|||
local-ttl = 300;
|
||||
|
||||
conf-file = "${pkgs.dnsmasq}/share/dnsmasq/trust-anchors.conf";
|
||||
dnssec = true;
|
||||
dnssec = false;
|
||||
|
||||
address = "/coolneng.duckdns.org/192.168.13.2";
|
||||
};
|
||||
|
@ -129,6 +129,8 @@ in {
|
|||
minisign_key =
|
||||
"RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
blocked_names.blocked_names_file =
|
||||
"/var/lib/dnscrypt-proxy/blocklist.txt";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
stateDir = "/var/lib/dnsmasq";
|
||||
blocklist = "${stateDir}/dnsmasq.blacklist.txt";
|
||||
stateDir = "/var/lib/dnscrypt-proxy";
|
||||
blocklist = "${stateDir}/blocklist.txt";
|
||||
|
||||
in {
|
||||
# PostgreSQL daily backups
|
||||
|
@ -20,13 +20,9 @@ in {
|
|||
wantedBy = [ "default.target" ];
|
||||
path = with pkgs; [ curl coreutils ];
|
||||
script = ''
|
||||
curl -L https://github.com/notracking/hosts-blocklists/raw/master/dnsmasq/dnsmasq.blacklist.txt -o ${blocklist}
|
||||
sed "/cainiao/d" -i ${blocklist}
|
||||
curl -L https://download.dnscrypt.info/blacklists/domains/mybase.txt -o ${blocklist}
|
||||
'';
|
||||
serviceConfig.Type = "oneshot";
|
||||
postStop = ''
|
||||
chown -R dnsmasq ${stateDir}
|
||||
'';
|
||||
startAt = "02:00:00";
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue