1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-01-02 03:38:23 +02:00

php: use correct php image + workaround of #6149 (#6159)

* compose: bump php-fpm container to correctly use patched c-ares

* [Web] check $containers_info contains required fields

---------

Co-authored-by: FreddleSpl0it <patschul@posteo.de>
This commit is contained in:
Niklas Meyer 2024-11-12 15:56:23 +01:00 committed by GitHub
parent afe0ba74d2
commit b90375b6e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 10 deletions

View File

@ -23,11 +23,15 @@ $exec_fields = array('cmd' => 'system', 'task' => 'df', 'dir' => '/var/vmail');
$vmail_df = explode(',', (string)json_decode(docker('post', 'dovecot-mailcow', 'exec', $exec_fields), true)); $vmail_df = explode(',', (string)json_decode(docker('post', 'dovecot-mailcow', 'exec', $exec_fields), true));
// containers // containers
$containers = (array) docker('info'); $containers_info = (array) docker('info');
if ($clamd_status === false) unset($containers['clamd-mailcow']); if ($clamd_status === false) unset($containers_info['clamd-mailcow']);
if ($solr_status === false) unset($containers['solr-mailcow']); if ($solr_status === false) unset($containers_info['solr-mailcow']);
ksort($containers); ksort($containers_info);
foreach ($containers as $container => $container_info) { $containers = array();
foreach ($containers_info as $container => $container_info) {
if (!isset($container_info['State']) || !is_array($container_info['State']) || !isset($container_info['State']['StartedAt'])){
continue;
}
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
$StartedAt = date_parse($container_info['State']['StartedAt']); $StartedAt = date_parse($container_info['State']['StartedAt']);
if ($StartedAt['hour'] !== false) { if ($StartedAt['hour'] !== false) {
@ -42,15 +46,15 @@ foreach ($containers as $container => $container_info) {
try { try {
$user_tz = new DateTimeZone(getenv('TZ')); $user_tz = new DateTimeZone(getenv('TZ'));
$date->setTimezone($user_tz); $date->setTimezone($user_tz);
$started = $date->format('r'); $container_info['State']['StartedAtHR'] = $date->format('r');
} catch(Exception $e) { } catch(Exception $e) {
$started = '?'; $container_info['State']['StartedAtHR'] = '?';
} }
} }
else { else {
$started = '?'; $container_info['State']['StartedAtHR'] = '?';
} }
$containers[$container]['State']['StartedAtHR'] = $started; $containers[$container] = $container_info;
} }
// get mailcow data // get mailcow data

View File

@ -112,7 +112,7 @@ services:
- rspamd - rspamd
php-fpm-mailcow: php-fpm-mailcow:
image: mailcow/phpfpm:1.91 image: mailcow/phpfpm:1.91.1
command: "php-fpm -d date.timezone=${TZ} -d expose_php=0" command: "php-fpm -d date.timezone=${TZ} -d expose_php=0"
depends_on: depends_on:
- redis-mailcow - redis-mailcow