cluster/services/storage: support bucket website mode
This commit is contained in:
parent
b98a603968
commit
60b18c9ccb
1 changed files with 9 additions and 0 deletions
|
@ -132,6 +132,7 @@ in
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
web.enable = mkEnableOption "website access for this bucket";
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -225,6 +226,14 @@ in
|
||||||
''))
|
''))
|
||||||
(lib.concatStringsSep "\n")
|
(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")
|
||||||
|
]}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue