diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-09-08 02:02:49 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-09-08 02:03:08 +0200 |
commit | e2d06229e4ebbe4640872f6e2fcb7b32329b462a (patch) | |
tree | 0e44b88e4f668a7728dc02aeb013a36fc093f6f2 /roles | |
parent | ed39d18545982af2192a587f477fb32d766f0459 (diff) |
Webmail: Upgrade backend to PHP7.4.
Diffstat (limited to 'roles')
-rw-r--r-- | roles/webmail/files/etc/nginx/sites-available/roundcube | 2 | ||||
-rw-r--r-- | roles/webmail/files/etc/php/fpm/pool.d/roundcube.conf | 2 | ||||
-rw-r--r-- | roles/webmail/handlers/main.yml | 4 | ||||
-rw-r--r-- | roles/webmail/tasks/roundcube.yml | 26 |
4 files changed, 17 insertions, 17 deletions
diff --git a/roles/webmail/files/etc/nginx/sites-available/roundcube b/roles/webmail/files/etc/nginx/sites-available/roundcube index 46012f8..602668f 100644 --- a/roles/webmail/files/etc/nginx/sites-available/roundcube +++ b/roles/webmail/files/etc/nginx/sites-available/roundcube @@ -48,29 +48,29 @@ server { } location = /robots.txt { allow all; log_not_found off; access_log off; } access_log /var/log/nginx/roundcube.access.log; error_log /var/log/nginx/roundcube.error.log info; client_max_body_size 64m; location = / { index index.php; } location = /index.php { # TODO enable gzip for Roundcube >=1.5: it's immune to BREACH attacks once # $config['session_samesite'] is set to 'Strict', see # https://github.com/roundcube/roundcubemail/pull/6772 # https://www.sjoerdlangkemper.nl/2016/11/07/current-state-of-breach-attack/#same-site-cookies gzip off; include snippets/fastcgi-php-ssl.conf; - fastcgi_pass unix:/var/run/php/php7.3-fpm@roundcube.sock; + fastcgi_pass unix:/var/run/php/php7.4-fpm@roundcube.sock; } location ~ "^/(?:plugins|program/js|program/resources|skins)(?:/[[:alnum:]][[:alnum:]\-\._]*)+\.(?:css|eot|gif|html|ico|jpg|js|pdf|png|svg|tiff?|ttf|webp|woff2?)$" { expires 30d; try_files $uri =404; } location / { internal; } } diff --git a/roles/webmail/files/etc/php/fpm/pool.d/roundcube.conf b/roles/webmail/files/etc/php/fpm/pool.d/roundcube.conf index 1512d66..1a7a1d8 100644 --- a/roles/webmail/files/etc/php/fpm/pool.d/roundcube.conf +++ b/roles/webmail/files/etc/php/fpm/pool.d/roundcube.conf @@ -1,22 +1,22 @@ [roundcube] user = _roundcube group = nogroup -listen = /run/php/php7.3-fpm@roundcube.sock +listen = /run/php/php7.4-fpm@roundcube.sock listen.owner = www-data listen.group = www-data listen.mode = 0600 pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 php_value[upload_max_filesize] = 25M php_value[post_max_size] = 30M php_value[memory_limit] = 64M php_value[session.gc_maxlifetime] = 21600 php_value[session.gc_divisor] = 500 php_value[session.gc_probability] = 1 php_admin_value[upload_tmp_dir] = /var/lib/roundcube/temp php_admin_value[open_basedir] = /var/lib/roundcube:/usr/share/roundcube:/etc/roundcube:/var/log/roundcube:/usr/share/php:/usr/share/javascript:/usr/lib/nodejs:/usr/share/tinymce:/usr/share/misc/magic:/dev diff --git a/roles/webmail/handlers/main.yml b/roles/webmail/handlers/main.yml index 5b730d7..8c70168 100644 --- a/roles/webmail/handlers/main.yml +++ b/roles/webmail/handlers/main.yml @@ -1,15 +1,15 @@ --- - name: Restart stunnel@ldap service: name=stunnel4@ldap state=restarted -- name: Restart php7.3-fpm - service: name=php7.3-fpm state=restarted +- name: Restart php7.4-fpm + service: name=php7.4-fpm state=restarted - name: Restart Nginx service: name=nginx state=restarted - name: Stop stunnel4@ldap.service service: name=stunnel4@ldap.service state=stopped - name: Restart stunnel4@ldap.socket service: name=stunnel4@ldap.socket state=restarted diff --git a/roles/webmail/tasks/roundcube.yml b/roles/webmail/tasks/roundcube.yml index dc73358..2296cc2 100644 --- a/roles/webmail/tasks/roundcube.yml +++ b/roles/webmail/tasks/roundcube.yml @@ -1,68 +1,68 @@ - name: Install PHP apt: pkg={{ packages }} vars: packages: - php-fpm - php-ldap - php-gd - php # spell-checking - php-enchant ## TODO: run php as a dedicated system user -- name: Configure PHP 7.3 Zend opcache - lineinfile: dest=/etc/php/7.3/fpm/php.ini +- name: Configure PHP 7.4 Zend opcache + lineinfile: dest=/etc/php/7.4/fpm/php.ini regexp='^;?{{ item.var }}\\s*=' line="{{ item.var }} = {{ item.value }}" owner=root group=root mode=0644 with_items: - { var: opcache.memory_consumption, value: 128 } - { var: opcache.revalidate_freq, value: 60 } notify: - - Restart php7.3-fpm + - Restart php7.4-fpm - name: Create '_roundcube' user user: name=_roundcube system=yes group=nogroup createhome=no home=/nonexistent shell=/usr/sbin/nologin password=! state=present -- name: Delete PHP 7.3 FPM's www pool - file: path=/etc/php/7.3/fpm/pool.d/www.conf state=absent +- name: Delete PHP 7.4 FPM's www pool + file: path=/etc/php/7.4/fpm/pool.d/www.conf state=absent notify: - - Restart php7.3-fpm + - Restart php7.4-fpm -- name: Configure PHP 7.3 FPM's roundcube pool +- name: Configure PHP 7.4 FPM's roundcube pool copy: src=etc/php/fpm/pool.d/roundcube.conf - dest=/etc/php/7.3/fpm/pool.d/roundcube.conf + dest=/etc/php/7.4/fpm/pool.d/roundcube.conf owner=root group=root mode=0644 notify: - - Restart php7.3-fpm + - Restart php7.4-fpm -- name: Start php7.3-fpm - service: name=php7.3-fpm state=started +- name: Start php7.4-fpm + service: name=php7.4-fpm state=started # Make it sticky: `dpkg-statoverride --add _roundcube nogroup 0700 /var/lib/roundcube/temp` - name: Create cache directory /var/lib/roundcube/temp file: path=/var/lib/roundcube/temp state=directory owner=_roundcube group=nogroup mode=0700 # Make it sticky: `dpkg-statoverride --add _roundcube adm 0750 /var/log/roundcube` - name: Create cache directory /var/log/roundcube file: path=/var/log/roundcube state=directory owner=_roundcube group=adm mode=0750 - name: Install GNU Aspell and some dictionaries apt: pkg={{ packages }} vars: packages: - aspell @@ -165,42 +165,42 @@ - name: Configure Roundcube plugins copy: src=etc/roundcube/plugins/{{ item }}/config.inc.php dest=/etc/roundcube/plugins/{{ item }}/config.inc.php owner=root group=root mode=0644 with_items: - additional_message_headers - authres_status - password - html5_notifier - thunderbird_labels - name: Configure Roundcube plugins (2) template: src=etc/roundcube/plugins/{{ item }}/config.inc.php.j2 dest=/etc/roundcube/plugins/{{ item }}/config.inc.php owner=root group=root mode=0644 with_items: - managesieve -- name: Start php7.3-fpm - service: name=php7.3-fpm state=started +- name: Start php7.4-fpm + service: name=php7.4-fpm state=started - name: Copy /etc/cron.d/roundcube-core copy: src=etc/cron.d/roundcube-core dest=/etc/cron.d/roundcube-core owner=root group=root mode=0644 - name: Tweak /etc/logrotate.d/roundcube-core lineinfile: dest=/etc/logrotate.d/roundcube-core regexp='^(\s*)create\s+[0-9]+\s+\S+\s+adm$' backrefs=yes line='\1create 0640 _roundcube adm' owner=root group=root mode=0644 - name: Copy /etc/nginx/sites-available/roundcube copy: src=etc/nginx/sites-available/roundcube dest=/etc/nginx/sites-available/roundcube owner=root group=root mode=0644 |