chore(web02/cas-eleves): Factorize source and use host in ALLOWED_HOSTS

This commit is contained in:
sinavir 2025-01-05 00:14:50 +01:00
parent 5cd85d38b1
commit c4108a62ab
No known key found for this signature in database

View file

@ -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 ];