Skip to content

Commit

Permalink
Merge pull request #944 from cytopia/release/v3.0.0-beta-0.3
Browse files Browse the repository at this point in the history
Release/v3.0.0 beta 0.3
  • Loading branch information
cytopia committed Jan 3, 2023
2 parents 81c9bb0 + 1c21430 commit 10b20c0
Show file tree
Hide file tree
Showing 26 changed files with 1,020 additions and 653 deletions.
4 changes: 2 additions & 2 deletions .devilbox/www/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');


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

//
Expand Down
5 changes: 5 additions & 0 deletions .devilbox/www/htdocs/_ajax_callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
$_GET['software'] => (($version = loadClass('Php')->getWpcliVersion()) !== false) ? $version : $no
));
}
else if ($_GET['software'] == 'wscat') {
echo json_encode(array(
$_GET['software'] => (($version = loadClass('Php')->getWscatVersion()) !== false) ? $version : $no
));
}
else if ($_GET['software'] == 'yarn') {
echo json_encode(array(
$_GET['software'] => (($version = loadClass('Php')->getYarnVersion()) !== false) ? $version : $no
Expand Down
2 changes: 1 addition & 1 deletion .devilbox/www/htdocs/cnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function run_supervisor_command($command) {
);
?>
<h3>Daemon overview</h3><br/>
<p>If you made a change to any vhost settings, you can trigger a manual reload here.</p>
<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>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
Expand Down
7 changes: 6 additions & 1 deletion .devilbox/www/htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
</thead>
<tbody>
<tr>
<th>Angular Cli</th>
<th style="width: 50%;">Angular Cli</th>
<td id="app_angular_cli"></td>
</tr>
<tr>
Expand Down Expand Up @@ -428,6 +428,10 @@
<th>Wordpress Cli</th>
<td id="app_wpcli"></td>
</tr>
<tr>
<th>Wscat</th>
<td id="app_wscat"></td>
</tr>
<tr>
<th>Yarn</th>
<td id="app_yarn"></td>
Expand Down Expand Up @@ -970,6 +974,7 @@ function updateVersions(app) {
updateVersions('vue_cli');
updateVersions('webpack_cli');
updateVersions('wpcli');
updateVersions('wscat');
updateVersions('yarn');
})();
</script>
Expand Down
66 changes: 0 additions & 66 deletions .devilbox/www/htdocs/info_vhostgen.php

This file was deleted.

4 changes: 4 additions & 0 deletions .devilbox/www/htdocs/support.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
<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>
<td>PHP 8.2 base images (<code>amd64</code> and <code>arm64</code>)</td>
</tr>
<tr>
<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>
<td>PHP 8.3 base images (<code>amd64</code> and <code>arm64</code>)</td>
</tr>
<tr>
<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>
<td>PHP-FPM Devilbox images (<code>amd64</code> and <code>arm64</code>)</td>
Expand Down
85 changes: 76 additions & 9 deletions .devilbox/www/htdocs/vhosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<th>DocumentRoot</th>
<th>Backend</th>
<th>Config</th>
<th>Valid</th>
<th>URL</th>
<th style="width:60px;">Valid</th>
<th style="width:260px;">URL</th>
</tr>
</thead>
<tbody>
Expand All @@ -37,15 +37,82 @@
<td><?php echo loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR');?>/<?php echo $vHost['name'];?>/<?php echo loadClass('Helper')->getEnv('HTTPD_DOCROOT_DIR');?></td>
<td><?php echo loadClass('Httpd')->getVhostBackend($vHost['name']); ?></td>
<td>
<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>
<?php if (($vhostGen = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
<a title="vhost-gen: <?php echo basename($vhostGen);?> for <?php echo $vHost['name'];?>" href="/info_vhostgen.php?name=<?php echo $vHost['name'];?>">
<i class="fa fa-filter" aria-hidden="true"></i>
</a>
<?php $id_vhost_httpd = str_replace('=', '', base64_encode('vhost_httpd_conf_' . $vHost['name'])); ?>
<?php $id_vhost_vhostgen = str_replace('=', '', base64_encode('vhost_vhost_gen_' . $vHost['name'])); ?>

<!-- [httpd.conf] Button trigger modal -->
<a href="#"><i class="fa fa-cog" aria-hidden="true" data-toggle="modal" data-target="#<?php echo $id_vhost_httpd;?>"></i></a>
<!-- [httpd.conf] Modal -->
<div class="modal" id="<?php echo $id_vhost_httpd;?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $id_vhost_httpd;?>Label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<?php $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]"; ?>
<?php $src = file_get_contents($url.'/vhost.d/' . $vHost['name'] . '.conf'); ?>
<?php //$src = htmlentities($src); ?>
<?php $src = str_replace('<', '&lt;', $src); ?>
<?php $src = str_replace('>', '&gt;', $src); ?>
<?php $src = preg_replace('/&lt;(\/?.*)&gt;/m', '<strong>&lt;\1&gt;</strong>', $src); // Apache directives ?>
<?php $src = preg_replace('/(.*{\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
<?php $src = preg_replace('/^(\s*}\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
<?php //$src = preg_replace('/"(.+)"/m', '<span style="color: blue;">"\1"</span>', $src); ?>
<?php $src = preg_replace('/^(\s*(?!<#)[^#"]*)"(.*)"/m', '\1<span style="color: blue;">"\2"</span>', $src); // double quotes?>
<?php $src = preg_replace("/^(\s*(?!<#)[^#']*)'(.*)'/m", '\1<span style="color: blue;">"\2"</span>', $src); // single quotes ?>
<?php $src = preg_replace('/^(\s*#)(.*)$/m', '<span style="color: gray;">\1\2</span>', $src); // comments ?>
<?php echo '<pre><code>' . $src . '</code></pre>';?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php if (($vhostGenPath = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
<!-- [vhost-gen] Button trigger modal -->
<a href="#"><i class="fa fa-filter" aria-hidden="true" data-toggle="modal" data-target="#<?php echo $id_vhost_vhostgen;?>"></i></a>
<!-- [vhost-gen] Modal -->
<div class="modal" id="<?php echo $id_vhost_vhostgen;?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $id_vhost_vhostgen;?>Label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="<?php echo $id_vhost_vhostgen;?>Label"><?php echo '<code>'.$vhostGenPath.'</code>'; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<?php $src = file_get_contents($vhostGenPath); ?>
<?php //$src = htmlentities($src); ?>
<?php $src = str_replace('<', '&lt;', $src); ?>
<?php $src = str_replace('>', '&gt;', $src); ?>
<?php $src = preg_replace('/&lt;(\/?.*)&gt;/m', '<strong>&lt;\1&gt;</strong>', $src); // Apache directives ?>
<?php $src = preg_replace('/(.*{\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
<?php $src = preg_replace('/^(\s*}\s*)$/m', '<strong>\1</strong>', $src); // Nginx directives ?>
<?php //$src = preg_replace('/"(.+)"/m', '<span style="color: blue;">"\1"</span>', $src); ?>
<?php //$src = preg_replace("/'(.+)'/m", '<span style="color: blue;">'."'".'\1'."'".'</span>', $src); ?>
<?php $src = preg_replace('/^(\s*(?!<#)[^#"]*)"(.*)"/m', '\1<span style="color: blue;">"\2"</span>', $src); // double quotes ?>
<?php $src = preg_replace("/^(\s*(?!<#)[^#']*)'(.*)'/m", '\1<span style="color: blue;">"\2"</span>', $src); // single quotes ?>
<?php $src = preg_replace('/^(\s*#)(.*)$/m', '<span style="color: gray;">\1\2</span>', $src); // comments ?>
<?php $src = preg_replace('/^(\s*[_a-z]+):/m', '<span style="color: green;"><strong>\1</strong></span>:', $src); // yaml keys ?>
<?php $src = preg_replace('/(__[_A-Z]+__)/m', '<span style="color: red;">\1</span>', $src); // variables ?>
<?php echo '<pre><code>' . $src . '</code></pre>';?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php endif; ?>
</td>
<td style="min-width:60px;" class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>"></td>
<td style="min-width:260px;" id="href-<?php echo $vHost['name'];?>"></td>
<td class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>"></td>
<td id="href-<?php echo $vHost['name'];?>"></td>
</tr>
<input type="hidden" name="vhost[]" class="vhost" value="<?php echo $vHost['name'];?>" />
<?php endforeach; ?>
Expand Down
5 changes: 5 additions & 0 deletions .devilbox/www/include/lib/container/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ public function getWpcliVersion()
$output = loadClass('Helper')->exec('wp --version 2>/dev/null | grep -i ^WP', $output);
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
}
public function getWscatVersion()
{
$output = loadClass('Helper')->exec('wscat --version 2>/dev/null | head -1', $output);
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
}
public function getYarnVersion()
{
$output = loadClass('Helper')->exec('yarn --version 2>/dev/null', $output);
Expand Down
Loading

0 comments on commit 10b20c0

Please sign in to comment.