]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/chloe/integration.nix
Remove webappdirs
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / integration.nix
index ffae6ecd703c11a7dad783cf40125835157d6b0a..7ed385255baa958ad1a202e7e26e9ce1aef265ff 100644 (file)
@@ -9,35 +9,31 @@ let
     varDir = "/var/lib/chloe_integration";
   };
   cfg = config.myServices.websites.chloe.integration;
-  webappdir = config.services.websites.webappDirsPaths.chloe_integration;
 in {
   options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration";
 
   config = lib.mkIf cfg.enable {
     services.duplyBackup.profiles.chloe_integration.rootDir = app.varDir;
-    secrets.keys = [
-      {
-        dest = "websites/chloe/integration";
-        user = apacheUser;
-        group = apacheGroup;
-        permissions = "0400";
-        text = ''
-          SetEnv SPIP_CONFIG_DIR     "${./config}"
-          SetEnv SPIP_VAR_DIR        "${app.varDir}"
-          SetEnv SPIP_SITE           "chloe-${app.environment}"
-          SetEnv SPIP_LDAP_BASE      "dc=immae,dc=eu"
-          SetEnv SPIP_LDAP_HOST      "ldaps://ldap.immae.eu"
-          SetEnv SPIP_LDAP_SEARCH_DN "${ccfg.ldap.dn}"
-          SetEnv SPIP_LDAP_SEARCH_PW "${ccfg.ldap.password}"
-          SetEnv SPIP_LDAP_SEARCH    "${ccfg.ldap.filter}"
-          SetEnv SPIP_MYSQL_HOST     "${ccfg.mysql.host}"
-          SetEnv SPIP_MYSQL_PORT     "${ccfg.mysql.port}"
-          SetEnv SPIP_MYSQL_DB       "${ccfg.mysql.database}"
-          SetEnv SPIP_MYSQL_USER     "${ccfg.mysql.user}"
-          SetEnv SPIP_MYSQL_PASSWORD "${ccfg.mysql.password}"
-        '';
-      }
-    ];
+    secrets.keys."websites/chloe/integration" = {
+      user = apacheUser;
+      group = apacheGroup;
+      permissions = "0400";
+      text = ''
+        SetEnv SPIP_CONFIG_DIR     "${./config}"
+        SetEnv SPIP_VAR_DIR        "${app.varDir}"
+        SetEnv SPIP_SITE           "chloe-${app.environment}"
+        SetEnv SPIP_LDAP_BASE      "dc=immae,dc=eu"
+        SetEnv SPIP_LDAP_HOST      "ldaps://ldap.immae.eu"
+        SetEnv SPIP_LDAP_SEARCH_DN "${ccfg.ldap.dn}"
+        SetEnv SPIP_LDAP_SEARCH_PW "${ccfg.ldap.password}"
+        SetEnv SPIP_LDAP_SEARCH    "${ccfg.ldap.filter}"
+        SetEnv SPIP_MYSQL_HOST     "${ccfg.mysql.host}"
+        SetEnv SPIP_MYSQL_PORT     "${ccfg.mysql.port}"
+        SetEnv SPIP_MYSQL_DB       "${ccfg.mysql.database}"
+        SetEnv SPIP_MYSQL_USER     "${ccfg.mysql.user}"
+        SetEnv SPIP_MYSQL_PASSWORD "${ccfg.mysql.password}"
+      '';
+    };
     systemd.services.phpfpm-chloe_integration.after = lib.mkAfter [ "mysql.service" ];
     systemd.services.phpfpm-chloe_integration.wants = [ "mysql.service" ];
     services.phpfpm.pools.chloe_integration = {
@@ -64,13 +60,12 @@ in {
         install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions
       '';
     };
-    services.websites.webappDirs.chloe_integration = app.webRoot;
     services.websites.env.integration.modules = [ "proxy_fcgi" ];
     services.websites.env.integration.vhostConfs.chloe_integration = {
       certName    = "integration";
       addToCerts  = true;
       hosts       = ["chloe.immae.eu" ];
-      root        = webappdir;
+      root        = app.webRoot;
       extraConfig = [
       ''
         Include ${config.secrets.fullPaths."websites/chloe/integration"}
@@ -81,16 +76,16 @@ in {
           SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_integration.socket}|fcgi://localhost"
         </FilesMatch>
 
-        <Directory ${webappdir}>
+        <Directory ${app.webRoot}>
           DirectoryIndex index.php index.htm index.html
           Options -Indexes +FollowSymLinks +MultiViews +Includes
-          Include ${webappdir}/htaccess.txt
+          Include ${app.webRoot}/htaccess.txt
 
           AllowOverride AuthConfig FileInfo Limit
           Require all granted
         </Directory>
 
-        <DirectoryMatch "${webappdir}/squelettes">
+        <DirectoryMatch "${app.webRoot}/squelettes">
           Require all denied
         </DirectoryMatch>