2023-09-25 00:40:47 +02:00
|
|
|
{ lib, pkgs, sources, ... }:
|
|
|
|
|
|
|
|
let
|
2023-10-02 23:13:04 +02:00
|
|
|
package = (import sources.metis { inherit pkgs; }).production;
|
2023-09-25 00:40:47 +02:00
|
|
|
|
|
|
|
providers = {
|
|
|
|
klub-reseau = "nuage.beta.rz.ens.wtf";
|
|
|
|
eleves-ens = "cloud.eleves.ens.fr";
|
|
|
|
frama-agenda = "framagenda.org";
|
|
|
|
};
|
2023-09-28 12:14:38 +02:00
|
|
|
|
2023-10-02 21:32:54 +02:00
|
|
|
|
|
|
|
in {
|
|
|
|
services.nginx.virtualHosts."calendrier.dgnum.eu" = {
|
|
|
|
serverAliases = [
|
|
|
|
"calendrier.eleves.ens.fr"
|
|
|
|
];
|
2023-09-25 00:40:47 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
root = package;
|
|
|
|
|
|
|
|
locations = lib.mapAttrs' (name: attrs:
|
|
|
|
lib.nameValuePair "/cal/${name}/" {
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
proxy_set_header X-Forwarded-Server $host;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_pass https://${
|
|
|
|
providers.${name}
|
|
|
|
}/remote.php/dav/public-calendars/;
|
|
|
|
'';
|
|
|
|
}) providers;
|
2023-10-01 22:50:15 +02:00
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
rewrite ^/calendrier(.*)$ $1 permanent;
|
|
|
|
'';
|
2023-09-25 00:40:47 +02:00
|
|
|
};
|
|
|
|
}
|