]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/chloe/chloe.nix
Remove useless relative symlinks
[perso/Immae/Config/Nix.git] / nixops / modules / websites / chloe / chloe.nix
index 355cca7cb79fcf67a6771c374e1d5829e49ad88b..7ad23fede7c3a3d9569a3faa37b33881cd2b6700 100644 (file)
@@ -23,7 +23,8 @@ let
         env[SPIP_LDAP_SEARCH_DN] = "${config.ldap.dn}"
         env[SPIP_LDAP_SEARCH_PW] = "${config.ldap.password}"
         env[SPIP_LDAP_SEARCH] = "${config.ldap.search}"
-        env[SPIP_MYSQL_HOST] = "db-1.immae.eu"
+        env[SPIP_MYSQL_HOST] = "${config.mysql.host}"
+        env[SPIP_MYSQL_PORT] = "${config.mysql.port}"
         env[SPIP_MYSQL_DB] = "${config.mysql.name}"
         env[SPIP_MYSQL_USER] = "${config.mysql.user}"
         env[SPIP_MYSQL_PASSWORD] = "${config.mysql.password}"
@@ -39,10 +40,12 @@ let
         pm.max_spare_servers = 3
         ''}'';
     };
-    apache = {
+    apache = rec {
       user = "wwwrun";
       group = "wwwrun";
       modules = [ "proxy_fcgi" ];
+      webappName = "chloe_${environment}";
+      root = "/run/current-system/webapps/${webappName}";
       vhostConf = ''
         RewriteEngine On
         ${if environment == "prod" then ''
@@ -53,16 +56,16 @@ let
           SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
         </FilesMatch>
 
-        <Directory ${webRoot}>
+        <Directory ${root}>
           DirectoryIndex index.php index.htm index.html
           Options -Indexes +FollowSymLinks +MultiViews +Includes
-          Include ${webRoot}/htaccess.txt
+          Include ${root}/htaccess.txt
 
           AllowOverride AuthConfig FileInfo Limit
           Require all granted
         </Directory>
 
-        <DirectoryMatch "${webRoot}/squelettes">
+        <DirectoryMatch "${root}/squelettes">
           Require all denied
         </DirectoryMatch>
 
@@ -111,7 +114,7 @@ let
         rm -rf IMG local tmp config/remove.txt
         ln -sf ${../commons/spip/spip_mes_options.php} config/mes_options.php
         echo "Require all denied" > "config/.htaccess"
-        ln -sf ../../../../../${varDir}/{IMG,local} .
+        ln -sf ${varDir}/{IMG,local} .
       '';
       installPhase = ''
         cp -a . $out