]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Improve shaarli keys handling
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 15 Apr 2019 10:29:50 +0000 (12:29 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 15 Apr 2019 10:30:47 +0000 (12:30 +0200)
Related issue: https://git.immae.eu/mantisbt/view.php?id=122

nixops/modules/websites/tools/tools/default.nix
nixops/modules/websites/tools/tools/shaarli.nix

index 31ed03561c278fb304d5ef80a4522b77ed9cf1c8..f51510ff614668c522f44acbd39bf264ac146fa4 100644 (file)
@@ -138,10 +138,6 @@ in {
       ];
     };
 
-    services.myPhpfpm.envFile = {
-      shaarli = shaarli.phpFpm.envFile;
-    };
-
     services.myPhpfpm.serviceDependencies = {
       dokuwiki = dokuwiki.phpFpm.serviceDeps;
       kanboard = kanboard.phpFpm.serviceDeps;
index 157c4de661ac2cac58c4e1c8eca757f393426e2c..543518152bd781096bd3d03ce2bde2af21c827eb 100644 (file)
@@ -49,6 +49,7 @@ in rec {
     vhostConf = ''
       Alias /Shaarli "${root}"
 
+      Include /run/keys/webapps/tools-shaarli
       <Directory "${root}">
         DirectoryIndex index.php index.htm index.html
         Options Indexes FollowSymLinks MultiViews Includes
@@ -66,16 +67,15 @@ in rec {
     group = apache.group;
     permissions = "0700";
     text = ''
-      SHAARLI_LDAP_PASSWORD="${env.ldap.password}"
-      SHAARLI_LDAP_DN="${env.ldap.dn}"
-      SHAARLI_LDAP_HOST="ldaps://${env.ldap.host}"
-      SHAARLI_LDAP_BASE="${env.ldap.base}"
-      SHAARLI_LDAP_FILTER="${env.ldap.search}"
+      SetEnv SHAARLI_LDAP_PASSWORD "${env.ldap.password}"
+      SetEnv SHAARLI_LDAP_DN       "${env.ldap.dn}"
+      SetEnv SHAARLI_LDAP_HOST     "ldaps://${env.ldap.host}"
+      SetEnv SHAARLI_LDAP_BASE     "${env.ldap.base}"
+      SetEnv SHAARLI_LDAP_FILTER   "${env.ldap.search}"
       '';
   };
   phpFpm = rec {
-    serviceDeps = [ "openldap.service" "tools-shaarli-key.service" ];
-    envFile = "/run/keys/webapps/tools-shaarli";
+    serviceDeps = [ "openldap.service" ];
     basedir = builtins.concatStringsSep ":" [ webRoot varDir ];
     socket = "/var/run/phpfpm/shaarli.sock";
     pool = ''
@@ -87,7 +87,6 @@ in rec {
         pm = ondemand
         pm.max_children = 60
         pm.process_idle_timeout = 60
-        clear_env = no
 
         ; Needed to avoid clashes in browser cookies (same domain)
         php_value[session.name] = ShaarliPHPSESSID