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
host = "s3.dgnum.eu";
@ -7,10 +12,13 @@ let
data_dir = "/data/slow/garage/data";
metadata_dir = "/data/fast/garage/meta";
buckets = [
"castopod-dgnum"
"peertube-videos-dgnum"
];
buckets = {
"castopod-dgnum" = { };
"peertube-videos-dgnum" = { };
"boussole-sante.normalesup.eu" = {
mainDomain = true;
};
};
in
{
services.garage = {
@ -68,7 +76,7 @@ in
enableACME = true;
forceSSL = true;
serverAliases = builtins.map (b: "${b}.${host}") buckets;
serverAliases = builtins.map (b: "${b}.${host}") (builtins.attrNames buckets);
locations."/".extraConfig = ''
proxy_pass http://127.0.0.1:3900;
@ -84,7 +92,11 @@ in
enableACME = 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 = ''
proxy_pass http://127.0.0.1:3902;