cluster/services/storage: support bucket website mode

This commit is contained in:
Max Headroom 2024-07-04 22:06:25 +02:00
parent b98a603968
commit 60b18c9ccb

View file

@ -132,6 +132,7 @@ in
default = null;
};
};
web.enable = mkEnableOption "website access for this bucket";
};
});
default = {};
@ -225,6 +226,14 @@ in
''))
(lib.concatStringsSep "\n")
]}
# bucket website access
${lib.pipe cfg.buckets [
(lib.mapAttrsToList (bucket: bCfg: ''
garage bucket website ${if bCfg.web.enable then "--allow" else "--deny"} '${bucket}'
''))
(lib.concatStringsSep "\n")
]}
'';
};
};