Skip to content

Commit 10b20c0

Browse files
authored
Merge pull request #944 from cytopia/release/v3.0.0-beta-0.3
Release/v3.0.0 beta 0.3
2 parents 81c9bb0 + 1c21430 commit 10b20c0

26 files changed

+1020
-653
lines changed

Diff for: .devilbox/www/config.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');
1414

1515

16-
$DEVILBOX_VERSION = 'v3.0.0-beta-0.2';
17-
$DEVILBOX_DATE = '2022-12-27';
16+
$DEVILBOX_VERSION = 'v3.0.0-beta-0.3';
17+
$DEVILBOX_DATE = '2023-01-02';
1818
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';
1919

2020
//

Diff for: .devilbox/www/htdocs/_ajax_callback.php

+5
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@
150150
$_GET['software'] => (($version = loadClass('Php')->getWpcliVersion()) !== false) ? $version : $no
151151
));
152152
}
153+
else if ($_GET['software'] == 'wscat') {
154+
echo json_encode(array(
155+
$_GET['software'] => (($version = loadClass('Php')->getWscatVersion()) !== false) ? $version : $no
156+
));
157+
}
153158
else if ($_GET['software'] == 'yarn') {
154159
echo json_encode(array(
155160
$_GET['software'] => (($version = loadClass('Php')->getYarnVersion()) !== false) ? $version : $no

Diff for: .devilbox/www/htdocs/cnc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function run_supervisor_command($command) {
6565
);
6666
?>
6767
<h3>Daemon overview</h3><br/>
68-
<p>If you made a change to any vhost settings, you can trigger a manual reload here.</p>
68+
<p>If you made any changes to vhost settings (vhost-gen templates or backend configuration) or to the webserver configuration itself, you can trigger a manual reload of <code>watcherd</code> here to apply them. No need to restart the Docker Compose stack.</p>
6969
<table class="table table-striped">
7070
<thead class="thead-inverse">
7171
<tr>

Diff for: .devilbox/www/htdocs/index.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
</thead>
346346
<tbody>
347347
<tr>
348-
<th>Angular Cli</th>
348+
<th style="width: 50%;">Angular Cli</th>
349349
<td id="app_angular_cli"></td>
350350
</tr>
351351
<tr>
@@ -428,6 +428,10 @@
428428
<th>Wordpress Cli</th>
429429
<td id="app_wpcli"></td>
430430
</tr>
431+
<tr>
432+
<th>Wscat</th>
433+
<td id="app_wscat"></td>
434+
</tr>
431435
<tr>
432436
<th>Yarn</th>
433437
<td id="app_yarn"></td>
@@ -970,6 +974,7 @@ function updateVersions(app) {
970974
updateVersions('vue_cli');
971975
updateVersions('webpack_cli');
972976
updateVersions('wpcli');
977+
updateVersions('wscat');
973978
updateVersions('yarn');
974979
})();
975980
</script>

Diff for: .devilbox/www/htdocs/info_vhostgen.php

-66
This file was deleted.

Diff for: .devilbox/www/htdocs/support.php

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
<td><i class="fa fa-github-alt" aria-hidden="true"></i> <a target="_blank" href="https://github.com/devilbox/docker-php-fpm-8.2">docker-php-fpm-8.2</a></td>
6767
<td>PHP 8.2 base images (<code>amd64</code> and <code>arm64</code>)</td>
6868
</tr>
69+
<tr>
70+
<td><i class="fa fa-github-alt" aria-hidden="true"></i> <a target="_blank" href="https://github.com/devilbox/docker-php-fpm-8.3">docker-php-fpm-8.3</a></td>
71+
<td>PHP 8.3 base images (<code>amd64</code> and <code>arm64</code>)</td>
72+
</tr>
6973
<tr>
7074
<td><i class="fa fa-github-alt" aria-hidden="true"></i> <a target="_blank" href="https://github.com/devilbox/docker-php-fpm">docker-php-fpm</a></td>
7175
<td>PHP-FPM Devilbox images (<code>amd64</code> and <code>arm64</code>)</td>

Diff for: .devilbox/www/htdocs/vhosts.php

+76-9
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<th>DocumentRoot</th>
2727
<th>Backend</th>
2828
<th>Config</th>
29-
<th>Valid</th>
30-
<th>URL</th>
29+
<th style="width:60px;">Valid</th>
30+
<th style="width:260px;">URL</th>
3131
</tr>
3232
</thead>
3333
<tbody>
@@ -37,15 +37,82 @@
3737
<td><?php echo loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR');?>/<?php echo $vHost['name'];?>/<?php echo loadClass('Helper')->getEnv('HTTPD_DOCROOT_DIR');?></td>
3838
<td><?php echo loadClass('Httpd')->getVhostBackend($vHost['name']); ?></td>
3939
<td>
40-
<a title="Virtual host: <?php echo $vHost['name'];?>.conf" target="_blank" href="/vhost.d/<?php echo $vHost['name'];?>.conf"><i class="fa fa-cog" aria-hidden="true"></i></a>
41-
<?php if (($vhostGen = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
42-
<a title="vhost-gen: <?php echo basename($vhostGen);?> for <?php echo $vHost['name'];?>" href="/info_vhostgen.php?name=<?php echo $vHost['name'];?>">
43-
<i class="fa fa-filter" aria-hidden="true"></i>
44-
</a>
40+
<?php $id_vhost_httpd = str_replace('=', '', base64_encode('vhost_httpd_conf_' . $vHost['name'])); ?>
41+
<?php $id_vhost_vhostgen = str_replace('=', '', base64_encode('vhost_vhost_gen_' . $vHost['name'])); ?>
42+
43+
<!-- [httpd.conf] Button trigger modal -->
44+
<a href="#"><i class="fa fa-cog" aria-hidden="true" data-toggle="modal" data-target="#<?php echo $id_vhost_httpd;?>"></i></a>
45+
<!-- [httpd.conf] Modal -->
46+
<div class="modal" id="<?php echo $id_vhost_httpd;?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $id_vhost_httpd;?>Label" aria-hidden="true">
47+
<div class="modal-dialog modal-lg" role="document">
48+
<div class="modal-content">
49+
<div class="modal-header">
50+
<h5 class="modal-title" id="<?php echo $id_vhost_httpd;?>Label"><?php echo '<strong>httpd.conf: </strong><code>'.$vHost['name'].'.'.loadClass('Httpd')->getTldSuffix(). '</code>'; ?></h5>
51+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
52+
<span aria-hidden="true">&times;</span>
53+
</button>
54+
</div>
55+
<div class="modal-body">
56+
<?php $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]"; ?>
57+
<?php $src = file_get_contents($url.'/vhost.d/' . $vHost['name'] . '.conf'); ?>
58+
<?php //$src = htmlentities($src); ?>
59+
<?php $src = str_replace('<', '&lt;', $src); ?>
60+
<?php $src = str_replace('>', '&gt;', $src); ?>
61+
<?php $src = preg_replace('/&lt;(\/?.*)&gt;/m', '<strong>&lt;\1&gt;</strong>', $src); // Apache directives ?>
62+
<?php $src = preg_replace('/(.*{\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
63+
<?php $src = preg_replace('/^(\s*}\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
64+
<?php //$src = preg_replace('/"(.+)"/m', '<span style="color: blue;">"\1"</span>', $src); ?>
65+
<?php $src = preg_replace('/^(\s*(?!<#)[^#"]*)"(.*)"/m', '\1<span style="color: blue;">"\2"</span>', $src); // double quotes?>
66+
<?php $src = preg_replace("/^(\s*(?!<#)[^#']*)'(.*)'/m", '\1<span style="color: blue;">"\2"</span>', $src); // single quotes ?>
67+
<?php $src = preg_replace('/^(\s*#)(.*)$/m', '<span style="color: gray;">\1\2</span>', $src); // comments ?>
68+
<?php echo '<pre><code>' . $src . '</code></pre>';?>
69+
</div>
70+
<div class="modal-footer">
71+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
72+
</div>
73+
</div>
74+
</div>
75+
</div>
76+
<?php if (($vhostGenPath = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
77+
<!-- [vhost-gen] Button trigger modal -->
78+
<a href="#"><i class="fa fa-filter" aria-hidden="true" data-toggle="modal" data-target="#<?php echo $id_vhost_vhostgen;?>"></i></a>
79+
<!-- [vhost-gen] Modal -->
80+
<div class="modal" id="<?php echo $id_vhost_vhostgen;?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $id_vhost_vhostgen;?>Label" aria-hidden="true">
81+
<div class="modal-dialog modal-lg" role="document">
82+
<div class="modal-content">
83+
<div class="modal-header">
84+
<h5 class="modal-title" id="<?php echo $id_vhost_vhostgen;?>Label"><?php echo '<code>'.$vhostGenPath.'</code>'; ?></h5>
85+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
86+
<span aria-hidden="true">&times;</span>
87+
</button>
88+
</div>
89+
<div class="modal-body">
90+
<?php $src = file_get_contents($vhostGenPath); ?>
91+
<?php //$src = htmlentities($src); ?>
92+
<?php $src = str_replace('<', '&lt;', $src); ?>
93+
<?php $src = str_replace('>', '&gt;', $src); ?>
94+
<?php $src = preg_replace('/&lt;(\/?.*)&gt;/m', '<strong>&lt;\1&gt;</strong>', $src); // Apache directives ?>
95+
<?php $src = preg_replace('/(.*{\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
96+
<?php $src = preg_replace('/^(\s*}\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
97+
<?php //$src = preg_replace('/"(.+)"/m', '<span style="color: blue;">"\1"</span>', $src); ?>
98+
<?php //$src = preg_replace("/'(.+)'/m", '<span style="color: blue;">'."'".'\1'."'".'</span>', $src); ?>
99+
<?php $src = preg_replace('/^(\s*(?!<#)[^#"]*)"(.*)"/m', '\1<span style="color: blue;">"\2"</span>', $src); // double quotes ?>
100+
<?php $src = preg_replace("/^(\s*(?!<#)[^#']*)'(.*)'/m", '\1<span style="color: blue;">"\2"</span>', $src); // single quotes ?>
101+
<?php $src = preg_replace('/^(\s*#)(.*)$/m', '<span style="color: gray;">\1\2</span>', $src); // comments ?>
102+
<?php $src = preg_replace('/^(\s*[_a-z]+):/m', '<span style="color: green;"><strong>\1</strong></span>:', $src); // yaml keys ?>
103+
<?php $src = preg_replace('/(__[_A-Z]+__)/m', '<span style="color: red;">\1</span>', $src); // variables ?>
104+
<?php echo '<pre><code>' . $src . '</code></pre>';?>
105+
</div>
106+
<div class="modal-footer">
107+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
108+
</div>
109+
</div>
110+
</div>
111+
</div>
45112
<?php endif; ?>
46113
</td>
47-
<td style="min-width:60px;" class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>"></td>
48-
<td style="min-width:260px;" id="href-<?php echo $vHost['name'];?>"></td>
114+
<td class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>"></td>
115+
<td id="href-<?php echo $vHost['name'];?>"></td>
49116
</tr>
50117
<input type="hidden" name="vhost[]" class="vhost" value="<?php echo $vHost['name'];?>" />
51118
<?php endforeach; ?>

Diff for: .devilbox/www/include/lib/container/Php.php

+5
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ public function getWpcliVersion()
140140
$output = loadClass('Helper')->exec('wp --version 2>/dev/null | grep -i ^WP', $output);
141141
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
142142
}
143+
public function getWscatVersion()
144+
{
145+
$output = loadClass('Helper')->exec('wscat --version 2>/dev/null | head -1', $output);
146+
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
147+
}
143148
public function getYarnVersion()
144149
{
145150
$output = loadClass('Helper')->exec('yarn --version 2>/dev/null', $output);

0 commit comments

Comments
 (0)