diff options
author | stuebinm | 2021-08-23 15:18:17 +0200 |
---|---|---|
committer | stuebinm | 2021-08-23 15:20:01 +0200 |
commit | 4ad2010194037ad25c54631995e89b9d9ee878b3 (patch) | |
tree | 80e5a9765a4af3a2f76b210349d1012314f4f05d /default.nix | |
parent | 8db4bbc5eccaac218c68fb0853f1972dadd7a40c (diff) |
init exneuland as alternative backendexneuland
It appears to work (somewhat). Limitations:
- exneuland is not configurable; can only have it once
- frontend untested since last update broke things
Diffstat (limited to '')
-rw-r--r-- | default.nix | 28 |
1 files changed, 23 insertions, 5 deletions
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; }; |