Block ads via dnscrypt-proxy
This commit is contained in:
parent
add2bee896
commit
1723a4a872
|
@ -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";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue