1 { env, roundcubemail, roundcubemail-plugins, roundcubemail-skins, phpPackages, apacheHttpd }:
3 varDir = "/var/lib/roundcubemail";
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
13 dest = "webapps/tools-roundcube";
19 psql_url = with env.postgresql; "pgsql://${user}:${password}@unix(${socket}:${port})/${database}";
22 $config['db_dsnw'] = '${psql_url}';
23 $config['default_host'] = 'ssl://imap.immae.eu';
24 $config['username_domain'] = array(
25 "imap.immae.eu" => "mail.immae.eu"
27 $config['imap_conn_options'] = array("ssl" => array("verify_peer" => false));
28 $config['smtp_server'] = 'tls://smtp.immae.eu';
29 $config['smtp_port'] = '587';
30 $config['managesieve_host'] = 'imap.immae.eu';
31 $config['managesieve_port'] = '4190';
32 $config['managesieve_usetls'] = true;
33 $config['managesieve_conn_options'] = array("ssl" => array("verify_peer" => false));
35 $config['imap_cache'] = 'db';
36 $config['messages_cache'] = 'db';
38 $config['support_url'] = ''';
40 $config['des_key'] = '${env.secret}';
42 $config['skin'] = 'elastic';
43 $config['plugins'] = array(
44 'attachment_reminder',
46 'filesystem_attachments',
57 'automatic_addressbook',
60 // Ne marche pas ?: 'ident_switch',
61 // Ne marche pas ?: 'thunderbird_labels',
64 $config['language'] = 'fr_FR';
66 $config['drafts_mbox'] = 'Drafts';
67 $config['junk_mbox'] = 'Junk';
68 $config['sent_mbox'] = 'Sent';
69 $config['trash_mbox'] = 'Trash';
70 $config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
71 $config['draft_autosave'] = 60;
72 $config['enable_installer'] = false;
73 $config['log_driver'] = 'file';
74 $config['temp_dir'] = '${varDir}/cache';
75 $config['mime_types'] = '${apacheHttpd}/conf/mime.types';
78 webRoot = (roundcubemail.override { roundcube_config = "/var/secrets/webapps/tools-roundcube"; }).withPlugins
79 (builtins.attrValues roundcubemail-plugins) (builtins.attrValues roundcubemail-skins);
83 modules = [ "proxy_fcgi" ];
84 webappName = "tools_roundcubemail";
85 root = "/run/current-system/webapps/${webappName}";
87 Alias /roundcube "${root}"
89 DirectoryIndex index.php
91 Options FollowSymlinks
95 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
101 serviceDeps = [ "postgresql.service" ];
102 basedir = builtins.concatStringsSep ":" (
103 [ webRoot "/var/secrets/webapps/tools-roundcube" varDir ]
107 date.timezone = 'CET'
108 extension=${phpPackages.imagick}/lib/php/extensions/imagick.so
110 socket = "/var/run/phpfpm/roundcubemail.sock";
112 user = ${apache.user}
113 group = ${apache.group}
114 listen.owner = ${apache.user}
115 listen.group = ${apache.group}
118 pm.process_idle_timeout = 60
120 ; Needed to avoid clashes in browser cookies (same domain)
121 php_value[session.name] = RoundcubemailPHPSESSID
122 php_admin_value[upload_max_filesize] = 200M
123 php_admin_value[post_max_size] = 200M
124 php_admin_value[open_basedir] = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp"
125 php_admin_value[session.save_path] = "${varDir}/phpSessions"