fix(copyparty): preserve shared volume access
This commit is contained in:
@@ -111,7 +111,14 @@ in
|
|||||||
readOnly = true;
|
readOnly = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// lib.mapAttrs' (_urlPath: volume: lib.nameValuePair volume.path { directory = volume.hostPath; }) cfg.volumes;
|
// lib.mapAttrs' (_urlPath: volume:
|
||||||
|
lib.nameValuePair volume.path {
|
||||||
|
directory = volume.hostPath;
|
||||||
|
owner = "root";
|
||||||
|
group = "storage";
|
||||||
|
mode = "2770";
|
||||||
|
}
|
||||||
|
) cfg.volumes;
|
||||||
limits = {
|
limits = {
|
||||||
memory = lib.mkDefault "2G";
|
memory = lib.mkDefault "2G";
|
||||||
cpu = lib.mkDefault "200%";
|
cpu = lib.mkDefault "200%";
|
||||||
|
|||||||
@@ -34,7 +34,13 @@ let
|
|||||||
|
|
||||||
renderAccess = permission: accounts: " ${permission}: ${lib.concatStringsSep ", " accounts}";
|
renderAccess = permission: accounts: " ${permission}: ${lib.concatStringsSep ", " accounts}";
|
||||||
|
|
||||||
renderFlags = flags: lib.concatMapStringsSep "\n" (flag: " ${flag}") flags;
|
hasFlag = name: flags: lib.any (flag: lib.hasPrefix "${name}:" flag || lib.hasPrefix "${name}=" flag) flags;
|
||||||
|
|
||||||
|
defaultPermissionFlags = flags:
|
||||||
|
lib.optionals (!(hasFlag "chmod_d" flags)) [ "chmod_d: 2770" ]
|
||||||
|
++ lib.optionals (!(hasFlag "chmod_f" flags)) [ "chmod_f: 660" ];
|
||||||
|
|
||||||
|
renderFlags = flags: lib.concatMapStringsSep "\n" (flag: " ${flag}") (flags ++ defaultPermissionFlags flags);
|
||||||
|
|
||||||
renderVolume = urlPath: volume: ''
|
renderVolume = urlPath: volume: ''
|
||||||
[${urlPath}]
|
[${urlPath}]
|
||||||
|
|||||||
Reference in New Issue
Block a user