diff --git a/machines/raven/configuration.nix b/machines/raven/configuration.nix index 4e00871..49e8864 100644 --- a/machines/raven/configuration.nix +++ b/machines/raven/configuration.nix @@ -63,5 +63,14 @@ virtualisation.docker.enable = true; + services.nginx.enable = true; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + # FIXME + networking.hosts = { + "192.168.94.1" = [ "raven.lab.fablab-nea.de" "labsync.lab.fablab-nea.de" ]; + }; + system.stateVersion = "21.05"; } diff --git a/machines/raven/services/default.nix b/machines/raven/services/default.nix index c118dfb..fbe2f0c 100644 --- a/machines/raven/services/default.nix +++ b/machines/raven/services/default.nix @@ -1,5 +1,6 @@ { imports = [ ./dnsmasq.nix + ./labsync.nix ]; } diff --git a/machines/raven/services/labsync.nix b/machines/raven/services/labsync.nix new file mode 100644 index 0000000..a0e1ef8 --- /dev/null +++ b/machines/raven/services/labsync.nix @@ -0,0 +1,31 @@ +# legacy labsync, currently partly implemented in docker outside of this configuration +{ + services.opentracker.enable = true; + + services.nginx.virtualHosts."labsync.lab.fablab-nea.de" = { + locations = { + "/" = { + root = "/opt/docker/tftpgen/data"; + extraConfig = '' + autoindex on; + ''; + }; + "/generator/".proxyPass = "http://127.0.0.1:8695/"; + }; + }; + + services.atftpd = { + enable = true; + root = "/opt/docker/tftpgen/tftp"; + }; + + networking.firewall.allowedTCPPorts = [ + 6881 # aria2 + 6969 # opentracker + ]; + networking.firewall.allowedUDPPorts = [ + 6882 # aria2 + 69 # tftpd + 6969 # opentracker + ]; +}