diff options
Diffstat (limited to 'modules/private/websites/tools/mail/roundcubemail.nix')
-rw-r--r-- | modules/private/websites/tools/mail/roundcubemail.nix | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/modules/private/websites/tools/mail/roundcubemail.nix b/modules/private/websites/tools/mail/roundcubemail.nix deleted file mode 100644 index 2661b55..0000000 --- a/modules/private/websites/tools/mail/roundcubemail.nix +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | { env, roundcubemail, apacheHttpd, config }: | ||
2 | rec { | ||
3 | varDir = "/var/lib/roundcubemail"; | ||
4 | activationScript = { | ||
5 | deps = [ "wrappers" ]; | ||
6 | text = '' | ||
7 | install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ | ||
8 | ${varDir}/cache ${varDir}/logs | ||
9 | install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions | ||
10 | ''; | ||
11 | }; | ||
12 | keys."webapps/tools-roundcube" = { | ||
13 | user = apache.user; | ||
14 | group = apache.group; | ||
15 | permissions = "0400"; | ||
16 | text = | ||
17 | let | ||
18 | psql_url = with env.postgresql; "pgsql://${user}:${password}@unix(${socket}:${port})/${database}"; | ||
19 | in '' | ||
20 | <?php | ||
21 | $config['db_dsnw'] = '${psql_url}'; | ||
22 | $config['default_host'] = 'ssl://imap.immae.eu'; | ||
23 | $config['username_domain'] = array( | ||
24 | "imap.immae.eu" => "mail.immae.eu" | ||
25 | ); | ||
26 | $config['imap_conn_options'] = array("ssl" => array("verify_peer" => false)); | ||
27 | $config['smtp_server'] = 'tls://smtp.immae.eu'; | ||
28 | $config['smtp_port'] = '587'; | ||
29 | $config['managesieve_host'] = 'imap.immae.eu'; | ||
30 | $config['managesieve_port'] = '4190'; | ||
31 | $config['managesieve_usetls'] = true; | ||
32 | $config['managesieve_conn_options'] = array("ssl" => array("verify_peer" => false)); | ||
33 | |||
34 | $config['imap_cache'] = 'db'; | ||
35 | $config['messages_cache'] = 'db'; | ||
36 | |||
37 | $config['support_url'] = '''; | ||
38 | |||
39 | $config['des_key'] = '${env.secret}'; | ||
40 | |||
41 | $config['skin'] = 'elastic'; | ||
42 | $config['plugins'] = array( | ||
43 | 'attachment_reminder', | ||
44 | 'emoticons', | ||
45 | 'filesystem_attachments', | ||
46 | 'hide_blockquote', | ||
47 | 'identicon', | ||
48 | 'identity_select', | ||
49 | 'jqueryui', | ||
50 | 'markasjunk', | ||
51 | 'managesieve', | ||
52 | 'newmail_notifier', | ||
53 | 'vcard_attachments', | ||
54 | 'zipdownload', | ||
55 | |||
56 | 'automatic_addressbook', | ||
57 | 'message_highlight', | ||
58 | 'carddav', | ||
59 | // Ne marche pas ?: 'ident_switch', | ||
60 | // Ne marche pas ?: 'thunderbird_labels', | ||
61 | ); | ||
62 | |||
63 | $config['language'] = 'fr_FR'; | ||
64 | |||
65 | $config['drafts_mbox'] = 'Drafts'; | ||
66 | $config['junk_mbox'] = 'Junk'; | ||
67 | $config['sent_mbox'] = 'Sent'; | ||
68 | $config['trash_mbox'] = 'Trash'; | ||
69 | $config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'); | ||
70 | $config['draft_autosave'] = 60; | ||
71 | $config['enable_installer'] = false; | ||
72 | $config['log_driver'] = 'file'; | ||
73 | $config['temp_dir'] = '${varDir}/cache'; | ||
74 | $config['mime_types'] = '${apacheHttpd}/conf/mime.types'; | ||
75 | ''; | ||
76 | }; | ||
77 | webRoot = (roundcubemail.override { roundcube_config = config.secrets.fullPaths."webapps/tools-roundcube"; }).withPlugins (p: [ p.automatic_addressbook p.carddav p.contextmenu p.contextmenu_folder p.html5_notifier p.ident_switch p.message_highlight p.thunderbird_labels ]); | ||
78 | apache = rec { | ||
79 | user = "wwwrun"; | ||
80 | group = "wwwrun"; | ||
81 | modules = [ "proxy_fcgi" ]; | ||
82 | root = webRoot; | ||
83 | vhostConf = socket: '' | ||
84 | Alias /roundcube "${root}" | ||
85 | <Directory "${root}"> | ||
86 | DirectoryIndex index.php | ||
87 | AllowOverride All | ||
88 | Options FollowSymlinks | ||
89 | Require all granted | ||
90 | |||
91 | <FilesMatch "\.php$"> | ||
92 | SetHandler "proxy:unix:${socket}|fcgi://localhost" | ||
93 | </FilesMatch> | ||
94 | </Directory> | ||
95 | ''; | ||
96 | }; | ||
97 | phpFpm = rec { | ||
98 | serviceDeps = [ "postgresql.service" ]; | ||
99 | basedir = builtins.concatStringsSep ":" ( | ||
100 | [ webRoot config.secrets.fullPaths."webapps/tools-roundcube" varDir ] | ||
101 | ++ webRoot.plugins | ||
102 | ++ webRoot.skins); | ||
103 | pool = { | ||
104 | "listen.owner" = apache.user; | ||
105 | "listen.group" = apache.group; | ||
106 | "pm" = "ondemand"; | ||
107 | "pm.max_children" = "60"; | ||
108 | "pm.process_idle_timeout" = "60"; | ||
109 | |||
110 | # Needed to avoid clashes in browser cookies (same domain) | ||
111 | "php_value[session.name]" = "RoundcubemailPHPSESSID"; | ||
112 | "php_admin_value[upload_max_filesize]" = "200M"; | ||
113 | "php_admin_value[post_max_size]" = "200M"; | ||
114 | "php_admin_value[open_basedir]" = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp"; | ||
115 | "php_admin_value[session.save_path]" = "${varDir}/phpSessions"; | ||
116 | }; | ||
117 | }; | ||
118 | } | ||