aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/tools/tools/wallabag.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-01 12:22:13 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-01 12:22:13 +0200
commit4360f70d7a9966593d9e04043fa0a75defc094e0 (patch)
tree57e7a062754c823c9f91f13742b9b7de08937097 /modules/private/websites/tools/tools/wallabag.nix
parent02d6e977e309355ae728422e26063090e8a2f193 (diff)
downloadNix-4360f70d7a9966593d9e04043fa0a75defc094e0.tar.gz
Nix-4360f70d7a9966593d9e04043fa0a75defc094e0.tar.zst
Nix-4360f70d7a9966593d9e04043fa0a75defc094e0.zip
Add phpFpm prestart script to lib
Diffstat (limited to 'modules/private/websites/tools/tools/wallabag.nix')
-rw-r--r--modules/private/websites/tools/tools/wallabag.nix28
1 files changed, 13 insertions, 15 deletions
diff --git a/modules/private/websites/tools/tools/wallabag.nix b/modules/private/websites/tools/tools/wallabag.nix
index d6e5882..ba755e4 100644
--- a/modules/private/websites/tools/tools/wallabag.nix
+++ b/modules/private/websites/tools/tools/wallabag.nix
@@ -1,4 +1,4 @@
1{ env, wallabag }: 1{ env, wallabag, mylibs }:
2rec { 2rec {
3 varDir = "/var/lib/wallabag"; 3 varDir = "/var/lib/wallabag";
4 keys = [{ 4 keys = [{
@@ -110,20 +110,18 @@ rec {
110 ''; 110 '';
111 }; 111 };
112 phpFpm = rec { 112 phpFpm = rec {
113 preStart = '' 113 preStart = mylibs.phpFpmPreStart {
114 if [ ! -f "${varDir}/currentWebappDir" -o \ 114 app = webappDir;
115 ! -f "${varDir}/currentKey" -o \ 115 inherit varDir;
116 "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \ 116 keyFiles = [
117 || ! sha512sum -c --status ${varDir}/currentKey; then 117 "/var/secrets/webapps/tools-wallabag"
118 pushd ${webappDir} > /dev/null 118 ];
119 /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod cache:clear 119 actions = [
120 rm -rf /var/lib/wallabag/var/cache/pro_ 120 "/run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod cache:clear"
121 /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod doctrine:migrations:migrate --no-interaction 121 "rm -rf /var/lib/wallabag/var/cache/pro_"
122 popd > /dev/null 122 "/run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod doctrine:migrations:migrate --no-interaction"
123 echo -n "${webappDir}" > ${varDir}/currentWebappDir 123 ];
124 sha512sum /var/secrets/webapps/tools-wallabag > ${varDir}/currentKey 124 };
125 fi
126 '';
127 serviceDeps = [ "postgresql.service" "openldap.service" ]; 125 serviceDeps = [ "postgresql.service" "openldap.service" ];
128 basedir = builtins.concatStringsSep ":" [ webappDir "/var/secrets/webapps/tools-wallabag" varDir ]; 126 basedir = builtins.concatStringsSep ":" [ webappDir "/var/secrets/webapps/tools-wallabag" varDir ];
129 socket = "/var/run/phpfpm/wallabag.sock"; 127 socket = "/var/run/phpfpm/wallabag.sock";