Skip to content

Commit

Permalink
php: use correct php image + workaround of #6149 (#6159)
Browse files Browse the repository at this point in the history
* compose: bump php-fpm container to correctly use patched c-ares

* [Web] check $containers_info contains required fields

---------

Co-authored-by: FreddleSpl0it <[email protected]>
  • Loading branch information
DerLinkman and FreddleSpl0it authored Nov 12, 2024
1 parent afe0ba7 commit b90375b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions data/web/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
$vmail_df = explode(',', (string)json_decode(docker('post', 'dovecot-mailcow', 'exec', $exec_fields), true));

// containers
$containers = (array) docker('info');
if ($clamd_status === false) unset($containers['clamd-mailcow']);
if ($solr_status === false) unset($containers['solr-mailcow']);
ksort($containers);
foreach ($containers as $container => $container_info) {
$containers_info = (array) docker('info');
if ($clamd_status === false) unset($containers_info['clamd-mailcow']);
if ($solr_status === false) unset($containers_info['solr-mailcow']);
ksort($containers_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');
$StartedAt = date_parse($container_info['State']['StartedAt']);
if ($StartedAt['hour'] !== false) {
Expand All @@ -42,15 +46,15 @@
try {
$user_tz = new DateTimeZone(getenv('TZ'));
$date->setTimezone($user_tz);
$started = $date->format('r');
$container_info['State']['StartedAtHR'] = $date->format('r');
} catch(Exception $e) {
$started = '?';
$container_info['State']['StartedAtHR'] = '?';
}
}
else {
$started = '?';
$container_info['State']['StartedAtHR'] = '?';
}
$containers[$container]['State']['StartedAtHR'] = $started;
$containers[$container] = $container_info;
}

// get mailcow data
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ services:
- rspamd

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"
depends_on:
- redis-mailcow
Expand Down

0 comments on commit b90375b

Please sign in to comment.