From 285868654e536dfe9eb3db9229bd65e6fffdcd8a Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 23 May 2021 13:37:02 +0200 Subject: [PATCH] update workadventure setup --- .../plops/configs/nixserver-host/codimd.nix | 2 +- .../configs/nixserver-host/configuration.nix | 22 +++++++++++++++---- .../plops/configs/nixserver-host/jitsi.nix | 3 ++- .../plops/configs/nixserver-host/netdata.nix | 3 ++- .../plops/configs/nixserver-host/options.nix | 16 ++++++++++++++ .../configs/nixserver-host/workadventure.nix | 13 ++++++----- 6 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/options.nix diff --git a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/codimd.nix b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/codimd.nix index fbcc958..92cf135 100644 --- a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/codimd.nix +++ b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/codimd.nix @@ -4,7 +4,7 @@ services.nginx.virtualHosts.codimd = { enableACME = true; addSSL = true; - serverName = "codimd.ingolf-wagner.de"; + serverName = "codimd.${config.workadventure.domain}"; locations."/".extraConfig = '' client_max_body_size 4G; proxy_set_header Host $host; diff --git a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/configuration.nix b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/configuration.nix index 108b41a..b954e1e 100644 --- a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/configuration.nix +++ b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/configuration.nix @@ -1,20 +1,34 @@ { config, pkgs, lib, ... }: { imports = [ - # + ./options.nix + # codimd.${hostName} ./codimd.nix ./hardware-configuration.nix + # meet.${hostName} ./jitsi.nix - ./netdata.nix + # netdata.${hostName} + #./netdata.nix ./ssh.nix + # party.${hostName} + # api.party.${hostName} + # push.party.${hostName} + # play.party.${hostName} + # upload.party.${hostName} ./workadventure.nix ]; environment.systemPackages = [ pkgs.git pkgs.docker-compose pkgs.ag pkgs.htop ]; - networking.hostName = "host"; + # party.${hostName} + # api.party.${hostName} + # push.party.${hostName} + # play.party.${hostName} + # upload.party.${hostName} - security.acme.email = "contact@ingolf-wagner.de"; + networking.hostName = "host"; + workadventure.domain = "nerilex.org"; + security.acme.email = "bg+party@nerilex.org"; security.acme.acceptTerms = true; } diff --git a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/jitsi.nix b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/jitsi.nix index aaffea5..58a1249 100644 --- a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/jitsi.nix +++ b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/jitsi.nix @@ -1,3 +1,4 @@ +{config, ...}: { # + + # | | @@ -25,7 +26,7 @@ # This is a one server setup services.jitsi-meet = { enable = true; - hostName = "meet.ingolf-wagner.de"; + hostName = "meet.${config.workadventure.domain}"; # JItsi COnference FOcus is a server side focus component used in Jitsi Meet conferences. # https://github.com/jitsi/jicofo diff --git a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/netdata.nix b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/netdata.nix index 7bfdfc6..d4ee75b 100644 --- a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/netdata.nix +++ b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/netdata.nix @@ -1,3 +1,4 @@ +{config, ... }: { services.netdata = { enable = true; @@ -14,7 +15,7 @@ }; services.nginx.enable = true; - services.nginx.virtualHosts."netdata.party.ingolf-wagner.de" = { + services.nginx.virtualHosts."netdata.${config.workadventure.domain}" = { enableACME = true; forceSSL = true; basicAuth.admin = "NYsXfBKRwkkS60WIeZONtFTv3nz4tPy52uqLkzJzuc"; diff --git a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/options.nix b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/options.nix new file mode 100644 index 0000000..508ba82 --- /dev/null +++ b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/options.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: +with lib; +let + cfg = config.workadventure; +in { + + options.workadventure = { + domain = mkOption { + type = with types; str; + description = '' + domain of the server + ''; + }; + }; + +} diff --git a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/workadventure.nix b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/workadventure.nix index 2126eac..55a57a5 100644 --- a/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/workadventure.nix +++ b/terranix/workadventure-jitsi-setup/plops/configs/nixserver-host/workadventure.nix @@ -11,9 +11,9 @@ let workadventureSecretKey = "YXNkZnNkZmxranNhZGxma2phc2RsZmtqYXNsa2Zkago="; - jitsiURL = "meet.ingolf-wagner.de"; + jitsiURL = "meet.${config.workadventure.domain}"; - domain = "party.ingolf-wagner.de"; + domain = "party.${config.workadventure.domain}"; # domain will redirect to this map. (not play.${domain}) defaultMap = "mrvandalo.github.io/workadventure-worlds/main.json"; @@ -29,10 +29,11 @@ let uploaderURL = "upload.${domain}"; uploaderPort = 9006; - frontImage = "thecodingmachine/workadventure-front:develop"; - pusherImage = "thecodingmachine/workadventure-pusher:develop"; - apiImage = "thecodingmachine/workadventure-back:develop"; - uploaderImage = "thecodingmachine/workadventure-uploader:develop"; + version = "v1.1.0"; + frontImage = "thecodingmachine/workadventure-front:${version}"; + pusherImage = "thecodingmachine/workadventure-pusher:${version}"; + apiImage = "thecodingmachine/workadventure-back:${version}"; + uploaderImage = "thecodingmachine/workadventure-uploader:${version}"; in {