From 00384a594862b154d405b8bc17a464b720e085af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= Date: Tue, 24 Sep 2024 14:23:29 +0200 Subject: [PATCH] domainForBucket --- fediversity/default.nix | 6 +++++- fediversity/garage.nix | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fediversity/default.nix b/fediversity/default.nix index 96a3d5b0..6a6b8676 100644 --- a/fediversity/default.nix +++ b/fediversity/default.nix @@ -68,9 +68,13 @@ in { type = types.int; default = 3902; }; + domainForBucket = mkOption { + type = types.functionTo types.str; + default = bucket: "${bucket}.${config.fediversity.internal.garage.web.rootDomain}"; + }; urlForBucket = mkOption { type = types.functionTo types.str; - default = bucket: "http://${bucket}.${config.fediversity.internal.garage.web.rootDomain}"; + default = bucket: "http://${config.fediversity.internal.garage.web.domainForBucket bucket}"; }; }; }; diff --git a/fediversity/garage.nix b/fediversity/garage.nix index a6270099..a3cbbebd 100644 --- a/fediversity/garage.nix +++ b/fediversity/garage.nix @@ -177,7 +177,7 @@ in forceSSL = true; enableACME = true; serverName = fedicfg.web.rootDomain; - serverAliases = lib.mapAttrsToList (bucket: _: "${bucket}.${fedicfg.web.rootDomain}") cfg.ensureBuckets; ## TODO: use wildcard certificates? + serverAliases = lib.mapAttrsToList (bucket: _: fedicfg.web.domainForBucket bucket) cfg.ensureBuckets; ## TODO: use wildcard certificates? locations."/" = { proxyPass = "http://localhost:3902"; extraConfig = ''