mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
enable paperless permissions cleanup for nextcloud
and other systems
This commit is contained in:
parent
161c1f46b0
commit
46f3a459b6
@ -18,7 +18,8 @@
|
||||
};
|
||||
|
||||
# Allow Nextcloud and user to see files
|
||||
users.users.nextcloud.extraGroups = [ "paperless" ];
|
||||
users.users.nextcloud.extraGroups =
|
||||
lib.mkIf config.services.nextcloud.enable [ "paperless" ];
|
||||
users.users.${config.user}.extraGroups = [ "paperless" ];
|
||||
|
||||
caddy.routes = [{
|
||||
@ -47,7 +48,23 @@
|
||||
before = [ "paperless.service" ];
|
||||
};
|
||||
|
||||
# TODO: Scheduled permissions fix with systemd timer
|
||||
# Fix permissions on a regular schedule
|
||||
systemd.timers.paperless-permissions = {
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* *:0/5"; # Every 5 minutes
|
||||
Unit = "paperless-permissions.service";
|
||||
};
|
||||
wantedBy = [ "timers.target" ];
|
||||
};
|
||||
|
||||
# Fix paperless shared permissions
|
||||
systemd.services.paperless-permissions = {
|
||||
description = "Allow group access to paperless files";
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
script = ''
|
||||
find ${config.services.paperless.mediaDir} -type f -exec chmod 640 -- {} +
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user