diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-25 11:57:48 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-03 16:25:07 +0200 |
commit | 5400b9b6f65451d41a9106fae6fc00f97d83f4ef (patch) | |
tree | 6ed072da7b1f17ac3994ffea052aa0c0822f8446 /modules/private/websites/tools/mail | |
parent | 441da8aac378f401625e82caf281fa0e26128310 (diff) | |
download | Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.tar.gz Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.tar.zst Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.zip |
Upgrade nixos
Diffstat (limited to 'modules/private/websites/tools/mail')
-rw-r--r-- | modules/private/websites/tools/mail/default.nix | 15 | ||||
-rw-r--r-- | modules/private/websites/tools/mail/rainloop.nix | 33 | ||||
-rw-r--r-- | modules/private/websites/tools/mail/roundcubemail.nix | 33 |
3 files changed, 39 insertions, 42 deletions
diff --git a/modules/private/websites/tools/mail/default.nix b/modules/private/websites/tools/mail/default.nix index bb36042..1f7f7bf 100644 --- a/modules/private/websites/tools/mail/default.nix +++ b/modules/private/websites/tools/mail/default.nix | |||
@@ -6,6 +6,7 @@ let | |||
6 | }; | 6 | }; |
7 | rainloop = pkgs.callPackage ./rainloop.nix {}; | 7 | rainloop = pkgs.callPackage ./rainloop.nix {}; |
8 | cfg = config.myServices.websites.tools.email; | 8 | cfg = config.myServices.websites.tools.email; |
9 | pcfg = config.services.phpfpm.pools; | ||
9 | in | 10 | in |
10 | { | 11 | { |
11 | options.myServices.websites.tools.email = { | 12 | options.myServices.websites.tools.email = { |
@@ -34,8 +35,8 @@ in | |||
34 | hosts = ["mail.immae.eu"]; | 35 | hosts = ["mail.immae.eu"]; |
35 | root = "/run/current-system/webapps/_mail"; | 36 | root = "/run/current-system/webapps/_mail"; |
36 | extraConfig = [ | 37 | extraConfig = [ |
37 | rainloop.apache.vhostConf | 38 | (rainloop.apache.vhostConf pcfg.rainloop.socket) |
38 | roundcubemail.apache.vhostConf | 39 | (roundcubemail.apache.vhostConf pcfg.roundcubemail.socket) |
39 | '' | 40 | '' |
40 | <Directory /run/current-system/webapps/_mail> | 41 | <Directory /run/current-system/webapps/_mail> |
41 | Require all granted | 42 | Require all granted |
@@ -56,13 +57,15 @@ in | |||
56 | }; | 57 | }; |
57 | 58 | ||
58 | services.phpfpm.pools.roundcubemail = { | 59 | services.phpfpm.pools.roundcubemail = { |
59 | listen = roundcubemail.phpFpm.socket; | 60 | user = "wwwrun"; |
60 | extraConfig = roundcubemail.phpFpm.pool; | 61 | group = "wwwrun"; |
62 | settings = roundcubemail.phpFpm.pool; | ||
61 | phpOptions = config.services.phpfpm.phpOptions + roundcubemail.phpFpm.phpConfig; | 63 | phpOptions = config.services.phpfpm.phpOptions + roundcubemail.phpFpm.phpConfig; |
62 | }; | 64 | }; |
63 | services.phpfpm.pools.rainloop = { | 65 | services.phpfpm.pools.rainloop = { |
64 | listen = rainloop.phpFpm.socket; | 66 | user = "wwwrun"; |
65 | extraConfig = rainloop.phpFpm.pool; | 67 | group = "wwwrun"; |
68 | settings = rainloop.phpFpm.pool; | ||
66 | }; | 69 | }; |
67 | system.activationScripts = { | 70 | system.activationScripts = { |
68 | roundcubemail = roundcubemail.activationScript; | 71 | roundcubemail = roundcubemail.activationScript; |
diff --git a/modules/private/websites/tools/mail/rainloop.nix b/modules/private/websites/tools/mail/rainloop.nix index 2dad46e..9b1f0c5 100644 --- a/modules/private/websites/tools/mail/rainloop.nix +++ b/modules/private/websites/tools/mail/rainloop.nix | |||
@@ -16,7 +16,7 @@ rec { | |||
16 | modules = [ "proxy_fcgi" ]; | 16 | modules = [ "proxy_fcgi" ]; |
17 | webappName = "tools_rainloop"; | 17 | webappName = "tools_rainloop"; |
18 | root = "/run/current-system/webapps/${webappName}"; | 18 | root = "/run/current-system/webapps/${webappName}"; |
19 | vhostConf = '' | 19 | vhostConf = socket: '' |
20 | Alias /rainloop "${root}" | 20 | Alias /rainloop "${root}" |
21 | <Directory "${root}"> | 21 | <Directory "${root}"> |
22 | DirectoryIndex index.php | 22 | DirectoryIndex index.php |
@@ -25,7 +25,7 @@ rec { | |||
25 | Require all granted | 25 | Require all granted |
26 | 26 | ||
27 | <FilesMatch "\.php$"> | 27 | <FilesMatch "\.php$"> |
28 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 28 | SetHandler "proxy:unix:${socket}|fcgi://localhost" |
29 | </FilesMatch> | 29 | </FilesMatch> |
30 | </Directory> | 30 | </Directory> |
31 | 31 | ||
@@ -37,22 +37,19 @@ rec { | |||
37 | phpFpm = rec { | 37 | phpFpm = rec { |
38 | serviceDeps = [ "postgresql.service" ]; | 38 | serviceDeps = [ "postgresql.service" ]; |
39 | basedir = builtins.concatStringsSep ":" [ webRoot varDir ]; | 39 | basedir = builtins.concatStringsSep ":" [ webRoot varDir ]; |
40 | socket = "/var/run/phpfpm/rainloop.sock"; | 40 | pool = { |
41 | pool = '' | 41 | "listen.owner" = apache.user; |
42 | user = ${apache.user} | 42 | "listen.group" = apache.group; |
43 | group = ${apache.group} | 43 | "pm" = "ondemand"; |
44 | listen.owner = ${apache.user} | 44 | "pm.max_children" = "60"; |
45 | listen.group = ${apache.group} | 45 | "pm.process_idle_timeout" = "60"; |
46 | pm = ondemand | ||
47 | pm.max_children = 60 | ||
48 | pm.process_idle_timeout = 60 | ||
49 | 46 | ||
50 | ; Needed to avoid clashes in browser cookies (same domain) | 47 | # Needed to avoid clashes in browser cookies (same domain) |
51 | php_value[session.name] = RainloopPHPSESSID | 48 | "php_value[session.name]" = "RainloopPHPSESSID"; |
52 | php_admin_value[upload_max_filesize] = 200M | 49 | "php_admin_value[upload_max_filesize]" = "200M"; |
53 | php_admin_value[post_max_size] = 200M | 50 | "php_admin_value[post_max_size]" = "200M"; |
54 | php_admin_value[open_basedir] = "${basedir}:/tmp" | 51 | "php_admin_value[open_basedir]" = "${basedir}:/tmp"; |
55 | php_admin_value[session.save_path] = "${varDir}/phpSessions" | 52 | "php_admin_value[session.save_path]" = "${varDir}/phpSessions"; |
56 | ''; | 53 | }; |
57 | }; | 54 | }; |
58 | } | 55 | } |
diff --git a/modules/private/websites/tools/mail/roundcubemail.nix b/modules/private/websites/tools/mail/roundcubemail.nix index 35de312..0b35d02 100644 --- a/modules/private/websites/tools/mail/roundcubemail.nix +++ b/modules/private/websites/tools/mail/roundcubemail.nix | |||
@@ -83,7 +83,7 @@ rec { | |||
83 | modules = [ "proxy_fcgi" ]; | 83 | modules = [ "proxy_fcgi" ]; |
84 | webappName = "tools_roundcubemail"; | 84 | webappName = "tools_roundcubemail"; |
85 | root = "/run/current-system/webapps/${webappName}"; | 85 | root = "/run/current-system/webapps/${webappName}"; |
86 | vhostConf = '' | 86 | vhostConf = socket: '' |
87 | Alias /roundcube "${root}" | 87 | Alias /roundcube "${root}" |
88 | <Directory "${root}"> | 88 | <Directory "${root}"> |
89 | DirectoryIndex index.php | 89 | DirectoryIndex index.php |
@@ -92,7 +92,7 @@ rec { | |||
92 | Require all granted | 92 | Require all granted |
93 | 93 | ||
94 | <FilesMatch "\.php$"> | 94 | <FilesMatch "\.php$"> |
95 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 95 | SetHandler "proxy:unix:${socket}|fcgi://localhost" |
96 | </FilesMatch> | 96 | </FilesMatch> |
97 | </Directory> | 97 | </Directory> |
98 | ''; | 98 | ''; |
@@ -107,22 +107,19 @@ rec { | |||
107 | date.timezone = 'CET' | 107 | date.timezone = 'CET' |
108 | extension=${phpPackages.imagick}/lib/php/extensions/imagick.so | 108 | extension=${phpPackages.imagick}/lib/php/extensions/imagick.so |
109 | ''; | 109 | ''; |
110 | socket = "/var/run/phpfpm/roundcubemail.sock"; | 110 | pool = { |
111 | pool = '' | 111 | "listen.owner" = apache.user; |
112 | user = ${apache.user} | 112 | "listen.group" = apache.group; |
113 | group = ${apache.group} | 113 | "pm" = "ondemand"; |
114 | listen.owner = ${apache.user} | 114 | "pm.max_children" = "60"; |
115 | listen.group = ${apache.group} | 115 | "pm.process_idle_timeout" = "60"; |
116 | pm = ondemand | ||
117 | pm.max_children = 60 | ||
118 | pm.process_idle_timeout = 60 | ||
119 | 116 | ||
120 | ; Needed to avoid clashes in browser cookies (same domain) | 117 | # Needed to avoid clashes in browser cookies (same domain) |
121 | php_value[session.name] = RoundcubemailPHPSESSID | 118 | "php_value[session.name]" = "RoundcubemailPHPSESSID"; |
122 | php_admin_value[upload_max_filesize] = 200M | 119 | "php_admin_value[upload_max_filesize]" = "200M"; |
123 | php_admin_value[post_max_size] = 200M | 120 | "php_admin_value[post_max_size]" = "200M"; |
124 | php_admin_value[open_basedir] = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp" | 121 | "php_admin_value[open_basedir]" = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp"; |
125 | php_admin_value[session.save_path] = "${varDir}/phpSessions" | 122 | "php_admin_value[session.save_path]" = "${varDir}/phpSessions"; |
126 | ''; | 123 | }; |
127 | }; | 124 | }; |
128 | } | 125 | } |