]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/connexionswing/connexionswing.nix
Add "pub" user
[perso/Immae/Config/Nix.git] / nixops / modules / websites / connexionswing / connexionswing.nix
index 307def0ad5b619d057aef27aaa21e9d27b96d5b6..8fbca2d8d6d703a8a1ad05be3966bf02b62a7dd4 100644 (file)
@@ -56,10 +56,12 @@ let
         pm.max_spare_servers = 3
         ''}'';
     };
-    apache = {
+    apache = rec {
       user = "wwwrun";
       group = "wwwrun";
       modules = [ "proxy_fcgi" ];
+      webappName = "connexionswing_${environment}";
+      root = "/run/current-system/webapps/${webappName}";
       vhostConf = ''
       <FilesMatch "\.php$">
         SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
@@ -84,7 +86,7 @@ let
         ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://connexionswing.com\"></html>"
       </Location>
 
-      <Directory ${webRoot}>
+      <Directory ${root}>
         Options Indexes FollowSymLinks MultiViews Includes
         AllowOverride None
         Require all granted
@@ -127,7 +129,7 @@ let
       '' else ''
       Use Stats connexionswing.com
 
-      <Directory ${webRoot}>
+      <Directory ${root}>
         Options Indexes FollowSymLinks MultiViews Includes
         AllowOverride All
         Require all granted
@@ -166,8 +168,8 @@ let
           rm app/config/parameters.yml
           ln -sf ${configRoot} app/config/parameters.yml
           rm -rf var/{logs,cache}
-          ln -sf ../../../../../../${varDir}/var/{logs,cache} var/
-          ln -sf ../../../../../${varDir}/{medias,uploads} web/images/
+          ln -sf ${varDir}/var/{logs,cache} var/
+          ln -sf ${varDir}/{medias,uploads} web/images/
           '';
       });
     webRoot = "${webappDir}/web";