aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/chloe/integration.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/websites/chloe/integration.nix')
-rw-r--r--modules/private/websites/chloe/integration.nix27
1 files changed, 12 insertions, 15 deletions
diff --git a/modules/private/websites/chloe/integration.nix b/modules/private/websites/chloe/integration.nix
index 7ed3852..aedf3a5 100644
--- a/modules/private/websites/chloe/integration.nix
+++ b/modules/private/websites/chloe/integration.nix
@@ -3,11 +3,8 @@ let
3 apacheUser = config.services.httpd.Inte.user; 3 apacheUser = config.services.httpd.Inte.user;
4 apacheGroup = config.services.httpd.Inte.group; 4 apacheGroup = config.services.httpd.Inte.group;
5 ccfg = config.myEnv.websites.chloe.integration; 5 ccfg = config.myEnv.websites.chloe.integration;
6 app = pkgs.callPackage ./app { 6 webRoot = "/var/lib/ftp/immae/chloe";
7 inherit (ccfg) environment; 7 varDir = "/var/lib/ftp/immae/chloe_var";
8 inherit (pkgs.webapps) spip;
9 varDir = "/var/lib/chloe_integration";
10 };
11 cfg = config.myServices.websites.chloe.integration; 8 cfg = config.myServices.websites.chloe.integration;
12in { 9in {
13 options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration"; 10 options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration";
@@ -20,8 +17,8 @@ in {
20 permissions = "0400"; 17 permissions = "0400";
21 text = '' 18 text = ''
22 SetEnv SPIP_CONFIG_DIR "${./config}" 19 SetEnv SPIP_CONFIG_DIR "${./config}"
23 SetEnv SPIP_VAR_DIR "${app.varDir}" 20 SetEnv SPIP_VAR_DIR "${varDir}"
24 SetEnv SPIP_SITE "chloe-${app.environment}" 21 SetEnv SPIP_SITE "chloe-dev"
25 SetEnv SPIP_LDAP_BASE "dc=immae,dc=eu" 22 SetEnv SPIP_LDAP_BASE "dc=immae,dc=eu"
26 SetEnv SPIP_LDAP_HOST "ldaps://ldap.immae.eu" 23 SetEnv SPIP_LDAP_HOST "ldaps://ldap.immae.eu"
27 SetEnv SPIP_LDAP_SEARCH_DN "${ccfg.ldap.dn}" 24 SetEnv SPIP_LDAP_SEARCH_DN "${ccfg.ldap.dn}"
@@ -45,8 +42,8 @@ in {
45 "php_admin_value[upload_max_filesize]" = "20M"; 42 "php_admin_value[upload_max_filesize]" = "20M";
46 "php_admin_value[post_max_size]" = "20M"; 43 "php_admin_value[post_max_size]" = "20M";
47 # "php_admin_flag[log_errors]" = "on"; 44 # "php_admin_flag[log_errors]" = "on";
48 "php_admin_value[open_basedir]" = "${app.spipConfig}:${./config}:${app}:${app.varDir}:/tmp"; 45 "php_admin_value[open_basedir]" = "${../../../../pkgs/webapps/spip/spip_mes_options.php}:${./config}:${webRoot}:${varDir}:/tmp";
49 "php_admin_value[session.save_path]" = "${app.varDir}/phpSessions"; 46 "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
50 "pm" = "ondemand"; 47 "pm" = "ondemand";
51 "pm.max_children" = "5"; 48 "pm.max_children" = "5";
52 "pm.process_idle_timeout" = "60"; 49 "pm.process_idle_timeout" = "60";
@@ -56,8 +53,8 @@ in {
56 system.activationScripts.chloe_integration = { 53 system.activationScripts.chloe_integration = {
57 deps = [ "wrappers" ]; 54 deps = [ "wrappers" ];
58 text = '' 55 text = ''
59 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir} ${app.varDir}/IMG ${app.varDir}/tmp ${app.varDir}/local 56 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir} ${varDir}/IMG ${varDir}/tmp ${varDir}/local
60 install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions 57 install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${varDir}/phpSessions
61 ''; 58 '';
62 }; 59 };
63 services.websites.env.integration.modules = [ "proxy_fcgi" ]; 60 services.websites.env.integration.modules = [ "proxy_fcgi" ];
@@ -65,7 +62,7 @@ in {
65 certName = "integration"; 62 certName = "integration";
66 addToCerts = true; 63 addToCerts = true;
67 hosts = ["chloe.immae.eu" ]; 64 hosts = ["chloe.immae.eu" ];
68 root = app.webRoot; 65 root = webRoot;
69 extraConfig = [ 66 extraConfig = [
70 '' 67 ''
71 Include ${config.secrets.fullPaths."websites/chloe/integration"} 68 Include ${config.secrets.fullPaths."websites/chloe/integration"}
@@ -76,16 +73,16 @@ in {
76 SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_integration.socket}|fcgi://localhost" 73 SetHandler "proxy:unix:${config.services.phpfpm.pools.chloe_integration.socket}|fcgi://localhost"
77 </FilesMatch> 74 </FilesMatch>
78 75
79 <Directory ${app.webRoot}> 76 <Directory ${webRoot}>
80 DirectoryIndex index.php index.htm index.html 77 DirectoryIndex index.php index.htm index.html
81 Options -Indexes +FollowSymLinks +MultiViews +Includes 78 Options -Indexes +FollowSymLinks +MultiViews +Includes
82 Include ${app.webRoot}/htaccess.txt 79 Include ${webRoot}/htaccess.txt
83 80
84 AllowOverride AuthConfig FileInfo Limit 81 AllowOverride AuthConfig FileInfo Limit
85 Require all granted 82 Require all granted
86 </Directory> 83 </Directory>
87 84
88 <DirectoryMatch "${app.webRoot}/squelettes"> 85 <DirectoryMatch "${webRoot}/squelettes">
89 Require all denied 86 Require all denied
90 </DirectoryMatch> 87 </DirectoryMatch>
91 88