Skip to content

Commit

Permalink
Fixes #692 Add custom supervisor configs
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Nov 22, 2020
1 parent c96f740 commit 8e7069f
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 1 deletion.
126 changes: 126 additions & 0 deletions .devilbox/www/htdocs/config_php.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?php require '../config.php'; ?>
<?php loadClass('Helper')->authPage(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>

<body>
<?php echo loadClass('Html')->getNavbar(); ?>

<div class="container">

<h1>PHP custom configs</h1>
<br/>
<br/>
<p>Shows your currently custom configuration files applied to the PHP-FPM container.</p>

<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Section</th>
<th>Host</th>
<th>Container</th>
<th>Files</th>
</tr>
</thead>
<tbody>
<tr>
<th>Supervisord</th>
<td>supervisor/</td>
<td>/etc/supervisor/custom.d/</td>
<td>
<?php
$files = glob('/etc/supervisor/custom.d/*.conf');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>Autostart (global)</th>
<td>autostart/</td>
<td>/startup.2.d/</td>
<td>
<?php
$files = glob('/startup.2.d/*.sh');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>Autostart (version)</th>
<td>cfg/php-startup-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
<td>/startup.1.d/</td>
<td>
<?php
$files = glob('/startup.1.d/*.sh');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>PHP-FPM</th>
<td>cfg/php-fpm-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
<td>/etc/php-fpm-custom.d/</td>
<td>
<?php
$files = glob('/etc/php-fpm-custom.d/*.conf');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>PHP</th>
<td>cfg/php-ini-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
<td>/etc/php-custom.d/</td>
<td>
<?php
$files = glob('/etc/php-custom.d/*.ini');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
</tbody>
</table>
</div>
</div>


</div><!-- /.container -->

<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>
9 changes: 9 additions & 0 deletions .devilbox/www/include/lib/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ class Html
'path' => '/mail.php'
)
),
array(
'name' => 'Configs',
'menu' => array(
array(
'name' => 'PHP',
'path' => '/config_php.php'
),
),
),
array(
'name' => 'Databases',
'menu' => array(
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
/mod/php-fpm-8.0/*.so
/mod/php-fpm-8.1/*.so

# Ignore supervisord configs
/supervisor/*.conf

# Ignore custom bash and other confi files
/bash/*
!/bash/bashrc.sh-example
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ services:
# PHP
# ------------------------------------------------------------
php:
image: devilbox/php-fpm:${PHP_SERVER}-work-0.116
image: devilbox/php-fpm:${PHP_SERVER}-work-0.117
hostname: php

##
Expand Down Expand Up @@ -204,6 +204,9 @@ services:
# Mount devilbox user-defined bash config
- ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d:rw${MOUNT_OPTIONS}

# Mount devilbox user-defined supervisord config
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}

# Certificate Authority public key
- ${DEVILBOX_PATH}/ca:/ca:rw${MOUNT_OPTIONS}

Expand Down
Empty file added supervisor/.keepme
Empty file.

0 comments on commit 8e7069f

Please sign in to comment.