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 let
metis = import sources.metis { inherit pkgs; }; metis = import sources.metis { inherit pkgs; };
package = metis.production;
inherit (metis) providers; inherit (metis) providers;
in { in {
services.nginx.virtualHosts."calendrier.dgnum.eu" = { services.nginx.virtualHosts."calendrier.dgnum.eu" = {
serverAliases = [
"calendrier.eleves.ens.fr"
];
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
root = package; root = metis.production;
locations = lib.mapAttrs' (name: value: locations = lib.mapAttrs' (name: value:
lib.nameValuePair "/cal/${name}/" { lib.nameValuePair "/cal/${name}/" {

View file

@ -4,12 +4,16 @@ let
retired_host = "retired.dgnum.eu"; retired_host = "retired.dgnum.eu";
redirections = { redirections = {
"nuage.beta.rz.ens.wtf" = "cloud.dgnum.eu"; "nuage.beta.rz.ens.wtf".to = "cloud.dgnum.eu";
"notion.rz.ens.wtf" = "docs.dgnum.eu"; "notion.rz.ens.wtf".to = "docs.dgnum.eu";
"docs.beta.rz.ens.wtf" = "pads.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: { } // (builtins.listToAttrs (builtins.map (name: {
inherit name; inherit name;
value = retired_host; value.to = retired_host;
}) retired)); }) retired));
retired = [ "auth.rz.ens.wtf" "photos.ens.wtf" ]; retired = [ "auth.rz.ens.wtf" "photos.ens.wtf" ];
@ -22,5 +26,10 @@ in {
root = "${sources.dgnum-retired.outPath}/www"; 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);
} }