feat(web01): Improve redirections and make calendrier.eleves.ens.fr -> calendrier.dgnum.eu

This commit is contained in:
Tom Hubrecht 2023-12-19 18:38:57 +01:00
parent 4617bf03ba
commit 3388771929
2 changed files with 17 additions and 14 deletions

View file

@ -2,19 +2,13 @@
let
metis = import sources.metis { inherit pkgs; };
package = metis.production;
inherit (metis) providers;
in {
services.nginx.virtualHosts."calendrier.dgnum.eu" = {
serverAliases = [
"calendrier.eleves.ens.fr"
];
enableACME = true;
forceSSL = true;
root = package;
root = metis.production;
locations = lib.mapAttrs' (name: value:
lib.nameValuePair "/cal/${name}/" {
@ -23,7 +17,7 @@ in {
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass ${value};
'';
'';
}) providers;
extraConfig = ''

View file

@ -4,12 +4,16 @@ let
retired_host = "retired.dgnum.eu";
redirections = {
"nuage.beta.rz.ens.wtf" = "cloud.dgnum.eu";
"notion.rz.ens.wtf" = "docs.dgnum.eu";
"docs.beta.rz.ens.wtf" = "pads.dgnum.eu";
"nuage.beta.rz.ens.wtf".to = "cloud.dgnum.eu";
"notion.rz.ens.wtf".to = "docs.dgnum.eu";
"docs.beta.rz.ens.wtf".to = "pads.dgnum.eu";
"calendrier.eleves.ens.fr" = {
to = "calendrier.dgnum.eu";
ssl = true;
};
} // (builtins.listToAttrs (builtins.map (name: {
inherit name;
value = retired_host;
value.to = retired_host;
}) retired));
retired = [ "auth.rz.ens.wtf" "photos.ens.wtf" ];
@ -22,5 +26,10 @@ in {
root = "${sources.dgnum-retired.outPath}/www";
};
} // (builtins.mapAttrs (host: to: { globalRedirect = to; }) redirections);
} // (builtins.mapAttrs (host:
{ to, ssl ? false }: {
globalRedirect = to;
enableACME = ssl;
forceSSL = ssl;
}) redirections);
}