From 468e8d3f97325aef7df196482d36a14027dc30cc Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 13 Nov 2021 13:08:37 +0100 Subject: [PATCH 1/2] WIP: raven/labsync: init --- machines/raven/configuration.nix | 9 +++++++++ machines/raven/services/default.nix | 1 + machines/raven/services/labsync.nix | 31 +++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 machines/raven/services/labsync.nix 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 + ]; +} From 078cc3abd233b168a0af960721b2f26e7e1881c4 Mon Sep 17 00:00:00 2001 From: jalr Date: Sat, 4 Dec 2021 15:08:51 +0000 Subject: [PATCH 2/2] Add howto deploy raven --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 318b3f3..74c884e 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ # NixOS configurations of the FabLab Bad Windsheim + +## Quick start + +How to deploy to raven +``` +nix run .#deploy/raven +```