summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/vpn/vpnws/server.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-08-01 12:14:30 +0200
committertv <tv@krebsco.de>2023-08-01 12:14:30 +0200
commit7be9bfdc55d672de39dce98dae9c6d112404dfc6 (patch)
treee89a93ad96e6f35490ffbf6b6a337ca4dcc9a170 /makefu/2configs/vpn/vpnws/server.nix
parent5d1b0675cf179f863a5b34b67661a953197b6057 (diff)
parent6e63efa3645353bc0549f5f152ef811fff5d644c (diff)
Merge remote-tracking branch 'orange/master'
Diffstat (limited to 'makefu/2configs/vpn/vpnws/server.nix')
-rw-r--r--makefu/2configs/vpn/vpnws/server.nix42
1 files changed, 0 insertions, 42 deletions
diff --git a/makefu/2configs/vpn/vpnws/server.nix b/makefu/2configs/vpn/vpnws/server.nix
deleted file mode 100644
index 6baa5ff11..000000000
--- a/makefu/2configs/vpn/vpnws/server.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{pkgs, options, ... }:
-let
- pkg = pkgs.vpn-ws;
- uid = "nginx";
- gid = "nginx";
- ip = "${pkgs.iproute}/bin/ip";
- socket = "/run/vpn.sock";
- htpasswd = (toString <secrets>) + "/vpn-ws-auth";
- nginx-prepared-secrets = "/var/spool/nginx/vpn-ws-auth";
-in {
- systemd.services.vpn-ws-auth-prepare = {
- wantedBy = [ "multi-user.target" ];
- before = [ "nginx.service" ];
- script = "install -m700 -o${uid} -g${gid} ${htpasswd} ${nginx-prepared-secrets}";
- };
- services.nginx.virtualHosts."euer.krebsco.de".locations."/vpn" = {
- extraConfig = ''
- auth_basic "please stand by...";
- auth_basic_user_file ${nginx-prepared-secrets};
- uwsgi_pass unix:${socket};
- include ${pkgs.nginx}/conf/uwsgi_params;
- '';
- };
-
- networking.interfaces.vpnws = {
- virtual = true;
- virtualType = "tap";
- };
- systemd.services.vpnws = {
- wantedBy = [ "multi-user.target" ];
- after = [ "network.target" ];
- serviceConfig = {
- Restart = "always";
- PrivateTmp = true;
- ExecStartPre = pkgs.writeDash "vpnws-pre" ''
- ${ip} link set vpnws up
- ${ip} addr add 10.244.1.1/24 dev vpnws || :
- '';
- ExecStart = "${pkg}/bin/vpn-ws --uid ${uid} --gid ${gid} --tuntap vpnws ${socket}";
- };
- };
-}