Skip to content

Commit 8e7069f

Browse files
committed
Fixes #692 Add custom supervisor configs
1 parent c96f740 commit 8e7069f

File tree

5 files changed

+142
-1
lines changed

5 files changed

+142
-1
lines changed

.devilbox/www/htdocs/config_php.php

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?php require '../config.php'; ?>
2+
<?php loadClass('Helper')->authPage(); ?>
3+
<!DOCTYPE html>
4+
<html lang="en">
5+
<head>
6+
<?php echo loadClass('Html')->getHead(); ?>
7+
</head>
8+
9+
<body>
10+
<?php echo loadClass('Html')->getNavbar(); ?>
11+
12+
<div class="container">
13+
14+
<h1>PHP custom configs</h1>
15+
<br/>
16+
<br/>
17+
<p>Shows your currently custom configuration files applied to the PHP-FPM container.</p>
18+
19+
<div class="row">
20+
<div class="col-md-12">
21+
<table class="table table-striped">
22+
<thead class="thead-inverse">
23+
<tr>
24+
<th>Section</th>
25+
<th>Host</th>
26+
<th>Container</th>
27+
<th>Files</th>
28+
</tr>
29+
</thead>
30+
<tbody>
31+
<tr>
32+
<th>Supervisord</th>
33+
<td>supervisor/</td>
34+
<td>/etc/supervisor/custom.d/</td>
35+
<td>
36+
<?php
37+
$files = glob('/etc/supervisor/custom.d/*.conf');
38+
if ($files) {
39+
foreach ($files as $file) {
40+
echo '<code>'.basename($file). '</code><br/>';
41+
}
42+
} else {
43+
echo 'No custom files';
44+
}
45+
?>
46+
</td>
47+
</tr>
48+
<tr>
49+
<th>Autostart (global)</th>
50+
<td>autostart/</td>
51+
<td>/startup.2.d/</td>
52+
<td>
53+
<?php
54+
$files = glob('/startup.2.d/*.sh');
55+
if ($files) {
56+
foreach ($files as $file) {
57+
echo '<code>'.basename($file). '</code><br/>';
58+
}
59+
} else {
60+
echo 'No custom files';
61+
}
62+
?>
63+
</td>
64+
</tr>
65+
<tr>
66+
<th>Autostart (version)</th>
67+
<td>cfg/php-startup-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
68+
<td>/startup.1.d/</td>
69+
<td>
70+
<?php
71+
$files = glob('/startup.1.d/*.sh');
72+
if ($files) {
73+
foreach ($files as $file) {
74+
echo '<code>'.basename($file). '</code><br/>';
75+
}
76+
} else {
77+
echo 'No custom files';
78+
}
79+
?>
80+
</td>
81+
</tr>
82+
<tr>
83+
<th>PHP-FPM</th>
84+
<td>cfg/php-fpm-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
85+
<td>/etc/php-fpm-custom.d/</td>
86+
<td>
87+
<?php
88+
$files = glob('/etc/php-fpm-custom.d/*.conf');
89+
if ($files) {
90+
foreach ($files as $file) {
91+
echo '<code>'.basename($file). '</code><br/>';
92+
}
93+
} else {
94+
echo 'No custom files';
95+
}
96+
?>
97+
</td>
98+
</tr>
99+
<tr>
100+
<th>PHP</th>
101+
<td>cfg/php-ini-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
102+
<td>/etc/php-custom.d/</td>
103+
<td>
104+
<?php
105+
$files = glob('/etc/php-custom.d/*.ini');
106+
if ($files) {
107+
foreach ($files as $file) {
108+
echo '<code>'.basename($file). '</code><br/>';
109+
}
110+
} else {
111+
echo 'No custom files';
112+
}
113+
?>
114+
</td>
115+
</tr>
116+
</tbody>
117+
</table>
118+
</div>
119+
</div>
120+
121+
122+
</div><!-- /.container -->
123+
124+
<?php echo loadClass('Html')->getFooter(); ?>
125+
</body>
126+
</html>

.devilbox/www/include/lib/Html.php

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ class Html
2323
'path' => '/mail.php'
2424
)
2525
),
26+
array(
27+
'name' => 'Configs',
28+
'menu' => array(
29+
array(
30+
'name' => 'PHP',
31+
'path' => '/config_php.php'
32+
),
33+
),
34+
),
2635
array(
2736
'name' => 'Databases',
2837
'menu' => array(

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@
137137
/mod/php-fpm-8.0/*.so
138138
/mod/php-fpm-8.1/*.so
139139

140+
# Ignore supervisord configs
141+
/supervisor/*.conf
142+
140143
# Ignore custom bash and other confi files
141144
/bash/*
142145
!/bash/bashrc.sh-example

docker-compose.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ services:
9595
# PHP
9696
# ------------------------------------------------------------
9797
php:
98-
image: devilbox/php-fpm:${PHP_SERVER}-work-0.116
98+
image: devilbox/php-fpm:${PHP_SERVER}-work-0.117
9999
hostname: php
100100

101101
##
@@ -204,6 +204,9 @@ services:
204204
# Mount devilbox user-defined bash config
205205
- ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d:rw${MOUNT_OPTIONS}
206206

207+
# Mount devilbox user-defined supervisord config
208+
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
209+
207210
# Certificate Authority public key
208211
- ${DEVILBOX_PATH}/ca:/ca:rw${MOUNT_OPTIONS}
209212

supervisor/.keepme

Whitespace-only changes.

0 commit comments

Comments
 (0)