]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Remove tmp from spip links
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 7 Jan 2019 23:02:52 +0000 (00:02 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 7 Jan 2019 23:13:32 +0000 (00:13 +0100)
virtual/packages/chloe.nix
virtual/packages/spip_mes_options.php

index 728855839f758e4b6a0556f755d5ea68032c6aad..a867bf207ce712228c61af2c9ee3ec1ec4b36352 100644 (file)
@@ -23,6 +23,8 @@ let
         ;php_admin_flag[log_errors] = on
         php_admin_value[open_basedir] = "${./spip_mes_options.php}:${configDir}:${webRoot}:${varDir}:/tmp"
         env[SPIP_CONFIG_DIR] = "${configDir}"
+        env[SPIP_VAR_DIR] = "${varDir}"
+        env[SPIP_SITE] = "chloe-${environment}"
         env[SPIP_LDAP_BASE] = "dc=immae,dc=eu"
         env[SPIP_LDAP_HOST] = "ldaps://ldap.immae.eu"
         env[SPIP_LDAP_SEARCH_DN] = "${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_LDAP_DN"}"
@@ -67,10 +69,6 @@ let
           Require all granted
         </Directory>
 
-        <DirectoryMatch "${varDir}/tmp">
-          Require all denied
-        </DirectoryMatch>
-
         <DirectoryMatch "${webRoot}/squelettes">
           Require all denied
         </DirectoryMatch>
@@ -93,7 +91,7 @@ let
     activationScript = {
       deps = [ "wrappers" ];
       text = ''
-        install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} ${varDir}/tmp ${varDir}/local
+        install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} ${varDir}/IMG ${varDir}/tmp ${varDir}/local
       '';
     };
     configDir = ./chloe_config;
@@ -108,10 +106,10 @@ let
       buildInputs = [ sassc ];
     });
     webRoot = stdenv.mkDerivation rec {
-      name = "spip-${version}";
+      name = "chloe-${environment}-spip-${version}";
       version = "3.2";
       src = fetchzip {
-        url = "http://files.spip.org/spip/stable/${name}.zip";
+        url = "http://files.spip.org/spip/stable/spip-${version}.zip";
         sha256 = "0cacpxs9nv61i3hzd3nbmplq4mp22s886llhacp3n4923jd6snx5";
       };
       paches = [ ./spip_ldap_patch.patch ];
@@ -119,7 +117,7 @@ let
         rm -rf IMG local tmp config/remove.txt
         ln -sf ${./spip_mes_options.php} config/mes_options.php
         echo "Require all denied" > "config/.htaccess"
-        ln -sf ../../../../../${varDir}/{IMG,local,tmp} .
+        ln -sf ../../../../../${varDir}/{IMG,local} .
       '';
       installPhase = ''
         cp -a . $out
index 88ac44995ba4eb7f3520c85ef9af8483a3851deb..8db8389349a88145a765abdfffb33166f7742357 100644 (file)
@@ -3,14 +3,15 @@
 // http://www.spip.net/fr_article3811.html
 
 $config_dir = getenv('SPIP_CONFIG_DIR') . '/';
+$var_dir = getenv('SPIP_VAR_DIR') . '/';
 
-$cookie_prefix = str_replace('.', '_', $site);
+$cookie_prefix = str_replace('.', '_', getenv("SPIP_SITE"));
 $table_prefix = 'spip';
 
 spip_initialisation(
         $config_dir,
         _DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES,
-        _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES,
+        $var_dir . _NOM_TEMPORAIRES_INACCESSIBLES,
         _DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES
 );