From 16a63b37d37e438de4f7b16a2cef1c98e52b93cf Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Mon, 18 Dec 2023 23:16:07 +0100 Subject: [PATCH] feat(web01): Add a hub for redirections --- machines/web01/_configuration.nix | 1 + machines/web01/redirections.nix | 26 ++++++++++++++++++++++++++ npins/sources.json | 11 +++++++++++ 3 files changed, 38 insertions(+) create mode 100644 machines/web01/redirections.nix diff --git a/machines/web01/_configuration.nix b/machines/web01/_configuration.nix index f28fc68..82840a6 100644 --- a/machines/web01/_configuration.nix +++ b/machines/web01/_configuration.nix @@ -15,6 +15,7 @@ lib.extra.mkConfig { "matterbridge" "ntfy-sh" "plausible" + "redirections" "wordpress" ]; diff --git a/machines/web01/redirections.nix b/machines/web01/redirections.nix new file mode 100644 index 0000000..2083225 --- /dev/null +++ b/machines/web01/redirections.nix @@ -0,0 +1,26 @@ +{ sources, ... }: + +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"; + } // (builtins.listToAttrs (builtins.map (name: { + inherit name; + value = retired_host; + }) retired)); + + retired = [ "auth.rz.ens.wtf" "photos.ens.wtf" ]; + +in { + services.nginx.virtualHosts = { + retired_host = { + enableACME = true; + forceSSL = true; + + root = "${sources.dgnum-retired.outPath}/www"; + }; + } // (builtins.mapAttrs (host: to: { globalRedirect = to; }) redirections); +} diff --git a/npins/sources.json b/npins/sources.json index dd80201..b100d20 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -26,6 +26,17 @@ "url": "https://github.com/zhaofengli/attic/archive/e9918bc6be268da6fa97af6ced15193d8a0421c0.tar.gz", "hash": "13h7gqai2lbsp0qqp1spv76fjjsha2lygpvzxk7vzl09h9hnhy5a" }, + "dgnum-retired": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://git.dgnum.eu/DGNum/dgnum-retired" + }, + "branch": "main", + "revision": "d481b8cf7a7816c851e36ce0a0ed4a776d00eb9c", + "url": null, + "hash": "1hpjra1gz9vx9j7dpvc7h8czhrlizpgwnfc7z4al4xw146dv0bp0" + }, "disko": { "type": "GitRelease", "repository": {