1 { pkgs, lib, config, ... }:
4 inherit (config.services) openvpn;
5 apiUrl = "https://api.black.riseup.net/3/cert";
7 url = "https://black.riseup.net/ca.crt";
8 hash = "sha256-Zdvnfz2k7iWlbgmmcUJrpJZ1dp7o0qXeJhP0HWJD7ro=";
10 key-cert = "/run/openvpn-${netns}/key+cert.pem";
13 services.openvpn.servers.${netns} = {
18 ["212.83.182.127" "212.83.165.160" "212.129.4.141"] ++
20 #["212.83.146.228" "212.83.143.67" "163.172.126.44"] ++
22 ["37.218.244.249" "37.218.244.251"] ++
24 ["199.58.83.10" "199.58.83.10" "199.58.83.12"] ++
28 ["198.252.153.28" "198.252.153.28"] ++
38 cipher = "AES-128-CBC";
46 remote-cert-tls = "server";
49 tls-cipher = "DHE-RSA-AES128-SHA";
56 systemd.services."openvpn-${netns}" = {
59 ${pkgs.curl}/bin/curl -X POST --cacert ${ca} -o ${key-cert} -Ls ${apiUrl}
63 RuntimeDirectory = [ "openvpn-${netns}" ];
64 RuntimeDirectoryMode = "0700";
67 networking.nftables.ruleset = ''
68 add rule inet filter fw2net meta skuid root tcp dport 443 counter accept comment "OpenVPN Riseup"
70 services.netns.namespaces.${netns} = {
71 nftables = lib.mkBefore ''
73 include "${../../../../networking/nftables/filter.txt}"
75 type filter hook input priority filter
79 ct state { established, related } accept
80 jump accept-connectivity-input
85 type filter hook forward priority filter
87 jump accept-connectivity-forward
90 type filter hook output priority filter
93 ct state { related, established } accept
94 jump accept-connectivity-output