summary refs log tree commit diff
path: root/nixos/modules/services/web-servers
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-07-02 15:35:42 +0100
committerGitHub <noreply@github.com>2018-07-02 15:35:42 +0100
commit8cf4a4725c1389553228e314432dacb622a29781 (patch)
tree75cb2fc0e1c8a3042d31ec52506292b9eea5447f /nixos/modules/services/web-servers
parent5cc97704e40df982ea0dee819168a01e66ed7270 (diff)
parent3bec94f2e1e75c0d2bb08912ff7bc8c94fe9d779 (diff)
downloadnixlib-8cf4a4725c1389553228e314432dacb622a29781.tar
nixlib-8cf4a4725c1389553228e314432dacb622a29781.tar.gz
nixlib-8cf4a4725c1389553228e314432dacb622a29781.tar.bz2
nixlib-8cf4a4725c1389553228e314432dacb622a29781.tar.lz
nixlib-8cf4a4725c1389553228e314432dacb622a29781.tar.xz
nixlib-8cf4a4725c1389553228e314432dacb622a29781.tar.zst
nixlib-8cf4a4725c1389553228e314432dacb622a29781.zip
Merge pull request #41823 from Chiiruno/dev/meguca
meguca: 2018-05-26 -> 2018-06-11
Diffstat (limited to 'nixos/modules/services/web-servers')
-rw-r--r--nixos/modules/services/web-servers/meguca.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/modules/services/web-servers/meguca.nix b/nixos/modules/services/web-servers/meguca.nix
index 18926cbdf380..ed7325ff0790 100644
--- a/nixos/modules/services/web-servers/meguca.nix
+++ b/nixos/modules/services/web-servers/meguca.nix
@@ -104,15 +104,16 @@ in
       preStart = ''
         # Ensure folder exists and links are correct or create them
         mkdir -p ${cfg.baseDir}
+        chmod 750 ${cfg.baseDir}
         ln -sf ${pkgs.meguca}/share/meguca/www ${cfg.baseDir}
 
         # Ensure the database is correct or create it
         ${pkgs.sudo}/bin/sudo -u ${postgres.superUser} ${postgres.package}/bin/createuser \
           -SDR meguca || true
-        ${pkgs.sudo}/bin/sudo -u ${postgres.superUser} ${postgres.package}/bin/psql \
-          -c "ALTER ROLE meguca WITH PASSWORD '$(cat ${cfg.passwordFile})';" || true
         ${pkgs.sudo}/bin/sudo -u ${postgres.superUser} ${postgres.package}/bin/createdb \
           -T template0 -E UTF8 -O meguca meguca || true
+        ${pkgs.sudo}/bin/sudo -u meguca ${postgres.package}/bin/psql \
+          -c "ALTER ROLE meguca WITH PASSWORD '$(cat ${cfg.passwordFile})';" || true
       '';
 
     script = ''