Skip to content

Commit

Permalink
nixos/immich: restrict media filesystem permissions
Browse files Browse the repository at this point in the history
immich appears to create this directory with permissions 0755 by
default, which needlessly exposes user data to other processes.
  • Loading branch information
Ralith committed Dec 6, 2024
1 parent ee5452c commit ed020bb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nixos/modules/services/web-apps/immich.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
UMask = "0027";
};
inherit (lib)
types
Expand Down Expand Up @@ -353,6 +354,18 @@ in
};
};

systemd.tmpfiles.settings = {
"immich" = {
"${cfg.mediaLocation}" = {
d = {
user = cfg.user;
group = cfg.group;
mode = "0750";
};
};
};
};

users.users = mkIf (cfg.user == "immich") {
immich = {
name = "immich";
Expand Down

0 comments on commit ed020bb

Please sign in to comment.