2017-12-09 20:17:15 +08:00
|
|
|
<?php
|
2018-10-11 17:59:23 +08:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
2017-12-09 20:17:15 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
if (!isset($_SESSION['mailcow_cc_role']) || $_SESSION['mailcow_cc_role'] != "admin") {
|
|
|
|
header('Location: /');
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2018-10-11 17:59:23 +08:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
|
2017-12-09 20:17:15 +08:00
|
|
|
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
|
2020-01-11 18:00:56 +08:00
|
|
|
$solr_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_SOLR"])) ? false : solr_status();
|
2020-01-11 18:22:08 +08:00
|
|
|
$clamd_status = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["SKIP_CLAMD"])) ? false : true;
|
2017-12-09 20:17:15 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
$js_minifier->add('/web/js/site/debug.js');
|
2017-12-09 20:17:15 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
// vmail df
|
|
|
|
$exec_fields = array('cmd' => 'system', 'task' => 'df', 'dir' => '/var/vmail');
|
|
|
|
$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) {
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
$StartedAt = date_parse($container_info['State']['StartedAt']);
|
|
|
|
if ($StartedAt['hour'] !== false) {
|
|
|
|
$date = new \DateTime();
|
|
|
|
$date->setTimestamp(mktime(
|
|
|
|
$StartedAt['hour'],
|
|
|
|
$StartedAt['minute'],
|
|
|
|
$StartedAt['second'],
|
|
|
|
$StartedAt['month'],
|
|
|
|
$StartedAt['day'],
|
|
|
|
$StartedAt['year']));
|
|
|
|
$user_tz = new DateTimeZone(getenv('TZ'));
|
|
|
|
$date->setTimezone($user_tz);
|
|
|
|
$started = $date->format('r');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$started = '?';
|
|
|
|
}
|
|
|
|
$containers[$container]['State']['StartedAtHR'] = $started;
|
|
|
|
}
|
2017-12-09 20:17:15 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
$template = 'debug.twig';
|
|
|
|
$template_data = [
|
|
|
|
'log_lines' => getenv('LOG_LINES'),
|
|
|
|
'vmail_df' => $vmail_df,
|
|
|
|
'solr_status' => $solr_status,
|
|
|
|
'solr_uptime' => round($solr_status['status']['dovecot-fts']['uptime'] / 1000 / 60 / 60),
|
|
|
|
'clamd_status' => $clamd_status,
|
|
|
|
'containers' => $containers,
|
|
|
|
'lang_admin' => json_encode($lang['admin']),
|
|
|
|
];
|
2017-12-09 20:17:15 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|
2018-12-16 04:24:39 +08:00
|
|
|
|
2019-10-03 01:23:09 +08:00
|
|
|
|