feat(garage): Add ambassadeurices sante website

This commit is contained in:
sinavir 2024-03-15 21:55:42 +01:00
parent 84e439a89f
commit a7664ce44b

View file

@ -1,4 +1,9 @@
{ config, pkgs, ... }: {
config,
pkgs,
lib,
...
}:
let let
host = "s3.dgnum.eu"; host = "s3.dgnum.eu";
@ -7,10 +12,13 @@ let
data_dir = "/data/slow/garage/data"; data_dir = "/data/slow/garage/data";
metadata_dir = "/data/fast/garage/meta"; metadata_dir = "/data/fast/garage/meta";
buckets = [ buckets = {
"castopod-dgnum" "castopod-dgnum" = { };
"peertube-videos-dgnum" "peertube-videos-dgnum" = { };
]; "boussole-sante.normalesup.eu" = {
mainDomain = true;
};
};
in in
{ {
services.garage = { services.garage = {
@ -68,7 +76,7 @@ in
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
serverAliases = builtins.map (b: "${b}.${host}") buckets; serverAliases = builtins.map (b: "${b}.${host}") (builtins.attrNames buckets);
locations."/".extraConfig = '' locations."/".extraConfig = ''
proxy_pass http://127.0.0.1:3900; proxy_pass http://127.0.0.1:3900;
@ -84,7 +92,11 @@ in
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
serverAliases = builtins.map (b: "${b}.${webHost}") buckets; serverAliases = lib.flatten (
lib.mapAttrsToList (
b: v: lib.singleton "${b}.${webHost}" ++ lib.optional (v ? mainDomain && v.mainDomain) b
) buckets
);
locations."/".extraConfig = '' locations."/".extraConfig = ''
proxy_pass http://127.0.0.1:3902; proxy_pass http://127.0.0.1:3902;