From c4108a62ab63f06a26d0393f89360007d90f813e Mon Sep 17 00:00:00 2001 From: sinavir Date: Sun, 5 Jan 2025 00:14:50 +0100 Subject: [PATCH] chore(web02/cas-eleves): Factorize source and use host in ALLOWED_HOSTS --- machines/nixos/web02/cas-eleves/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/machines/nixos/web02/cas-eleves/default.nix b/machines/nixos/web02/cas-eleves/default.nix index d39a440..47a771e 100644 --- a/machines/nixos/web02/cas-eleves/default.nix +++ b/machines/nixos/web02/cas-eleves/default.nix @@ -14,6 +14,9 @@ let inherit (lib) mapAttrsToList; host = "cas.eleves.ens.fr"; + + src = sources.cas-eleves; + port = 9889; python3 = @@ -49,7 +52,7 @@ let staticDrv = pkgs.stdenv.mkDerivation { name = "cas_eleves-static"; - src = sources.cas-eleves; + inherit src; nativeBuildInputs = [ pythonEnv ]; @@ -85,13 +88,12 @@ in }; StateDirectory = "django-cas-eleves"; User = "cas_server"; - WorkingDirectory = sources.cas-eleves; + WorkingDirectory = src; }; environment = { CE_ALLOWED_HOSTS = builtins.toJSON [ - "cas-eleves.dgnum.eu" - "cas.eleves.ens.fr" + host ]; CE_STATIC_ROOT = staticDrv; }; @@ -118,7 +120,7 @@ in }; StateDirectory = "django-cas-eleves"; User = "cas_server"; - WorkingDirectory = sources.cas-eleves; + WorkingDirectory = src; }; path = [ pythonEnv ];