mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-27 06:25:23 +00:00
Merge pull request #236134 from Tom-Hubrecht/pixelfed
nixos/pixelfed: Fix missing permissions for nginx serving files
This commit is contained in:
commit
3897d52760
@ -356,7 +356,8 @@ in {
|
||||
ExecStart = "${pixelfed-manage}/bin/pixelfed-manage schedule:run";
|
||||
User = user;
|
||||
Group = group;
|
||||
StateDirectory = cfg.dataDir;
|
||||
StateDirectory =
|
||||
lib.mkIf (cfg.dataDir == "/var/lib/pixelfed") "pixelfed";
|
||||
};
|
||||
};
|
||||
|
||||
@ -391,6 +392,9 @@ in {
|
||||
rsync -av --no-perms ${pixelfed}/storage-static/ ${cfg.dataDir}/storage
|
||||
chmod -R +w ${cfg.dataDir}/storage
|
||||
|
||||
chmod g+x ${cfg.dataDir}/storage ${cfg.dataDir}/storage/app
|
||||
chmod -R g+rX ${cfg.dataDir}/storage/app/public
|
||||
|
||||
# Link the app.php in the runtime folder.
|
||||
# We cannot link the cache folder only because bootstrap folder needs to be writeable.
|
||||
ln -sf ${pixelfed}/bootstrap-static/app.php ${cfg.runtimeDir}/app.php
|
||||
@ -441,7 +445,7 @@ in {
|
||||
];
|
||||
|
||||
# Enable NGINX to access our phpfpm-socket.
|
||||
users.users."${config.services.nginx.group}".extraGroups = [ cfg.group ];
|
||||
users.users."${config.services.nginx.user}".extraGroups = [ cfg.group ];
|
||||
services.nginx = mkIf (cfg.nginx != null) {
|
||||
enable = true;
|
||||
virtualHosts."${cfg.domain}" = mkMerge [
|
||||
|
Loading…
Reference in New Issue
Block a user