2023-11-10 03:10:06 +00:00
|
|
|
{ config, ... }:
|
2021-11-15 10:02:05 +00:00
|
|
|
let
|
2023-11-16 00:00:11 +00:00
|
|
|
domain = config.selfprivacy.domain;
|
2021-11-15 10:02:05 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
users.groups.ocserv = {
|
|
|
|
members = [ "ocserv" ];
|
|
|
|
};
|
|
|
|
users.users.ocserv = {
|
|
|
|
isNormalUser = false;
|
|
|
|
isSystemUser = true;
|
2023-11-29 04:25:24 +00:00
|
|
|
extraGroups = [ "ocserv" "acmereceivers" ];
|
2022-04-20 10:22:16 +00:00
|
|
|
group = "ocserv";
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
services.ocserv = {
|
2023-11-16 00:00:11 +00:00
|
|
|
enable = config.selfprivacy.ocserv.enable;
|
2021-11-15 10:02:05 +00:00
|
|
|
config = ''
|
|
|
|
socket-file = /var/run/ocserv-socket
|
|
|
|
|
|
|
|
auth = "pam"
|
|
|
|
|
|
|
|
tcp-port = 8443
|
|
|
|
udp-port = 8443
|
|
|
|
|
|
|
|
server-cert = /var/lib/acme/${domain}/fullchain.pem
|
|
|
|
server-key = /var/lib/acme/${domain}/key.pem
|
|
|
|
|
|
|
|
compression = true
|
|
|
|
|
|
|
|
max-clients = 0
|
|
|
|
max-same-clients = 6
|
|
|
|
|
|
|
|
try-mtu-discovery = true
|
|
|
|
|
|
|
|
idle-timeout=1200
|
|
|
|
mobile-idle-timeout=2400
|
|
|
|
|
|
|
|
default-domain = vpn.${domain}
|
|
|
|
|
|
|
|
device = vpn0
|
|
|
|
|
|
|
|
ipv4-network = 10.10.10.0
|
|
|
|
ipv4-netmask = 255.255.255.0
|
|
|
|
|
|
|
|
tunnel-all-dns = true
|
|
|
|
dns = 1.1.1.1
|
|
|
|
dns = 1.0.0.1
|
|
|
|
|
|
|
|
route = default
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|