feat(metis): Update and validate providers
All checks were successful
build configuration / build_and_cache_geo02 (push) Successful in 1m12s
build configuration / build_and_cache_storage01 (push) Successful in 1m21s
build configuration / build_and_cache_rescue01 (push) Successful in 1m21s
build configuration / build_and_cache_geo01 (push) Successful in 1m24s
build configuration / build_and_cache_compute01 (push) Successful in 1m40s
build configuration / build_and_cache_vault01 (push) Successful in 1m29s
build configuration / build_and_cache_web03 (push) Successful in 1m21s
build configuration / build_and_cache_bridge01 (push) Successful in 1m8s
build configuration / build_and_cache_web02 (push) Successful in 1m30s
lint / check (push) Successful in 23s
build configuration / build_and_cache_web01 (push) Successful in 2m34s

This commit is contained in:
Tom Hubrecht 2024-10-24 00:27:15 +02:00
parent d2f039755b
commit 0e3463102c
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 13 additions and 8 deletions

View file

@ -6,30 +6,35 @@
}: }:
let let
metis = import sources.metis { inherit pkgs; }; inherit (lib) mapAttrsToList match;
inherit (metis) providers; metis = import sources.metis { inherit pkgs; };
in in
{ {
services.nginx.virtualHosts."calendrier.dgnum.eu" = { services.nginx.virtualHosts."calendrier.dgnum.eu" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
root = metis.production; root = metis.package;
locations = lib.mapAttrs' ( locations = lib.mapAttrs' (
name: value: name: domain:
lib.nameValuePair "/cal/${name}/" { lib.nameValuePair "/cal/${name}/" {
extraConfig = '' extraConfig = ''
proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass ${value}; proxy_pass https://${domain}/remote.php/dav/public-calendars/;
''; '';
} }
) providers; ) metis.providers;
extraConfig = '' extraConfig = ''
rewrite ^/calendrier(.*)$ $1 permanent; rewrite ^/calendrier(.*)$ $1 permanent;
''; '';
}; };
assertions = mapAttrsToList (name: domain: {
assertion = (match "[a-z-]+" name == [ ]) && (match "[a-z.-]+" domain == [ ]);
message = "The provider `${name}` associated to the domain `${domain}` seems to have an incorrect definition.";
}) metis.providers;
} }

View file

@ -178,9 +178,9 @@
"url": "https://git.dgnum.eu/DGNum/metis" "url": "https://git.dgnum.eu/DGNum/metis"
}, },
"branch": "master", "branch": "master",
"revision": "5c5e0c356bc60c15699a0830ef675af821afbb5b", "revision": "ed6fafda45d638b1bafd5deaee098b80156b41e8",
"url": null, "url": null,
"hash": "0lijsmgcqqqrdi2qdycwsaczcjja5blvx4kx1ssclvsm8aipbbs0" "hash": "086spyhn2x1x2h31b0y4an501fdhph1nk64riybqnh6mqjkzlq4m"
}, },
"microvm.nix": { "microvm.nix": {
"type": "Git", "type": "Git",