devilbox/.devilbox/www/htdocs/index.php

552 lines
15 KiB
PHP
Raw Normal View History

2016-11-06 12:36:07 +00:00
<?php require '../config.php'; ?>
2017-04-19 17:48:44 +00:00
<?php $Docker = loadClass('Docker'); ?>
2016-10-09 16:47:49 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
2016-10-22 14:39:08 +00:00
<?php require '../include/head.php'; ?>
2016-10-09 16:47:49 +00:00
</head>
<body>
2016-11-15 18:39:11 +00:00
<?php require '../include/navbar.php'; ?>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<div class="container">
<div class="row">
<div class="col-md-12">
<img class="float-xs-left" src="/assets/img/devilbox_80.png" />
<h1 class="float-xs-left text-muted">The devilbox</h1>
2016-10-09 16:47:49 +00:00
</div>
</div>
2016-10-22 14:39:08 +00:00
<br/>
<hr/>
<br/>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<div class="row">
<div class="col-md-12">
<h2 class="text-xs-center">Docker setup</h2>
</div>
</div>
2016-10-09 16:47:49 +00:00
<br/>
<br/>
<div class="row">
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- HTTPD Docker Circle -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
2016-10-22 14:39:08 +00:00
<div class="circles">
<div>
<div class="bg-danger">
<div>
<div>
2016-11-06 12:36:07 +00:00
<h3><?php echo $Docker->HTTPD_version();?></h3>
2016-10-22 14:39:08 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- PHP Docker Circle -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
2016-10-22 14:39:08 +00:00
<div class="circles">
<div>
<div class="bg-info">
<div>
<div>
2016-11-06 12:36:07 +00:00
<h3><?php echo $Docker->PHP_version(); ?></h3>
2016-10-22 14:39:08 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- MySQL Docker Circle-->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
2016-10-22 14:39:08 +00:00
<div class="circles">
<div>
<div class="bg-warning">
<div>
<div>
2016-11-06 12:36:07 +00:00
<h3><?php echo $Docker->MySQL_version();?></h3>
2016-10-22 14:39:08 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
2016-11-15 18:39:11 +00:00
<!-- ############################################################ -->
<!-- PostgreSQL Docker Circle-->
<!-- ############################################################ -->
<div class="col-md-3">
<div class="circles">
<div>
<div class="bg-success">
<div>
<div>
<h3><?php echo $Docker->Postgres_version();?></h3>
</div>
</div>
</div>
</div>
</div>
</div>
2016-10-22 14:39:08 +00:00
</div>
<br/><br/>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<div class="row">
<!-- ############################################################ -->
<!-- HTTPD Docker -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
2016-10-22 14:39:08 +00:00
<thead class="thead-inverse">
2016-10-09 16:47:49 +00:00
<tr>
2016-11-15 18:39:11 +00:00
<th colspan="2">HTTPD docker</th>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</thead>
<tbody>
2016-10-09 16:47:49 +00:00
<tr>
2016-11-15 18:39:11 +00:00
<th>IP</th>
2016-10-22 14:39:08 +00:00
<td><?php echo $HTTPD_HOST_ADDR;?></td>
2016-10-09 16:47:49 +00:00
</tr>
2016-11-15 18:39:11 +00:00
<tr>
<th>Hostname</th>
<td><?php echo $HTTPD_HOST_NAME;?></td>
</tr>
2016-10-09 16:47:49 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th>Document Root</th>
<td>/shared/httpd</td>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</tbody>
</table>
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- PHP Docker -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
2016-10-22 14:39:08 +00:00
<thead class="thead-inverse">
2016-10-09 16:47:49 +00:00
<tr>
2016-11-15 18:39:11 +00:00
<th colspan="2">PHP docker</th>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</thead>
<tbody>
2016-10-09 16:47:49 +00:00
<tr>
2016-11-15 18:39:11 +00:00
<th>IP</th>
2016-10-22 14:39:08 +00:00
<td><?php echo $PHP_HOST_ADDR;?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-11-15 18:39:11 +00:00
<th>Hostname</th>
<td><?php echo $PHP_HOST_NAME;?></td>
</tr> <tr>
2016-10-22 14:39:08 +00:00
<th>Document Root</th>
<td>/shared/httpd</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-10-22 14:39:08 +00:00
<th>Custom config</th>
<td>
2016-11-06 12:36:07 +00:00
<?php foreach ($Docker->PHP_custom_config_files() as $file): ?>
<?php echo $file.'<br/>';?>
2016-10-22 14:39:08 +00:00
<?php endforeach; ?>
2016-10-09 16:47:49 +00:00
</td>
</tr>
<tr>
2017-04-19 17:48:44 +00:00
<?php $err=null; $valid = $Docker->PHP_has_valid_mysql_socket($err); ?>
2016-10-22 14:39:08 +00:00
<th>MySQL socket</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2017-04-19 17:48:44 +00:00
<?php echo !$valid ? 'Error<br/><sub>'.$err.'</sub>' : $Docker->getEnv('MYSQL_SOCKET_PATH'); ?>
2016-10-22 14:39:08 +00:00
</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2017-04-19 17:48:44 +00:00
<?php $err=null; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), 'localhost'); ?>
2016-10-22 14:39:08 +00:00
<th>MySQL test</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo $valid ? '<span class="bg-success">OK</span> localhost:3306' : 'Failed: localhost:3306<br/><sub>'.$err.'</sub>'; ?>
2016-10-22 14:39:08 +00:00
</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2017-04-19 17:48:44 +00:00
<?php $err=null; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), '127.0.0.1'); ?>
2016-10-22 14:39:08 +00:00
<th>MySQL test</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo $valid ? '<span class="bg-success">OK</span> 127.0.0.1:3306' : 'Failed: 127.0.0.1:3306<br/><sub>'.$err.'</sub>'; ?>
2016-10-22 14:39:08 +00:00
</td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2017-04-19 17:48:44 +00:00
<?php $err=null; $valid = \devilbox\Mysql::testConnection($err, 'root', $Docker->getEnv('MYSQL_ROOT_PASSWORD'), $MYSQL_HOST_ADDR); ?>
2016-10-22 14:39:08 +00:00
<th>MySQL test</th>
<td class="<?php echo !$valid ? 'bg-danger' : '';?>">
2016-10-25 19:13:23 +00:00
<?php echo $valid ? '<span class="bg-success">OK</span> '.$MYSQL_HOST_ADDR.':3306' : 'Failed: '.$MYSQL_HOST_ADDR.':3306<br/><sub>'.$err.'</sub>'; ?>
2016-10-09 16:47:49 +00:00
</td>
</tr>
2016-10-22 14:39:08 +00:00
<tr>
<th>Postfix</th>
2016-11-06 12:36:07 +00:00
<td><?php echo $Docker->getEnv('ENABLE_MAIL') ? '<span class="bg-success">OK</span> Enabled' : '<span class="bg-danger">No</span> Disabled';?></td>
</tr>
2016-10-22 14:39:08 +00:00
2016-10-16 18:08:56 +00:00
<tr>
2016-10-22 14:39:08 +00:00
<th>Xdebug enabled</th>
2016-10-16 18:08:56 +00:00
<td>
2016-11-06 12:36:07 +00:00
<?php $Xdebug = ($Docker->getEnv('PHP_XDEBUG_ENABLE') == 0) ? '' : $Docker->getEnv('PHP_XDEBUG_ENABLE'); ?>
<?php if ($Xdebug == $Docker->PHP_config('xdebug.remote_enable')): ?>
<?php echo $Docker->PHP_config('xdebug.remote_enable') == 1 ? 'Yes' : 'No'; ?>
2016-10-16 18:08:56 +00:00
<?php else: ?>
<?php echo '.env file setting differs from custom php .ini file<br/>'; ?>
2016-11-06 12:36:07 +00:00
<?php echo 'Effective setting: '.$Docker->PHP_config('xdebug.remote_enable'); ?>
2016-10-16 18:08:56 +00:00
<?php endif; ?>
</td>
</tr>
2016-11-06 12:36:07 +00:00
<?php if ($Xdebug):?>
<tr>
<th>Xdebug remote</th>
<td>
<?php if ($Docker->getEnv('PHP_XDEBUG_REMOTE_HOST') == $Docker->PHP_config('xdebug.remote_host')): ?>
<?php echo $Docker->PHP_config('xdebug.remote_host'); ?>
<?php else: ?>
<?php echo '.env file setting differs from custom php .ini file<br/>'; ?>
<?php echo 'Effective setting: '.$Docker->PHP_config('xdebug.remote_host'); ?>
<?php endif; ?>
</td>
</tr>
<tr>
<th>Xdebug Port</th>
<td>
<?php if ($Docker->getEnv('PHP_XDEBUG_REMOTE_PORT') == $Docker->PHP_config('xdebug.remote_port')): ?>
<?php echo $Docker->PHP_config('xdebug.remote_port'); ?>
<?php else: ?>
<?php echo '.env file setting differs from custom php .ini file<br/>'; ?>
<?php echo 'Effective setting: '.$Docker->PHP_config('xdebug.remote_port'); ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
</tbody>
</table>
</div>
<!-- ############################################################ -->
<!-- MySQL Docker -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
2016-10-22 14:39:08 +00:00
<thead class="thead-inverse">
2016-10-09 16:47:49 +00:00
<tr>
2016-11-15 18:39:11 +00:00
<th colspan="2">MySQL docker</th>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</thead>
<tbody>
2016-10-09 16:47:49 +00:00
<tr>
2016-11-15 18:39:11 +00:00
<th>IP</th>
<td><?php echo $MYSQL_HOST_ADDR;?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-11-15 18:39:11 +00:00
<th>Hostname</th>
<td><?php echo $MYSQL_HOST_NAME;?></td>
</tr>
<tr>
<th>socket</th>
2016-11-06 12:36:07 +00:00
<td><?php echo $Docker->MySQL_config('socket'); ?></td>
2016-10-09 16:47:49 +00:00
</tr>
<tr>
2016-11-15 18:39:11 +00:00
<th>datadir</th>
2016-11-06 12:36:07 +00:00
<td><?php echo $Docker->MySQL_config('datadir'); ?></td>
2016-10-09 16:47:49 +00:00
</tr>
2016-10-22 14:39:08 +00:00
</tbody>
</table>
</div>
2016-11-15 18:39:11 +00:00
<!-- ############################################################ -->
<!-- PostgreSQL Docker -->
<!-- ############################################################ -->
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
<thead class="thead-inverse">
<tr>
<th colspan="2">PostgreSQL docker</th>
</tr>
</thead>
<tbody>
<tr>
<th>IP</th>
<td><?php echo $POSTGRES_HOST_ADDR;?></td>
</tr>
<tr>
<th>Hostname</th>
<td><?php echo $POSTGRES_HOST_NAME;?></td>
</tr>
<tr>
<th>socket</th>
<td><?php
$dir = $Docker->Postgres_config('unix_socket_directory');
if (empty($dir)) {
// Postgres 9.6
$dir = $Docker->Postgres_config('unix_socket_directories');
}
echo $dir;
?></td>
</tr>
<tr>
<th>datadir</th>
<td><?php echo $Docker->Postgres_config('data_directory'); ?></td>
</tr>
</tbody>
</table>
</div>
2016-10-22 14:39:08 +00:00
</div>
2016-10-09 16:47:49 +00:00
2017-04-23 11:20:32 +00:00
<!-- ################################################################################ -->
<!-- ### -->
<!-- ### OPTIONAL DOCKER CONTAINER MOUNTS-->
<!-- ### -->
<!-- ################################################################################ -->
<?php if ($Docker->getEnv('COMPOSE_OPTIONAL') == 1): ?>
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<h2 class="text-xs-center">Additional Docker container</h2>
</div>
</div>
<br/>
<br/>
<div class="row">
<!-- ############################################################ -->
<!-- Redis Docker Circle -->
<!-- ############################################################ -->
<div class="col-md-3">
<div class="circles">
<div>
<div class="bg-danger">
<div>
<div>
<h3><?php echo loadClass('Redis')->getVersion();?></h3>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="row">
<!-- ############################################################ -->
<!-- Redis Docker -->
<!-- ############################################################ -->
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
<thead class="thead-inverse">
<tr>
<th colspan="2">Redis docker</th>
</tr>
</thead>
<tbody>
<tr>
<th>IP</th>
<td><?php echo gethostbyname('redis');?></td>
</tr>
<tr>
<th>Hostname</th>
<td><?php echo 'redis';?></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endif; ?>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<br/>
<br/>
<div class="row">
<div class="col-md-12">
<h2 class="text-xs-center">Docker to Host mounts</h2>
</div>
</div>
<br/>
<br/>
<div class="row">
<!-- ############################################################ -->
<!-- HTTPD Docker Mounts -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
2016-10-22 14:39:08 +00:00
<thead class="thead-inverse">
<tr>
2016-11-15 18:39:11 +00:00
<th>HTTPD docker</th>
2016-10-22 14:39:08 +00:00
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>Document Root</th>
2016-11-06 12:36:07 +00:00
<td><?php echo $Docker->getEnv('HOST_PATH_TO_WWW_DOCROOTS');?></td>
2016-10-22 14:39:08 +00:00
</tr>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
2016-10-09 16:47:49 +00:00
</tbody>
</table>
2016-10-22 14:39:08 +00:00
</div>
2016-10-09 16:47:49 +00:00
2016-10-22 14:39:08 +00:00
<!-- ############################################################ -->
<!-- PHP Docker Mounts -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
2016-10-22 14:39:08 +00:00
<thead class="thead-inverse">
<tr>
2016-11-15 18:39:11 +00:00
<th>PHP docker</th>
2016-10-22 14:39:08 +00:00
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>Document Root</th>
2016-11-06 12:36:07 +00:00
<td><?php echo $Docker->getEnv('HOST_PATH_TO_WWW_DOCROOTS');?></td>
2016-10-22 14:39:08 +00:00
</tr>
<tr>
<th>Custom config</th>
<td>./etc</td>
</tr>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
</tbody>
</table>
</div>
<!-- ############################################################ -->
<!-- MySQL Docker Mounts -->
<!-- ############################################################ -->
2016-11-15 18:39:11 +00:00
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
2016-10-22 14:39:08 +00:00
<thead class="thead-inverse">
<tr>
2016-11-15 18:39:11 +00:00
<th>MySQL docker</th>
2016-10-22 14:39:08 +00:00
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>MySQL datadir</th>
2016-11-06 12:36:07 +00:00
<td><?php echo $Docker->getEnv('HOST_PATH_TO_MYSQL_DATADIR');?></td>
2016-10-22 14:39:08 +00:00
</tr>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
</tbody>
</table>
</div>
2016-10-09 16:47:49 +00:00
2016-11-15 18:39:11 +00:00
<!-- ############################################################ -->
<!-- PostgreSQL Docker Mounts -->
<!-- ############################################################ -->
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
<thead class="thead-inverse">
<tr>
<th>Postgres docker</th>
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>Postgres datadir</th>
<td><?php echo $Docker->getEnv('HOST_PATH_TO_POSTGRES_DATADIR');?></td>
</tr>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
</tbody>
</table>
</div>
2016-10-22 14:39:08 +00:00
</div>
2016-10-09 16:47:49 +00:00
2017-04-23 11:20:32 +00:00
<!-- ################################################################################ -->
<!-- ### -->
<!-- ### OPTIONAL DOCKER CONTAINER MOUNTS-->
<!-- ### -->
<!-- ################################################################################ -->
<?php if ($Docker->getEnv('COMPOSE_OPTIONAL') == 1): ?>
<div class="row">
<!-- ############################################################ -->
<!-- Redis Docker Mounts -->
<!-- ############################################################ -->
<div class="col-md-3">
<table class="table table-striped table-sm font-small">
<thead class="thead-inverse">
<tr>
<th>Redis docker</th>
<th>host</th>
</tr>
</thead>
<tbody>
<tr>
<th>Log directory</th>
<td>./log</td>
</tr>
</tbody>
</table>
</div>
2017-04-23 12:08:54 +00:00
</div>
2017-04-23 11:20:32 +00:00
<?php endif; ?>
2016-10-09 16:47:49 +00:00
</div><!-- /.container -->
<?php require '../include/footer.php'; ?>
<script>
// self executing function here
(function() {
// your page initialization code here
// the DOM will be available here
})();
</script>
2016-10-09 16:47:49 +00:00
</body>
</html>