commit 60a7b666ecc6fba4a4d5fc265e980bf23c7e46ee parent fba537caffb15cdd8e68e52c1655e52e3e31f215 Author: mtmn <miro@haravara.org> Date: Mon, 13 Apr 2026 09:36:06 +0200 feat: allow multiple s3 gateway domains Diffstat:
| M | hosts/nixaran/configuration.nix | | | 0 | |
| M | modules/services/seaweedfs.nix | | | 20 | +++++++++++--------- |
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/hosts/nixaran/configuration.nix b/hosts/nixaran/configuration.nix Binary files differ. diff --git a/modules/services/seaweedfs.nix b/modules/services/seaweedfs.nix @@ -8,9 +8,9 @@ in { options.services.haravara.seaweedfs = { enable = lib.mkEnableOption "SeaweedFS"; - estriDomain = lib.mkOption { - type = lib.types.str; - description = "Domain for the S3 gateway"; + domains = lib.mkOption { + type = lib.types.listOf lib.types.str; + description = "Domains for the S3 gateway"; }; dataDir = lib.mkOption { type = lib.types.str; @@ -101,11 +101,13 @@ in { }; }; - services.caddy.virtualHosts = { - "${cfg.estriDomain}".extraConfig = '' - reverse_proxy 127.0.0.1:8333 - redir / https://${lib.concatStringsSep "." (lib.drop 1 (lib.splitString "." cfg.estriDomain))} - ''; - }; + services.caddy.virtualHosts = lib.listToAttrs (map (domain: { + name = domain; + value.extraConfig = '' + reverse_proxy 127.0.0.1:8333 + redir / https://${lib.concatStringsSep "." (lib.drop 1 (lib.splitString "." domain))} + ''; + }) + cfg.domains); }; }