1import ./make-test-python.nix (
2 { pkgs, ... }:
3 let
4 localProxyPort = 43;
5 in
6 {
7 name = "dnscrypt-proxy2";
8 meta = with pkgs.lib.maintainers; {
9 maintainers = [ joachifm ];
10 };
11
12 nodes = {
13 # A client running the recommended setup: DNSCrypt proxy as a forwarder
14 # for a caching DNS client.
15 client =
16 { ... }:
17 {
18 security.apparmor.enable = true;
19
20 services.dnscrypt-proxy2.enable = true;
21 services.dnscrypt-proxy2.settings = {
22 listen_addresses = [ "127.0.0.1:${toString localProxyPort}" ];
23 sources.public-resolvers = {
24 urls = [ "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" ];
25 cache_file = "public-resolvers.md";
26 minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
27 refresh_delay = 72;
28 };
29 };
30
31 services.dnsmasq.enable = true;
32 services.dnsmasq.settings.server = [ "127.0.0.1#${toString localProxyPort}" ];
33 };
34 };
35
36 testScript = ''
37 client.wait_for_unit("dnsmasq")
38 client.wait_for_unit("dnscrypt-proxy2")
39 client.wait_until_succeeds("ss --numeric --udp --listening | grep -q ${toString localProxyPort}")
40 '';
41 }
42)