From 4ad2010194037ad25c54631995e89b9d9ee878b3 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 23 Aug 2021 15:18:17 +0200 Subject: init exneuland as alternative backend It appears to work (somewhat). Limitations: - exneuland is not configurable; can only have it once - frontend untested since last update broke things --- default.nix | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 8e631bd..9002aec 100644 --- a/default.nix +++ b/default.nix @@ -27,7 +27,23 @@ let SOCKET_IDLE_TIME = toString commonConfig.socketIdleTime; }; - servicesBack = mapAttrs' (instanceName: instanceConfig: { + servicesBack = mapAttrs' (instanceName: instanceConfig: + if instanceConfig.exneuland.enable then { + name = "wa-exneuland-${instanceName}"; + value = { + description = "Exneuland backend for ${instanceName}"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + ExecStart = + "${instanceConfig.exneuland.package}/bin/exneuland start"; + Restart = "always"; + DynamicUser = true; + User = "exneuland-backend"; + Group = "exneuland-backend"; + }; + }; + } else { name = "wa-back-${instanceName}"; value = mkIf instanceConfig.backend.enable { description = "WorkAdventure backend ${instanceName}"; @@ -66,9 +82,9 @@ let ) instances; servicesPusher = mapAttrs' (instanceName: instanceConfig: - { + { name = "wa-pusher-${instanceName}"; - value = mkIf instanceConfig.pusher.enable { + value = mkIf (instanceConfig.pusher.enable && !instanceConfig.exneuland.enable) { description = "WorkAdventure pusher ${instanceName}"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; @@ -132,8 +148,10 @@ let }; "/pusher/" = { - #proxyPass = "http://10.233.3.1:9000"; - proxyPass = "http://localhost:${toString instanceConfig.pusher.port}/"; + proxyPass = + if instanceConfig.exneuland.enable + then "http://localhost:4000" + else "http://localhost:${toString instanceConfig.pusher.port}/"; proxyWebsockets = true; }; -- cgit v1.2.3