mirror of
https://github.com/cytopia/devilbox.git
synced 2025-04-24 04:55:51 +00:00
Compare commits
131 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
986f04637f | ||
|
8621ce1b55 | ||
|
10b20c0745 | ||
|
1c2143095a | ||
|
22ed5edc4e | ||
|
9d23981173 | ||
|
6fa4d4a386 | ||
|
51a127dda3 | ||
|
76c6467806 | ||
|
617241ce42 | ||
|
2fa1641bc2 | ||
|
de8d40822c | ||
|
b773fcd1b7 | ||
|
7c461870f0 | ||
|
ecb674f859 | ||
|
8e39202fc9 | ||
|
8c81bcc1a1 | ||
|
8a1a720e8c | ||
|
fb173e0ed6 | ||
|
9f54138567 | ||
|
364f4aa3a6 | ||
|
c7c2b4f2cb | ||
|
0b561dfdd2 | ||
|
794e3d8961 | ||
|
a84e18be67 | ||
|
894706ab09 | ||
|
448054bece | ||
|
e18bfd3f4f | ||
|
d1894b3eb2 | ||
|
7f3b45b387 | ||
|
81c9bb0a93 | ||
|
cb07f319de | ||
|
cca1744145 | ||
|
9fc97586e6 | ||
|
2db5ffff6b | ||
|
0dc1b9cafb | ||
|
b05f4240f3 | ||
|
e18e923d87 | ||
|
c6e1192429 | ||
|
634b9af7e5 | ||
|
a1fa5724e8 | ||
|
a786eb64b0 | ||
|
01d2f4afed | ||
|
873abc6c4c | ||
|
1ba3cd399c | ||
|
299b765652 | ||
|
6819619d8a | ||
|
3ffb360c51 | ||
|
025b45c48c | ||
|
10571f7b51 | ||
|
ffba5d61b7 | ||
|
200f6ce0b1 | ||
|
8b0788b403 | ||
|
dfda00d78a | ||
|
98f05d7570 | ||
|
a560926315 | ||
|
e60aa4e465 | ||
|
d5858da3e0 | ||
|
c64c4553d7 | ||
|
55f0447ce1 | ||
|
0e3b963df2 | ||
|
0964c7bdd9 | ||
|
3b1c0b25a5 | ||
|
32c7beda22 | ||
|
794bf0c27c | ||
|
e51f34c1ae | ||
|
6b80453b92 | ||
|
6fa03e6961 | ||
|
e3b7c2d4db | ||
|
2b4bf59a40 | ||
|
ee5988507e | ||
|
d354d84165 | ||
|
f2c0372618 | ||
|
a35216fdfb | ||
|
2828e837d9 | ||
|
685e09f76b | ||
|
04c0e27ebf | ||
|
7645068258 | ||
|
b5566c1c52 | ||
|
826859a1cd | ||
|
71064a7296 | ||
|
f2088d63a7 | ||
|
8b70a01a16 | ||
|
a5f28e80c3 | ||
|
48e7133825 | ||
|
2e33d991b7 | ||
|
8227605036 | ||
|
565a5c7427 | ||
|
eb5ecc836c | ||
|
c165fd2ba0 | ||
|
d2d1ddfb63 | ||
|
f7c58ddbc4 | ||
|
8bde34caaf | ||
|
441adbb66d | ||
|
b5a6c0e6ad | ||
|
ca56dff442 | ||
|
7c941000c8 | ||
|
dbfd086227 | ||
|
895558209e | ||
|
b6512388d7 | ||
|
5cce2a8a89 | ||
|
b00b1e77b9 | ||
|
f2cca91dd1 | ||
|
b600f9866a | ||
|
aae28e7d6d | ||
|
fe59793304 | ||
|
e8a6fe51e7 | ||
|
c5da81b83b | ||
|
503667a8da | ||
|
315fb9e3c4 | ||
|
fc28e32b0c | ||
|
180eac149b | ||
|
dfb6eaec69 | ||
|
248cf5ba5f | ||
|
07df58f13a | ||
|
3bffa62456 | ||
|
59205dc888 | ||
|
63437650ee | ||
|
a11419e82e | ||
|
fb64b0bd31 | ||
|
12e613188e | ||
|
234bdd6419 | ||
|
6a04527456 | ||
|
0bb019b8a8 | ||
|
d3492e4acc | ||
|
4418b305de | ||
|
933a1c65e1 | ||
|
cabb7b07aa | ||
|
97751fad37 | ||
|
81d896fa93 | ||
|
270cb45726 |
@ -13,8 +13,8 @@ error_reporting(-1);
|
||||
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');
|
||||
|
||||
|
||||
$DEVILBOX_VERSION = 'v2.2.0';
|
||||
$DEVILBOX_DATE = '2022-04-14';
|
||||
$DEVILBOX_VERSION = 'v3.0.0-beta-0.3';
|
||||
$DEVILBOX_DATE = '2023-01-02';
|
||||
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';
|
||||
|
||||
//
|
||||
|
@ -36,31 +36,32 @@ if (loadClass('Helper')->isLoggedIn()) {
|
||||
//
|
||||
else if (isset($_GET['software'])) {
|
||||
$no = '<span class="text-danger">not installed</span>';
|
||||
$no_mod = '<span class="text-warning">PHP module not loaded</span>';
|
||||
$software = array();
|
||||
|
||||
if ($_GET['software'] == 'composer') {
|
||||
if ($_GET['software'] == 'angular_cli') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getAngularCliVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'asgardcms_installer') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getAsgardCmsInstallerVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'codeception') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getCodeceptionVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'composer') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getComposerVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'drupalc') {
|
||||
else if ($_GET['software'] == 'deployer') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getDrupalConsoleVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'drush7') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getDrushVersion(7)) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'drush8') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getDrushVersion(8)) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'drush9') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getDrushVersion(9)) !== false) ? $version : $no
|
||||
$_GET['software'] => (($version = loadClass('Php')->getDeployerVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'git') {
|
||||
@ -68,9 +69,24 @@ if (loadClass('Helper')->isLoggedIn()) {
|
||||
$_GET['software'] => (($version = loadClass('Php')->getGitVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'laravel') {
|
||||
else if ($_GET['software'] == 'grunt_cli') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getLaravelVersion()) !== false) ? $version : $no
|
||||
$_GET['software'] => (($version = loadClass('Php')->getGruntCliVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'gulp') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getGulpVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'laravel_installer') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getLaravelInstallerVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'laravel_lumen') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getLaravelLumenVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'mds') {
|
||||
@ -78,6 +94,11 @@ if (loadClass('Helper')->isLoggedIn()) {
|
||||
$_GET['software'] => (($version = loadClass('Php')->getMdsVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'mupdf_tools') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getMupdfToolsVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'node') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getNodeVersion()) !== false) ? $version : $no
|
||||
@ -88,20 +109,56 @@ if (loadClass('Helper')->isLoggedIn()) {
|
||||
$_GET['software'] => (($version = loadClass('Php')->getNpmVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'phalcon') {
|
||||
else if ($_GET['software'] == 'phalcon_devtools') {
|
||||
if (!extension_loaded('phalcon')) {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => $no_mod
|
||||
));
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getPhalconDevtoolsVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
}
|
||||
else if ($_GET['software'] == 'phpunit') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getPhalconVersion()) !== false) ? $version : $no
|
||||
$_GET['software'] => (($version = loadClass('Php')->getPhpunitVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'symfony') {
|
||||
else if ($_GET['software'] == 'stylelint') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getSymfonyVersion()) !== false) ? $version : $no
|
||||
$_GET['software'] => (($version = loadClass('Php')->getStylelintVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'symfony_cli') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getSymfonyCliVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'vue_cli') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getVueCliVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'webpack_cli') {
|
||||
echo json_encode(array(
|
||||
$_GET['software'] => (($version = loadClass('Php')->getWebpackCliVersion()) !== false) ? $version : $no
|
||||
));
|
||||
}
|
||||
else if ($_GET['software'] == 'wpcli') {
|
||||
echo json_encode(array(
|
||||
$_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
|
||||
));
|
||||
} else {
|
||||
echo json_encode(array($_GET['software'] => 'unknown software'));
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
class HtmlEmail extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.attachShadow({ mode: 'open' });
|
||||
|
||||
let emailContent;
|
||||
const templateId = this.dataset.templateId;
|
||||
try {
|
||||
emailContent = document.getElementById(templateId).innerHTML;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return;
|
||||
}
|
||||
|
||||
const container = document.createElement('div');
|
||||
container.innerHTML = emailContent;
|
||||
|
||||
this.shadowRoot.appendChild(container);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('html-email', HtmlEmail);
|
179
.devilbox/www/htdocs/cnc.php
Normal file
179
.devilbox/www/htdocs/cnc.php
Normal file
@ -0,0 +1,179 @@
|
||||
<?php require '../config.php'; ?>
|
||||
<?php loadClass('Helper')->authPage(); ?>
|
||||
<?php
|
||||
// TODO: This is currently a temporary hack to talk to supervisor on the HTTPD server
|
||||
function run_supervisor_command($command) {
|
||||
$supervisor_config_file = '/tmp/supervisorctl.conf';
|
||||
$port = getenv('SVCTL_LISTEN_PORT');
|
||||
$user = getenv('SVCTL_USER');
|
||||
$pass = getenv('SVCTL_PASS');
|
||||
|
||||
$content = "[supervisorctl]\n";
|
||||
$content .= "serverurl=http://httpd:" . $port . "\n";
|
||||
$content .= "username=" . $user . "\n";
|
||||
$content .= "password=" . $pass . "\n";
|
||||
|
||||
$fp = fopen($supervisor_config_file, 'w');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
|
||||
return loadClass('Helper')->exec('supervisorctl -c ' . $supervisor_config_file . ' ' . $command);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php if ( isset($_POST['watcherd']) && $_POST['watcherd'] == 'reload' ) {
|
||||
run_supervisor_command('restart watcherd');
|
||||
sleep(1);
|
||||
loadClass('Helper')->redirect('/cnc.php');
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php echo loadClass('Html')->getHead(true); ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo loadClass('Html')->getNavbar(); ?>
|
||||
|
||||
<div class="container">
|
||||
<h1>Command & Control</h1>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<?php
|
||||
$status_w = run_supervisor_command('status watcherd');
|
||||
$status_h = run_supervisor_command('status httpd');
|
||||
|
||||
$words = preg_split("/\s+/", $status_w);
|
||||
$data_w = array(
|
||||
'name' => isset($words[0]) ? $words[0] : '',
|
||||
'state' => isset($words[1]) ? $words[1] : '',
|
||||
'pid' => isset($words[3]) ? preg_replace('/,$/', '', $words[3]) : '',
|
||||
'uptime' => isset($words[5]) ? $words[5] : '',
|
||||
);
|
||||
$words = preg_split("/\s+/", $status_h);
|
||||
$data_h = array(
|
||||
'name' => isset($words[0]) ? $words[0] : '',
|
||||
'state' => isset($words[1]) ? $words[1] : '',
|
||||
'pid' => isset($words[3]) ? preg_replace('/,$/', '', $words[3]) : '',
|
||||
'uptime' => isset($words[5]) ? $words[5] : '',
|
||||
);
|
||||
?>
|
||||
<h3>Daemon overview</h3><br/>
|
||||
<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>
|
||||
<th>Daemon</th>
|
||||
<th>Status</th>
|
||||
<th>Pid</th>
|
||||
<th>Uptime</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo $data_w['name']; ?></td>
|
||||
<td><?php echo $data_w['state']; ?></td>
|
||||
<td><?php echo $data_w['pid']; ?></td>
|
||||
<td><?php echo $data_w['uptime']; ?></td>
|
||||
<td><form method="post"><button type="submit" name="watcherd" value="reload" class="btn btn-primary">Reload</button></form></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $data_h['name']; ?></td>
|
||||
<td><?php echo $data_h['state']; ?></td>
|
||||
<td><?php echo $data_h['pid']; ?></td>
|
||||
<td><?php echo $data_h['uptime']; ?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<h3>watcherd stderr</h3>
|
||||
<br/>
|
||||
<?php
|
||||
$output = run_supervisor_command('tail -1000000 watcherd stderr');
|
||||
echo '<pre>';
|
||||
foreach(preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) {
|
||||
if ( strpos($line, "[ERR]") !== false ) {
|
||||
echo '<span style="color: #ff0000">' . $line . '</span>';
|
||||
} else if ( strpos($line, "[emerg]") !== false ) {
|
||||
echo '<span style="color: #ff0000">' . $line . '</span>';
|
||||
} else if ( strpos($line, "Syntax error") !== false ) {
|
||||
echo '<span style="color: #ff0000">' . $line . '</span>';
|
||||
} else if ( strpos($line, "[WARN]") !== false ) {
|
||||
echo '<span style="color: #ccaa00">' . $line . '</span>';
|
||||
} else {
|
||||
echo $line;
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo '</pre>';
|
||||
?>
|
||||
<h3>watcherd stdout</h3>
|
||||
<br/>
|
||||
<?php
|
||||
$output = run_supervisor_command('tail -1000000 watcherd');
|
||||
echo '<pre>';
|
||||
foreach(preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) {
|
||||
$pos_info = strpos($line, "[INFO]");
|
||||
$pos_ok = strpos($line, "[OK]");
|
||||
if ( $pos_ok !== false ) {
|
||||
echo '<span style="color: #669a00"><strong>' . $line . '</strong></span>';
|
||||
} else if ( $pos_info !== false && $pos_info == 0 ) {
|
||||
echo '<span style="color: #0088cd">' . $line . '</span>';
|
||||
} else {
|
||||
echo $line;
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo '</pre>';
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /.container -->
|
||||
|
||||
<?php echo loadClass('Html')->getFooter(); ?>
|
||||
<script>
|
||||
$(function() {
|
||||
$('.subject').click(function() {
|
||||
const id = ($(this).attr('id'));
|
||||
const row = $('#mail-'+id);
|
||||
row.toggle();
|
||||
|
||||
const bodyElement = row.find('.email-body')[0];
|
||||
if(bodyElement.shadowRoot !== null){
|
||||
// We've already fetched the message content.
|
||||
return;
|
||||
}
|
||||
|
||||
bodyElement.attachShadow({ mode: 'open' });
|
||||
bodyElement.shadowRoot.innerHTML = 'Loading...';
|
||||
|
||||
$.get('?get-body=' + id, function(response){
|
||||
response = JSON.parse(response);
|
||||
row.find('.raw-email-body').html(response.raw);
|
||||
|
||||
const body = response.body;
|
||||
if(body === null){
|
||||
row.find('.alert').show();
|
||||
}
|
||||
else{
|
||||
bodyElement.shadowRoot.innerHTML = body;
|
||||
}
|
||||
})
|
||||
})
|
||||
// Handler for .ready() called.
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -334,10 +334,121 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12 col-margin">
|
||||
<div class="dash-box">
|
||||
<div class="dash-box-head"><i class="fa fa-info-circle" aria-hidden="true"></i> PHP Container Setup</div>
|
||||
<div class="dash-box-head"><i class="fa fa-info-circle" aria-hidden="true"></i> Available CLI Tools</div>
|
||||
<div class="dash-box-body">
|
||||
<p><small>You can also enter the php container via <code style="background-color:#3d3d3d;">./shell.sh</code> and use the following cli tools:</small></p>
|
||||
<table class="table table-striped table-hover table-bordered table-sm font-small">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th colspan="2">Tools</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width: 50%;">Angular Cli</th>
|
||||
<td id="app_angular_cli"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>AsgardCMS Installer</th>
|
||||
<td id="app_asgardcms_installer"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Codeception</th>
|
||||
<td id="app_codeception"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Composer</th>
|
||||
<td id="app_composer"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Deployer</th>
|
||||
<td id="app_deployer"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Git</th>
|
||||
<td id="app_git"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Grunt Cli</th>
|
||||
<td id="app_grunt_cli"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Gulp</th>
|
||||
<td id="app_gulp"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Laravel Installer</th>
|
||||
<td id="app_laravel_installer"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Laravel Lumen</th>
|
||||
<td id="app_laravel_lumen"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mupdf Tools</th>
|
||||
<td id="app_mupdf_tools"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>mysqldump-secure</th>
|
||||
<td id="app_mds"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Node</th>
|
||||
<td id="app_node"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Npm</th>
|
||||
<td id="app_npm"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Phalcon Devtools</th>
|
||||
<td id="app_phalcon_devtools"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Phpunit</th>
|
||||
<td id="app_phpunit"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Stylelint</th>
|
||||
<td id="app_stylelint"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Symfony Cli</th>
|
||||
<td id="app_symfony_cli"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Vue Cli</th>
|
||||
<td id="app_vue_cli"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Webpack Cli</th>
|
||||
<td id="app_webpack_cli"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12 offset-lg-4 offset-md-0 offset-sm-0 col-margin">
|
||||
<div class="dash-box">
|
||||
<div class="dash-box-head"><i class="fa fa-info-circle" aria-hidden="true"></i> PHP Container Status</div>
|
||||
<div class="dash-box-body">
|
||||
<p><small>You have made the following base configuration to the Devilbox:</small></p>
|
||||
<table class="table table-striped table-hover table-bordered table-sm font-small">
|
||||
<p><small>You can also enter the php container and work from inside. The following is available inside the container:</small></p>
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th colspan="2">Settings</th>
|
||||
@ -374,78 +485,7 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-striped table-hover table-bordered table-sm font-small">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th colspan="2">Tools</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>composer</th>
|
||||
<td id="app_composer"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>drupal-console</th>
|
||||
<td id="app_drupalc"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>drush7</th>
|
||||
<td id="app_drush7"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>drush8</th>
|
||||
<td id="app_drush8"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>drush9</th>
|
||||
<td id="app_drush9"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>git</th>
|
||||
<td id="app_git"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Laravel installer</th>
|
||||
<td id="app_laravel"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>mysqldump-secure</th>
|
||||
<td id="app_mds"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>node</th>
|
||||
<td id="app_node"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>npm</th>
|
||||
<td id="app_npm"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Phalcon devtools</th>
|
||||
<td id="app_phalcon"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Symfony installer</th>
|
||||
<td id="app_symfony"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Wordpress cli</th>
|
||||
<td id="app_wpcli"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12 offset-lg-4 offset-md-0 offset-sm-0 col-margin">
|
||||
<div class="dash-box">
|
||||
<div class="dash-box-head"><i class="fa fa-info-circle" aria-hidden="true"></i> PHP Container Status</div>
|
||||
<div class="dash-box-body">
|
||||
<p><small>The PHP Docker can connect to the following services via the specified hostnames and IP addresses.</small></p>
|
||||
<p><small>The PHP container can connect to the following services via the specified hostnames and IP addresses.</small></p>
|
||||
<table class="table table-striped table-hover table-bordered table-sm font-small">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
@ -913,19 +953,29 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
|
||||
xhttp.open('GET', '_ajax_callback.php?software='+app, true);
|
||||
xhttp.send();
|
||||
}
|
||||
updateVersions('angular_cli');
|
||||
updateVersions('asgardcms_installer');
|
||||
updateVersions('codeception');
|
||||
updateVersions('composer');
|
||||
updateVersions('drupalc');
|
||||
updateVersions('drush7');
|
||||
updateVersions('drush8');
|
||||
updateVersions('drush9');
|
||||
updateVersions('deployer');
|
||||
updateVersions('git');
|
||||
updateVersions('laravel');
|
||||
updateVersions('grunt_cli');
|
||||
updateVersions('gulp');
|
||||
updateVersions('laravel_installer');
|
||||
updateVersions('laravel_lumen');
|
||||
updateVersions('mds');
|
||||
updateVersions('mupdf_tools');
|
||||
updateVersions('node');
|
||||
updateVersions('npm');
|
||||
updateVersions('phalcon');
|
||||
updateVersions('symfony');
|
||||
updateVersions('phalcon_devtools');
|
||||
updateVersions('phpunit');
|
||||
updateVersions('stylelint');
|
||||
updateVersions('symfony_cli');
|
||||
updateVersions('vue_cli');
|
||||
updateVersions('webpack_cli');
|
||||
updateVersions('wpcli');
|
||||
updateVersions('wscat');
|
||||
updateVersions('yarn');
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
@ -1,66 +0,0 @@
|
||||
<?php require '../config.php'; ?>
|
||||
<?php loadClass('Helper')->authPage(); ?>
|
||||
<?php
|
||||
if (!isset($_GET['name'])) {
|
||||
loadClass('Helper')->redirect('/vhosts.php');
|
||||
}
|
||||
if (!strlen($_GET['name'])) {
|
||||
loadClass('Helper')->redirect('/vhosts.php');
|
||||
}
|
||||
$vhost = $_GET['name'];
|
||||
$found = false;
|
||||
$vhosts = loadClass('Httpd')->getVirtualHosts();
|
||||
foreach ($vhosts as $v) {
|
||||
if ($vhost == $v['name']) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Be safe before using outputs
|
||||
$vhost = htmlentities($vhost);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php echo loadClass('Html')->getHead(true); ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo loadClass('Html')->getNavbar(); ?>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1>vhost-gen: <?php echo $vhost;?></h1>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php if (!$found): ?>
|
||||
<p>The Virtual Host "<?php echo $vhost; ?>" does not exist.</p>
|
||||
<?php else: ?>
|
||||
<?php $tpl = loadClass('Httpd')->getVhostgenTemplatePath($vhost); ?>
|
||||
<?php if (!$tpl): ?>
|
||||
<p>No custom vhost-gen configuration found for "<?php echo $vhost; ?>".</p>
|
||||
<?php else: ?>
|
||||
<p>Note: If the resulting virtual host config does not reflect the vhost-gen template changes, you will need to restart the Devilbox.</p>
|
||||
<a href="/vhosts.php"><i class="fa fa-chevron-left" aria-hidden="true"></i> Overview</a><br/>
|
||||
<br/><h3>virtual host config</h3><br/>
|
||||
<a title="Virtual host: <?php echo $vhost;?>.conf" target="_blank" href="/vhost.d/<?php echo $vhost;?>.conf">
|
||||
<i class="fa fa-external-link" aria-hidden="true"></i> <?php echo $vhost;?>.conf
|
||||
</a>
|
||||
<br/><br/><h3>vhost-gen config</h3><br/>
|
||||
<code><?php echo $tpl; ?></code><br/><br/>
|
||||
<?php $lines = file($tpl); ?>
|
||||
<pre style="border: 1px solid black; padding:5px;"><code><?php foreach ($lines as $line): ?><?php echo $line; ?><?php endforeach; ?></code></pre>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /.container -->
|
||||
|
||||
<?php echo loadClass('Html')->getFooter(); ?>
|
||||
</body>
|
||||
</html>
|
@ -24,6 +24,28 @@ require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDeco
|
||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
|
||||
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Sort.php';
|
||||
|
||||
if (isset($_GET['get-body']) && is_numeric($_GET['get-body'])) {
|
||||
$messageNumber = $_GET['get-body'];
|
||||
$MyMbox = new \devilbox\Mail('/var/mail/devilbox');
|
||||
$message = $MyMbox->getMessage($messageNumber-1);
|
||||
$structure = $message['decoded'];
|
||||
|
||||
$body = null;
|
||||
if (isset($structure->body)) {
|
||||
$body = $structure->body;
|
||||
}
|
||||
elseif(isset($structure->parts[1]->body)) {
|
||||
$body = $structure->parts[1]->body;
|
||||
}
|
||||
elseif(isset($structure->parts[0]->body)) {
|
||||
$body = $structure->parts[0]->body;
|
||||
}
|
||||
|
||||
exit(json_encode(array(
|
||||
'raw' => htmlentities($message['raw']),
|
||||
'body' => $body,
|
||||
)));
|
||||
}
|
||||
|
||||
if (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
|
||||
$message = $_GET['delete'];
|
||||
@ -171,17 +193,6 @@ $messages = $MyMbox->get($sortOrderArr);
|
||||
<?php
|
||||
$message = htmlentities($data['raw']);
|
||||
$structure = $data['decoded'];
|
||||
$body = null;
|
||||
|
||||
if (isset($structure->body)) {
|
||||
$body = $structure->body;
|
||||
}
|
||||
elseif(isset($structure->parts[1]->body)) {
|
||||
$body = $structure->parts[1]->body;
|
||||
}
|
||||
elseif(isset($structure->parts[0]->body)) {
|
||||
$body = $structure->parts[0]->body;
|
||||
}
|
||||
?>
|
||||
<tr id="<?php echo $data['num'];?>" class="subject">
|
||||
<td><?php echo $data['num'];?></td>
|
||||
@ -198,17 +209,13 @@ $messages = $MyMbox->get($sortOrderArr);
|
||||
<tr id="mail-<?php echo $data['num'];?>" style="display:none">
|
||||
<td></td>
|
||||
<td colspan="5">
|
||||
<?php if ($body !== null): ?>
|
||||
<template id="mail-body-<?=$data['num']?>"><?=$body?></template>
|
||||
<html-email data-template-id="mail-body-<?=$data['num']?>"></html-email>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
No valid body found
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="email-body"></div>
|
||||
<div class="alert alert-warning" role="alert" style="display:none">
|
||||
No valid body found
|
||||
</div>
|
||||
<hr>
|
||||
<p><a class="btn btn-primary" data-toggle="collapse" href="#email-<?php echo $data['num'];?>" aria-expanded="false" aria-controls="email-<?php echo $data['num'];?>">Raw source</a></p>
|
||||
<div class="collapse" id="email-<?php echo $data['num'];?>"><pre><?php echo $message;?></pre></div>
|
||||
<div class="collapse" id="email-<?php echo $data['num'];?>"><pre class="raw-email-body"></pre></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@ -227,12 +234,34 @@ $messages = $MyMbox->get($sortOrderArr);
|
||||
<script>
|
||||
$(function() {
|
||||
$('.subject').click(function() {
|
||||
var id = ($(this).attr('id'));
|
||||
$('#mail-'+id).toggle();
|
||||
const id = ($(this).attr('id'));
|
||||
const row = $('#mail-'+id);
|
||||
row.toggle();
|
||||
|
||||
const bodyElement = row.find('.email-body')[0];
|
||||
if(bodyElement.shadowRoot !== null){
|
||||
// We've already fetched the message content.
|
||||
return;
|
||||
}
|
||||
|
||||
bodyElement.attachShadow({ mode: 'open' });
|
||||
bodyElement.shadowRoot.innerHTML = 'Loading...';
|
||||
|
||||
$.get('?get-body=' + id, function(response){
|
||||
response = JSON.parse(response);
|
||||
row.find('.raw-email-body').html(response.raw);
|
||||
|
||||
const body = response.body;
|
||||
if(body === null){
|
||||
row.find('.alert').show();
|
||||
}
|
||||
else{
|
||||
bodyElement.shadowRoot.innerHTML = body;
|
||||
}
|
||||
})
|
||||
})
|
||||
// Handler for .ready() called.
|
||||
});
|
||||
</script>
|
||||
<script src="/assets/js/html-email.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -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>
|
||||
|
@ -76,6 +76,7 @@ class Connection {
|
||||
|
||||
// Detect version and choose appropriate database driver
|
||||
switch (substr($version,0,2)) {
|
||||
case '15': return 'Postgres';break;
|
||||
case '14': return 'Postgres';break;
|
||||
case '13': return 'Postgres13';break;
|
||||
case '12': return 'Postgres12';break;
|
||||
|
@ -24,31 +24,95 @@
|
||||
<tr>
|
||||
<th>Project</th>
|
||||
<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>
|
||||
<?php
|
||||
$totals = 70;
|
||||
$filler = ' ';
|
||||
for ($i=0; $i<$totals; $i++) {
|
||||
$filler = $filler. ' ';
|
||||
}
|
||||
?>
|
||||
<?php foreach ($vHosts as $vHost): ?>
|
||||
<tr>
|
||||
<td><?php echo $vHost['name'];?></td>
|
||||
<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">×</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('<', '<', $src); ?>
|
||||
<?php $src = str_replace('>', '>', $src); ?>
|
||||
<?php $src = preg_replace('/<(\/?.*)>/m', '<strong><\1></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">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php $src = file_get_contents($vhostGenPath); ?>
|
||||
<?php //$src = htmlentities($src); ?>
|
||||
<?php $src = str_replace('<', '<', $src); ?>
|
||||
<?php $src = str_replace('>', '>', $src); ?>
|
||||
<?php $src = preg_replace('/<(\/?.*)>/m', '<strong><\1></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 class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>"> </td>
|
||||
<td id="href-<?php echo $vHost['name'];?>"><?php echo $filler;?></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; ?>
|
||||
@ -63,6 +127,60 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$cmd="netstat -wneeplt 2>/dev/null | sort | grep '\s1000\s' | awk '{print \"app=\"\$9\"|addr=\"\$4}' | sed 's/\(app=\)\([0-9]*\/\)/\\1/g' | sed 's/\(.*\)\(:[0-9][0-9]*\)/\\1|port=\\2/g' | sed 's/port=:/port=/g'";
|
||||
$output=loadClass('Helper')->exec($cmd);
|
||||
$daemons = array();
|
||||
foreach (preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) {
|
||||
$section = preg_split("/\|/", $line);
|
||||
if (count($section) == 3) {
|
||||
$tool = preg_split("/=/", $section[0]);
|
||||
$addr = preg_split("/=/", $section[1]);
|
||||
$port = preg_split("/=/", $section[2]);
|
||||
$tool = $tool[1];
|
||||
$addr = $addr[1];
|
||||
$port = $port[1];
|
||||
$daemons[] = array(
|
||||
'tool' => $tool,
|
||||
'addr' => $addr,
|
||||
'port' => $port
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (count($daemons)): ?>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<h2>Local listening daemons</h2>
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th>Application</th>
|
||||
<th>Listen Address</th>
|
||||
<th>Listen Port</th>
|
||||
<th>Host</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($daemons as $daemon): ?>
|
||||
<tr>
|
||||
<td><?php echo $daemon['tool']; ?></td>
|
||||
<td><?php echo $daemon['addr']; ?></td>
|
||||
<td><?php echo $daemon['port']; ?></td>
|
||||
<td>php (172.16.238.10)</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
</div><!-- /.container -->
|
||||
|
||||
<?php echo loadClass('Html')->getFooter(); ?>
|
||||
@ -81,7 +199,7 @@
|
||||
var el_valid;
|
||||
var el_href;
|
||||
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
if (this.readyState == 4 && this.status == 200 || this.status == 426) {
|
||||
el_valid = document.getElementById('valid-' + vhost);
|
||||
el_href = document.getElementById('href-' + vhost);
|
||||
error = this.responseText;
|
||||
@ -127,13 +245,14 @@
|
||||
var el_href = document.getElementById('href-' + vhost);
|
||||
var error = this.responseText;
|
||||
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
if (this.readyState == 4 && (this.status == 200 || this.status == 426)) {
|
||||
clearTimeout(xmlHttpTimeout);
|
||||
el_valid.className += ' bg-success';
|
||||
if (el_valid.innerHTML != 'WARN') {
|
||||
el_valid.innerHTML = 'OK';
|
||||
}
|
||||
el_href.innerHTML = '<a target="_blank" href="'+proto+'//'+name+port+'">'+name+port+'</a>' + el_href.innerHTML;
|
||||
//el_href.innerHTML = '(<a target="_blank" href="'+proto+'//localhost/devilbox-project/'+name+'">ext</a>) <a target="_blank" href="'+proto+'//'+name+port+'">'+name+port+'</a>' + el_href.innerHTML;
|
||||
el_href.innerHTML = '<a target="_blank" href="'+proto+'//'+name+port+'">'+name+port+'</a>';
|
||||
} else {
|
||||
//console.log(vhost);
|
||||
}
|
||||
|
@ -18,6 +18,10 @@ class Html
|
||||
'name' => 'Virtual Hosts',
|
||||
'path' => '/vhosts.php'
|
||||
),
|
||||
array(
|
||||
'name' => 'C&C',
|
||||
'path' => '/cnc.php'
|
||||
),
|
||||
array(
|
||||
'name' => 'Emails',
|
||||
'path' => '/mail.php'
|
||||
@ -263,7 +267,7 @@ HTML;
|
||||
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse footer">
|
||||
<div class="container justify-content-end">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item nav-link">Render time: ${render_time} sec</li>
|
||||
<li class="nav-item nav-link">Render time: {$render_time} sec</li>
|
||||
<li class="nav-item"><a class="nav-link" target="_blank" href="https://github.com/cytopia/devilbox"><code>Github</code></a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/credits.php"><code>Credits</code></a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/support.php"><code>Support</code></a></li>
|
||||
|
@ -70,6 +70,22 @@ class Mail
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single message
|
||||
*
|
||||
* @param int $messageIndex The zero-based index of the message to return.
|
||||
*/
|
||||
public function getMessage($messageIndex){
|
||||
$message = $this->_Mbox->get($messageIndex);
|
||||
$Decoder = new \Mail_mimeDecode($message, "\r\n");
|
||||
return array(
|
||||
'num' => $messageIndex + 1,
|
||||
'raw' => $message,
|
||||
'decoded' => $Decoder->decode($this->_defaultMimeParams)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve emails.
|
||||
*
|
||||
@ -87,13 +103,7 @@ class Mail
|
||||
|
||||
// Get messages in reverse order (last entry first)
|
||||
for ($n = $total; $n >= 0; --$n) {
|
||||
$message = $this->_Mbox->get($n);
|
||||
$Decoder = new \Mail_mimeDecode($message, "\r\n");
|
||||
$messages[] = array(
|
||||
'num' => $n + 1,
|
||||
'raw' => $message,
|
||||
'decoded' => $Decoder->decode($this->_defaultMimeParams)
|
||||
);
|
||||
$messages[] = $this->getMessage($n);
|
||||
}
|
||||
|
||||
// Optionally sort messages
|
||||
|
@ -29,10 +29,18 @@ class Httpd extends BaseClass implements BaseInterface
|
||||
$url = 'http://'.$domain;
|
||||
$error = array();
|
||||
|
||||
// 1. Check htdocs folder
|
||||
if (!$this->_is_valid_dir($docroot)) {
|
||||
$error[] = 'error';
|
||||
$error[] = 'Missing <strong>'.$htdocs.'</strong> directory in: <strong>'.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/</strong>';
|
||||
|
||||
$backend = $this->getVhostBackend($vhost);
|
||||
$pos_def = strpos($backend, 'default');
|
||||
$pos_phpfpm = strpos($backend, 'tcp://');
|
||||
|
||||
// Only if backend 'default' or 'phpfpm', we need a htdocs/ directory
|
||||
if ( ($pos_def !== false && $pos_def == 0) || ($pos_phpfpm !== false && $pos_phpfpm == 0) ) {
|
||||
// 1. Check htdocs folder
|
||||
if (!$this->_is_valid_dir($docroot)) {
|
||||
$error[] = 'error';
|
||||
$error[] = 'Missing <strong>'.$htdocs.'</strong> directory in: <strong>'.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/</strong>';
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Check internal DNS server
|
||||
@ -196,6 +204,33 @@ class Httpd extends BaseClass implements BaseInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getVhostBackend($vhost)
|
||||
{
|
||||
$dir = loadClass('Helper')->getEnv('HTTPD_TEMPLATE_DIR');
|
||||
$name = 'backend.cfg';
|
||||
$file = '/shared/httpd/'.$vhost.'/'.$dir.'/'.$name;
|
||||
if (!file_exists($file)) {
|
||||
return 'default';
|
||||
}
|
||||
|
||||
$fp = fopen($file, 'r');
|
||||
$cont = stream_get_contents($fp);
|
||||
fclose($fp);
|
||||
|
||||
// conf:<type>:<proto>:<server>:<port>
|
||||
$arr = explode(':', $cont);
|
||||
|
||||
$type = $arr[1];
|
||||
$prot = $arr[2];
|
||||
$addr = ''; // this may contain ':' itself due to IPv6 addresses
|
||||
for ($i=3; $i<(count($arr)-1); $i++) {
|
||||
$addr .= $arr[$i];
|
||||
}
|
||||
$port = $arr[count($arr) - 1];
|
||||
|
||||
return $prot.'://'.$addr.':'.$port;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
*
|
||||
|
@ -71,7 +71,8 @@ class Pgsql extends BaseClass implements BaseInterface
|
||||
public function __destruct()
|
||||
{
|
||||
if ($this->_link) {
|
||||
pg_close($this->_link);
|
||||
// DO NOT CLOSE. It is kind of shared.
|
||||
//pg_close($this->_link);
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,7 +149,7 @@ class Pgsql extends BaseClass implements BaseInterface
|
||||
// Get schemas for each database
|
||||
foreach ($databases as $name => &$database) {
|
||||
$PSQL = new Pgsql(
|
||||
$this->getIpAddress(),
|
||||
$GLOBALS['PGSQL_HOST_NAME'],
|
||||
array(
|
||||
'user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'),
|
||||
'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD'),
|
||||
@ -179,7 +180,7 @@ class Pgsql extends BaseClass implements BaseInterface
|
||||
public function getSchemaSize($database, $schema)
|
||||
{
|
||||
$PSQL = new Pgsql(
|
||||
$this->getIpAddress(),
|
||||
$GLOBALS['PGSQL_HOST_NAME'],
|
||||
array(
|
||||
'user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'),
|
||||
'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD'),
|
||||
@ -217,7 +218,7 @@ class Pgsql extends BaseClass implements BaseInterface
|
||||
public function getTableCount($database, $schema)
|
||||
{
|
||||
$PSQL = new Pgsql(
|
||||
$this->getIpAddress(),
|
||||
$GLOBALS['PGSQL_HOST_NAME'],
|
||||
array(
|
||||
'user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'),
|
||||
'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD'),
|
||||
|
@ -35,9 +35,19 @@ class Php extends BaseClass implements BaseInterface
|
||||
$uid = loadClass('Helper')->egrep('/[0-9]+/', $uid);
|
||||
return $uid;
|
||||
}
|
||||
public function getGitVersion()
|
||||
public function getAngularCliVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('git --version 2>/dev/null', $output);
|
||||
$output = loadClass('Helper')->exec('ng version 2>/dev/null | grep -i "^Angular CLI" | head -1', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getAsgardCmsInstallerVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('asgardcms --version --no-ansi 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getCodeceptionVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('codecept --version --no-ansi 2>/dev/null | grep -i ^Codecept', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getComposerVersion()
|
||||
@ -45,15 +55,45 @@ class Php extends BaseClass implements BaseInterface
|
||||
$output = loadClass('Helper')->exec('composer --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getDrushVersion($version)
|
||||
public function getDeployerVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('drush'.$version.' --version 2>/dev/null', $output);
|
||||
$output = loadClass('Helper')->exec('dep --version --no-ansi 2>/dev/null | grep -i ^Deploy', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getDrupalConsoleVersion()
|
||||
public function getGitVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('drupal --version 2>/dev/null | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+[-rc0-9.]*/', $output);
|
||||
$output = loadClass('Helper')->exec('git --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getGruntCliVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('grunt --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getGulpVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('gulp --version --no-color 2>/dev/null | head -1', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getLaravelInstallerVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('laravel --version --no-ansi 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getLaravelLumenVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('lumen --version --no-ansi 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getMdsVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('mysqldump-secure --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getMupdfToolsVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('mutool -v 2>&1', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getNodeVersion()
|
||||
{
|
||||
@ -65,31 +105,61 @@ class Php extends BaseClass implements BaseInterface
|
||||
$output = loadClass('Helper')->exec('npm --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getLaravelVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('laravel --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getMdsVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('mysqldump-secure --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getPhalconVersion()
|
||||
public function getPhalconDevtoolsVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('phalcon --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getSymfonyVersion()
|
||||
public function getPhpunitVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('phpunit --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getStylelintVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('stylelint --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getSymfonyCliVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('symfony -V 2>/dev/null | tr -d "[:cntrl:]" | sed "s/\[[0-9]*m//g"', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getWpcliVersion()
|
||||
public function getVueCliVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('wp --version 2>/dev/null', $output);
|
||||
$output = loadClass('Helper')->exec('vue --version 2>/dev/null', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
public function getWebpackCliVersion()
|
||||
{
|
||||
$output = loadClass('Helper')->exec('webpack-cli --version --no-stats --no-target --no-watch --no-color 2>/dev/null | grep webpack-cli', $output);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
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);
|
||||
return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
}
|
||||
//public function getDrushVersion($version)
|
||||
//{
|
||||
// $output = loadClass('Helper')->exec('drush'.$version.' --version 2>/dev/null', $output);
|
||||
// return loadClass('Helper')->egrep('/[0-9.]+/', $output);
|
||||
//}
|
||||
//public function getDrupalConsoleVersion()
|
||||
//{
|
||||
// $output = loadClass('Helper')->exec('drupal --version 2>/dev/null | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"', $output);
|
||||
// return loadClass('Helper')->egrep('/[0-9.]+[-rc0-9.]*/', $output);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
104
.devilbox/www/include/vendor/Mail/mimeDecode.php
vendored
104
.devilbox/www/include/vendor/Mail/mimeDecode.php
vendored
@ -28,8 +28,8 @@
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* - Neither the name of the authors, nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* - Neither the name of the authors, nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
@ -142,11 +142,11 @@ class Mail_mimeDecode extends PEAR
|
||||
/**
|
||||
* Flag to determine whether to decode headers
|
||||
* (set to UTF8 to iconv convert headers)
|
||||
* @var mixed
|
||||
* @var mixed
|
||||
* @access private
|
||||
*/
|
||||
var $_decode_headers;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Flag to determine whether to include attached messages
|
||||
@ -182,7 +182,7 @@ class Mail_mimeDecode extends PEAR
|
||||
{
|
||||
$this->__construct($input);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Begins the decoding process. If called statically
|
||||
@ -197,7 +197,7 @@ class Mail_mimeDecode extends PEAR
|
||||
* of the parts. (Transfer encoding)
|
||||
* decode_headers - Whether to decode headers,
|
||||
* - use "UTF8//IGNORE" to convert charset.
|
||||
*
|
||||
*
|
||||
* input - If called statically, this will be treated
|
||||
* as the input
|
||||
* @return object Decoded results
|
||||
@ -229,17 +229,17 @@ class Mail_mimeDecode extends PEAR
|
||||
$params['decode_headers'] : false;
|
||||
$this->_rfc822_bodies = isset($params['rfc_822bodies']) ?
|
||||
$params['rfc_822bodies'] : false;
|
||||
|
||||
|
||||
if (is_string($this->_decode_headers) && !function_exists('iconv')) {
|
||||
PEAR::raiseError('header decode conversion requested, however iconv is missing');
|
||||
}
|
||||
|
||||
|
||||
$structure = $this->_decode($this->_header, $this->_body);
|
||||
if ($structure === false) {
|
||||
$structure = $this->raiseError($this->_error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $structure;
|
||||
}
|
||||
|
||||
@ -320,10 +320,10 @@ class Mail_mimeDecode extends PEAR
|
||||
$encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
|
||||
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
|
||||
break;
|
||||
|
||||
|
||||
case 'multipart/signed': // PGP
|
||||
$parts = $this->_boundarySplit($body, $content_type['other']['boundary'], true);
|
||||
$return->parts['msg_body'] = $parts[0];
|
||||
$return->parts['msg_body'] = $parts[0];
|
||||
list($part_header, $part_body) = $this->_splitBodyHeader($parts[1]);
|
||||
$return->parts['sig_hdr'] = $part_header;
|
||||
$return->parts['sig_body'] = $part_body;
|
||||
@ -404,7 +404,7 @@ class Mail_mimeDecode extends PEAR
|
||||
}
|
||||
for ($i = 0; $i < count($structure->parts); $i++) {
|
||||
|
||||
|
||||
|
||||
if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
|
||||
$prepend = $prepend . $mime_number . '.';
|
||||
$_mime_number = '';
|
||||
@ -424,7 +424,7 @@ class Mail_mimeDecode extends PEAR
|
||||
$structure->mime_id = $prepend . $mime_number;
|
||||
$no_refs ? $return[$prepend . $mime_number] = '' : $return[$prepend . $mime_number] = &$structure;
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ class Mail_mimeDecode extends PEAR
|
||||
if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $input, $match)) {
|
||||
return array($match[1], $match[2]);
|
||||
}
|
||||
// bug #17325 - empty bodies are allowed. - we just check that at least one line
|
||||
// bug #17325 - empty bodies are allowed. - we just check that at least one line
|
||||
// of headers exist..
|
||||
if (count(explode("\n",$input))) {
|
||||
return array($input, '');
|
||||
@ -466,11 +466,11 @@ class Mail_mimeDecode extends PEAR
|
||||
// Unfold the input
|
||||
$input = preg_replace("/\r?\n/", "\r\n", $input);
|
||||
//#7065 - wrapping.. with encoded stuff.. - probably not needed,
|
||||
// wrapping space should only get removed if the trailing item on previous line is a
|
||||
// wrapping space should only get removed if the trailing item on previous line is a
|
||||
// encoded character
|
||||
$input = preg_replace("/=\r\n(\t| )+/", '=', $input);
|
||||
$input = preg_replace("/\r\n(\t| )+/", ' ', $input);
|
||||
|
||||
|
||||
$headers = explode("\r\n", trim($input));
|
||||
$got_start = false;
|
||||
foreach ($headers as $value) {
|
||||
@ -485,7 +485,7 @@ class Mail_mimeDecode extends PEAR
|
||||
$got_start = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$hdr_name = substr($value, 0, $pos = strpos($value, ':'));
|
||||
$hdr_value = substr($value, $pos+1);
|
||||
if($hdr_value[0] == ' ') {
|
||||
@ -520,7 +520,7 @@ class Mail_mimeDecode extends PEAR
|
||||
* filename*0*=ENC'lang'urlencoded data.
|
||||
* filename*1*=ENC'lang'urlencoded data.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string Header value to parse
|
||||
* @return array Contains parsed result
|
||||
@ -554,7 +554,7 @@ class Mail_mimeDecode extends PEAR
|
||||
$lq = ''; // last quote..
|
||||
|
||||
while ($i < $l) {
|
||||
|
||||
|
||||
$c = $input[$i];
|
||||
//var_dump(array('i'=>$i,'c'=>$c,'q'=>$q, 'lq'=>$lq, 'key'=>$key, 'val' =>$val));
|
||||
|
||||
@ -566,7 +566,7 @@ class Mail_mimeDecode extends PEAR
|
||||
}
|
||||
$escaped = true;
|
||||
$c = $input[$i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// state - in key..
|
||||
@ -588,7 +588,7 @@ class Mail_mimeDecode extends PEAR
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// state - in value.. (as $val is set..)
|
||||
|
||||
if ($q === false) {
|
||||
@ -597,10 +597,10 @@ class Mail_mimeDecode extends PEAR
|
||||
$i++;
|
||||
continue; // skip leading spaces after '=' or after '"'
|
||||
}
|
||||
|
||||
// do not de-quote 'xxx*= itesm..
|
||||
|
||||
// do not de-quote 'xxx*= itesm..
|
||||
$key_is_trans = $key[strlen($key)-1] == '*';
|
||||
|
||||
|
||||
if (!$key_is_trans && !$escaped && ($c == '"' || $c == "'")) {
|
||||
// start quoted area..
|
||||
$q = $c;
|
||||
@ -612,7 +612,7 @@ class Mail_mimeDecode extends PEAR
|
||||
}
|
||||
// got end....
|
||||
if (!$escaped && $c == ';') {
|
||||
|
||||
|
||||
$return['other'][$key] = trim($val);
|
||||
$val = false;
|
||||
$key = '';
|
||||
@ -625,31 +625,31 @@ class Mail_mimeDecode extends PEAR
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// state - in quote..
|
||||
if (!$escaped && $c == $q) { // potential exit state..
|
||||
|
||||
|
||||
// end of quoted string..
|
||||
$lq = $q;
|
||||
$q = false;
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// normal char inside of quoted string..
|
||||
$val.= $c;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// do we have anything left..
|
||||
if (strlen(trim($key)) || $val !== false) {
|
||||
|
||||
|
||||
$val = trim($val);
|
||||
|
||||
|
||||
$return['other'][$key] = $val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$clean_others = array();
|
||||
// merge added values. eg. *1[*]
|
||||
foreach($return['other'] as $key =>$val) {
|
||||
@ -659,12 +659,12 @@ class Mail_mimeDecode extends PEAR
|
||||
$clean_others[$key] .= $val;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$clean_others[$key] = $val;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// handle language translation of '*' ending others.
|
||||
foreach( $clean_others as $key =>$val) {
|
||||
if ( $key[strlen($key)-1] != '*') {
|
||||
@ -677,26 +677,26 @@ class Mail_mimeDecode extends PEAR
|
||||
// extended-other-values
|
||||
$match = array();
|
||||
$info = preg_match("/^([^']+)'([^']*)'(.*)$/", $val, $match);
|
||||
|
||||
|
||||
$clean_others[$key] = urldecode($match[3]);
|
||||
$clean_others[strtolower($key)] = $clean_others[$key];
|
||||
$clean_others[strtolower($key).'-charset'] = $match[1];
|
||||
$clean_others[strtolower($key).'-language'] = $match[2];
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$return['other'] = $clean_others;
|
||||
|
||||
|
||||
// decode values.
|
||||
foreach($return['other'] as $key =>$val) {
|
||||
$charset = isset($return['other'][$key . '-charset']) ?
|
||||
$return['other'][$key . '-charset'] : false;
|
||||
|
||||
|
||||
$return['other'][$key] = $this->_decodeHeader($val, $charset);
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@ -729,7 +729,7 @@ class Mail_mimeDecode extends PEAR
|
||||
$parts[] = $tmp[$i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add the last part on if it does not end with the 'closing indicator'
|
||||
if (!empty($tmp[$len]) && strlen(trim($tmp[$len])) && $tmp[$len][0] != '-') {
|
||||
$parts[] = $tmp[$len];
|
||||
@ -781,12 +781,12 @@ class Mail_mimeDecode extends PEAR
|
||||
}
|
||||
$input = str_replace($encoded, $text, $input);
|
||||
}
|
||||
|
||||
|
||||
if ($default_charset && is_string($this->_decode_headers)) {
|
||||
$conv = @iconv($charset, $this->_decode_headers, $input);
|
||||
$input = ($conv === false) ? $input : $conv;
|
||||
}
|
||||
|
||||
|
||||
return $input;
|
||||
}
|
||||
|
||||
@ -832,10 +832,12 @@ class Mail_mimeDecode extends PEAR
|
||||
// Remove soft line breaks
|
||||
$input = preg_replace("/=\r?\n/", '', $input);
|
||||
|
||||
// cytopia edit
|
||||
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
|
||||
$cb = function($matches) {
|
||||
return chr(hexdec($matches[0]));
|
||||
// cytopia edit (added ctype_xdigit() check around)
|
||||
if (ctype_xdigit($matches[0])) {
|
||||
return chr(hexdec($matches[0]));
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// Replace encoded characters
|
||||
@ -924,7 +926,7 @@ class Mail_mimeDecode extends PEAR
|
||||
|
||||
/**
|
||||
* getSendArray() returns the arguments required for Mail::send()
|
||||
* used to build the arguments for a mail::send() call
|
||||
* used to build the arguments for a mail::send() call
|
||||
*
|
||||
* Usage:
|
||||
* $mailtext = Full email (for example generated by a template)
|
||||
@ -966,7 +968,7 @@ class Mail_mimeDecode extends PEAR
|
||||
}
|
||||
$to = substr($to,1);
|
||||
return array($to,$header,$this->_body);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a xml copy of the output of
|
||||
|
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -152,6 +152,7 @@ body:
|
||||
attributes:
|
||||
label: "Config: .env file"
|
||||
description: "Please copy and paste your `.env` file into this text area"
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
12
.github/ISSUE_TEMPLATE/config.yml
vendored
12
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,12 +1,18 @@
|
||||
---
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Devilbox Discord Chat
|
||||
url: https://discord.gg/2wP3V6kBj4
|
||||
about: Please notify or discuss about any other requests here.
|
||||
|
||||
- name: Devilbox Discourse Forum
|
||||
url: https://devilbox.discourse.group/
|
||||
about: Please ask and answer general questions here.
|
||||
|
||||
- name: Devilbox Community Support
|
||||
url: https://devilbox.discourse.group/
|
||||
about: Please ask and answer questions here.
|
||||
- name: Devilbox Gitter Chat
|
||||
url: https://gitter.im/devilbox/Lobby
|
||||
about: Please ask and answer questions here.
|
||||
|
||||
- name: Devilbox documentation
|
||||
url: https://devilbox.readthedocs.io/
|
||||
about: Find the Devilbox documentation here.
|
||||
|
2
.github/workflows/documentation.yml
vendored
2
.github/workflows/documentation.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
target:
|
||||
- build
|
||||
- linkcheck
|
||||
- linkcheck2
|
||||
# - linkcheck2
|
||||
|
||||
name: "[Docs ${{ matrix.target }}]"
|
||||
steps:
|
||||
|
4
.github/workflows/params-mysql.yml
vendored
4
.github/workflows/params-mysql.yml
vendored
@ -29,7 +29,9 @@ env:
|
||||
{"MYSQL_SERVER": "mariadb-10.5"},
|
||||
{"MYSQL_SERVER": "mariadb-10.6"},
|
||||
{"MYSQL_SERVER": "mariadb-10.7"},
|
||||
{"MYSQL_SERVER": "mariadb-10.8"}
|
||||
{"MYSQL_SERVER": "mariadb-10.8"},
|
||||
{"MYSQL_SERVER": "mariadb-10.9"},
|
||||
{"MYSQL_SERVER": "mariadb-10.10"}
|
||||
]
|
||||
|
||||
|
||||
|
2
.github/workflows/params-pgsql.yml
vendored
2
.github/workflows/params-pgsql.yml
vendored
@ -34,6 +34,8 @@ env:
|
||||
{"PGSQL_SERVER": "PgSQL 13-alpine"},
|
||||
{"PGSQL_SERVER": "PgSQL 14"},
|
||||
{"PGSQL_SERVER": "PgSQL 14-alpine"},
|
||||
{"PGSQL_SERVER": "PgSQL 15"},
|
||||
{"PGSQL_SERVER": "PgSQL 15-alpine"},
|
||||
{"PGSQL_SERVER": "PgSQL latest"},
|
||||
{"PGSQL_SERVER": "PgSQL alpine"}
|
||||
]
|
||||
|
2
.github/workflows/params-redis.yml
vendored
2
.github/workflows/params-redis.yml
vendored
@ -25,6 +25,8 @@ env:
|
||||
{"REDIS_SERVER": "Redis 6.0-alpine"},
|
||||
{"REDIS_SERVER": "Redis 6.2"},
|
||||
{"REDIS_SERVER": "Redis 6.2-alpine"},
|
||||
{"REDIS_SERVER": "Redis 7.0"},
|
||||
{"REDIS_SERVER": "Redis 7.0-alpine"},
|
||||
{"REDIS_SERVER": "Redis latest"},
|
||||
{"REDIS_SERVER": "Redis alpine"}
|
||||
]
|
||||
|
2
.github/workflows/zzz-reuse-tests.yml
vendored
2
.github/workflows/zzz-reuse-tests.yml
vendored
@ -76,7 +76,7 @@ jobs:
|
||||
cd "${GITHUB_WORKSPACE}/.tests/"
|
||||
|
||||
# Test full customization
|
||||
make configure KEY=DEBUG_COMPOSE_ENTRYPOINT VAL="$(( RANDOM % 3 ))"
|
||||
make configure KEY=DEBUG_ENTRYPOINT VAL="$(( RANDOM % 3 ))"
|
||||
make configure KEY=DOCKER_LOGS VAL="$(( RANDOM % 1 ))"
|
||||
make configure KEY=TLD_SUFFIX VAL=loc2
|
||||
make configure KEY=TIMEZONE VAL='Europe/Berlin'
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -50,9 +50,9 @@
|
||||
|
||||
|
||||
# Ignore custom global vhost gen templates
|
||||
/cfg/vhost-gen/apache22.conf
|
||||
/cfg/vhost-gen/apache24.conf
|
||||
/cfg/vhost-gen/nginx.conf
|
||||
/cfg/vhost-gen/apache22.yml
|
||||
/cfg/vhost-gen/apache24.yml
|
||||
/cfg/vhost-gen/nginx.yml
|
||||
|
||||
# Ignore custom HTTPD configs
|
||||
/cfg/apache-2.2/*.conf
|
||||
|
@ -6,12 +6,24 @@ endif
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Misc Targets
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
update-readme:
|
||||
.PHONY: update-readme
|
||||
update-readme: _update-readme-modules
|
||||
update-readme: _update-readme-tools
|
||||
|
||||
.PHONY: _update-readme-modules
|
||||
_update-readme-modules:
|
||||
cat "../README.md" \
|
||||
| perl -0 -pe "s#<!-- modules -->.*<!-- /modules -->#<!-- modules -->\n$$(./scripts/get-modules.sh)\n<!-- /modules -->#s" \
|
||||
> "../README.md.tmp"
|
||||
yes | mv -f "../README.md.tmp" "../README.md"
|
||||
|
||||
.PHONY: _update-readme-tools
|
||||
_update-readme-tools:
|
||||
cat "../README.md" \
|
||||
| perl -0 -pe "s#<!-- tools -->.*<!-- /tools -->#<!-- tools -->\n$$(./scripts/get-tools.sh)\n<!-- /tools -->#s" \
|
||||
> "../README.md.tmp"
|
||||
yes | mv -f "../README.md.tmp" "../README.md"
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Linting Targets
|
||||
@ -51,7 +63,7 @@ pull: ../.env
|
||||
###
|
||||
start: ../.env
|
||||
@$(MAKE) --no-print-directory configure KEY=HOST_PATH_HTTPD_DATADIR VAL=.tests/www
|
||||
@$(MAKE) --no-print-directory configure KEY=DEBUG_COMPOSE_ENTRYPOINT VAL=2
|
||||
@$(MAKE) --no-print-directory configure KEY=DEBUG_ENTRYPOINT VAL=3
|
||||
@$(MAKE) --no-print-directory configure KEY=NEW_UID VAL=$$(id -u)
|
||||
@$(MAKE) --no-print-directory configure KEY=NEW_GID VAL=$$(id -g)
|
||||
@$(PWD)/scripts/compose-start.sh
|
||||
|
@ -20,326 +20,70 @@ RETRIES=10
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
PHP_TAG="$( grep 'devilbox/php' "${DVLBOX_PATH}/docker-compose.yml" | sed 's/^.*-work-//g' )"
|
||||
PHP_MOD="$( run "curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/doc/php-modules.md'" "${RETRIES}" )";
|
||||
|
||||
|
||||
###
|
||||
### Get PHP core modules (5 rounds)
|
||||
###
|
||||
if ! PHP52_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '52-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.2"
|
||||
exit 1
|
||||
fi
|
||||
get_modules() {
|
||||
local php_version="${1}"
|
||||
local stage="${2}"
|
||||
local modules=
|
||||
local names=
|
||||
|
||||
if ! PHP53_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '53-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.3"
|
||||
exit 1
|
||||
fi
|
||||
modules="$( \
|
||||
echo "${PHP_MOD}" \
|
||||
| grep -E "ext_${stage}_.+_${php_version}" \
|
||||
| grep -v '><' \
|
||||
| sed \
|
||||
-e "s|.*ext_${stage}_||g" \
|
||||
-e "s|_${php_version}.*||g" \
|
||||
)"
|
||||
# Ensure to fetch name with correct upper-/lower-case
|
||||
while read -r module; do
|
||||
name="$( \
|
||||
echo "${PHP_MOD}" \
|
||||
| grep -Eio ">${module}<" \
|
||||
| sed -e 's|>||g' -e 's|<||g' \
|
||||
| sort -u \
|
||||
)"
|
||||
names="$( printf "%s\n%s" "${names}" "${name}" )"
|
||||
done < <(echo "${modules}")
|
||||
|
||||
if ! PHP54_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '54-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.4"
|
||||
exit 1
|
||||
fi
|
||||
# Remove leading and trailing newline
|
||||
names="$( echo "${names}" | grep -v '^$' )"
|
||||
|
||||
if ! PHP55_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '55-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.5"
|
||||
exit 1
|
||||
fi
|
||||
# Output comma separated
|
||||
echo "${names}" | paste -d, -s
|
||||
}
|
||||
|
||||
if ! PHP56_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '56-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.6"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP70_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '70-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.0"
|
||||
exit 1
|
||||
fi
|
||||
PHP52_BASE="$( get_modules "5.2" "base" )"
|
||||
PHP53_BASE="$( get_modules "5.3" "base" )"
|
||||
PHP54_BASE="$( get_modules "5.4" "base" )"
|
||||
PHP55_BASE="$( get_modules "5.5" "base" )"
|
||||
PHP56_BASE="$( get_modules "5.6" "base" )"
|
||||
PHP70_BASE="$( get_modules "7.0" "base" )"
|
||||
PHP71_BASE="$( get_modules "7.1" "base" )"
|
||||
PHP72_BASE="$( get_modules "7.2" "base" )"
|
||||
PHP73_BASE="$( get_modules "7.3" "base" )"
|
||||
PHP74_BASE="$( get_modules "7.4" "base" )"
|
||||
PHP80_BASE="$( get_modules "8.0" "base" )"
|
||||
PHP81_BASE="$( get_modules "8.1" "base" )"
|
||||
PHP82_BASE="$( get_modules "8.2" "base" )"
|
||||
|
||||
if ! PHP71_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '71-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.1"
|
||||
exit 1
|
||||
fi
|
||||
PHP52_MODS="$( get_modules "5.2" "mods" )"
|
||||
PHP53_MODS="$( get_modules "5.3" "mods" )"
|
||||
PHP54_MODS="$( get_modules "5.4" "mods" )"
|
||||
PHP55_MODS="$( get_modules "5.5" "mods" )"
|
||||
PHP56_MODS="$( get_modules "5.6" "mods" )"
|
||||
PHP70_MODS="$( get_modules "7.0" "mods" )"
|
||||
PHP71_MODS="$( get_modules "7.1" "mods" )"
|
||||
PHP72_MODS="$( get_modules "7.2" "mods" )"
|
||||
PHP73_MODS="$( get_modules "7.3" "mods" )"
|
||||
PHP74_MODS="$( get_modules "7.4" "mods" )"
|
||||
PHP80_MODS="$( get_modules "8.0" "mods" )"
|
||||
PHP81_MODS="$( get_modules "8.1" "mods" )"
|
||||
PHP82_MODS="$( get_modules "8.2" "mods" )"
|
||||
|
||||
if ! PHP72_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '72-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP73_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '73-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP74_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '74-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.4"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP80_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '80-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 8.0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP81_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '81-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 8.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP82_BASE="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '82-base' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 8.2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###
|
||||
### Get PHP mods modules (5 rounds)
|
||||
###
|
||||
|
||||
if ! PHP52_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '52-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP53_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '53-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP54_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '54-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.4"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP55_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '55-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.5"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP56_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '56-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 5.6"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP70_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '70-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP71_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '71-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP72_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '72-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP73_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '73-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP74_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '74-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 7.4"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP80_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '80-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 8.0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP81_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '81-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 8.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! PHP82_MODS="$( run "\
|
||||
curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/README.md' \
|
||||
| tac \
|
||||
| tac \
|
||||
| grep -E '82-mods' \
|
||||
| sed \
|
||||
-e 's/.*\">//g' \
|
||||
-e 's/<.*//g'" "${RETRIES}" )"; then
|
||||
>&2 echo "Failed to retrieve modules for PHP 8.2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###
|
||||
### Todo: add ioncube
|
||||
@ -350,7 +94,7 @@ MODS="$( echo "${PHP52_MODS}, ${PHP53_MODS}, ${PHP54_MODS}, ${PHP55_MODS}, ${PHP
|
||||
###
|
||||
### Get disabled modules
|
||||
###
|
||||
DISABLED=",blackfire,ioncube,phalcon,psr,$( grep -E '^PHP_MODULES_DISABLE=' "${DVLBOX_PATH}/env-example" | sed 's/.*=//g' ),"
|
||||
DISABLED=",blackfire,ioncube,phalcon,psr,xhprof,$( grep -E '^PHP_MODULES_DISABLE=' "${DVLBOX_PATH}/env-example" | sed 's/.*=//g' ),"
|
||||
#echo $DISABLED
|
||||
B="✔" # Enabled base modules (cannot be disabled)
|
||||
E="🗸" # Enabled mods modules (can be disabled)
|
||||
|
25
.tests/scripts/get-tools.sh
Executable file
25
.tests/scripts/get-tools.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# NOTE: Parsing curl to tac to circumnvent "failed writing body"
|
||||
# https://stackoverflow.com/questions/16703647/why-curl-return-and-error-23-failed-writing-body
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
SCRIPT_PATH="$( cd "$(dirname "$0")" && pwd -P )"
|
||||
DVLBOX_PATH="$( cd "${SCRIPT_PATH}/../.." && pwd -P )"
|
||||
# shellcheck disable=SC1090
|
||||
. "${SCRIPT_PATH}/.lib.sh"
|
||||
|
||||
RETRIES=10
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# FUNCTIONS
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
PHP_TAG="$( grep 'devilbox/php' "${DVLBOX_PATH}/docker-compose.yml" | sed 's/^.*-work-//g' )"
|
||||
PHP_TOOLS="$( run "curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/doc/available-tools.md'" "${RETRIES}" )";
|
||||
|
||||
echo "${PHP_TOOLS}" | grep -A 1000000 'TOOLS_WORK_START'
|
@ -14,7 +14,7 @@ DVLBOX_PATH="$( cd "${SCRIPT_PATH}/../.." && pwd -P )"
|
||||
|
||||
RETRIES=10
|
||||
# see framework-cakephp-php8.sh for PHP 8+ tests
|
||||
DISABLED_VERSIONS=("5.2" "5.3" "5.4" "5.5" "8.0" "8.1" "8.2")
|
||||
DISABLED_VERSIONS=("5.2" "5.3" "5.4" "5.5" "5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
|
||||
|
||||
PHP_VERSION="$( get_php_version "${DVLBOX_PATH}" )"
|
||||
|
||||
|
@ -13,7 +13,7 @@ DVLBOX_PATH="$( cd "${SCRIPT_PATH}/../.." && pwd -P )"
|
||||
. "${SCRIPT_PATH}/../scripts/.lib.sh"
|
||||
|
||||
RETRIES=10
|
||||
DISABLED_VERSIONS=("5.3" "5.4" "5.5" "5.6" "8.0" "8.1" "8.2")
|
||||
DISABLED_VERSIONS=("5.3" "5.4" "5.5" "5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
|
||||
DISABLED_MYSQL_VERSIONS=("mysql-8.0" "percona-8.0")
|
||||
|
||||
|
||||
|
@ -71,4 +71,4 @@ run "curl -sS --fail -XPOST 'http://localhost:${HOST_PORT_HTTPD}/mail.php' -d 'e
|
||||
# Validate
|
||||
run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/mail.php' | tac | tac | grep '${MY_MAIL}' >/dev/null" "${RETRIES}"
|
||||
run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/mail.php' | tac | tac | grep '${MY_SUBJ}' >/dev/null" "${RETRIES}"
|
||||
run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/mail.php' | tac | tac | grep '${MY_MESS}' >/dev/null" "${RETRIES}"
|
||||
run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/mail.php?get-body=1' | tac | tac | grep '${MY_MESS}' >/dev/null" "${RETRIES}"
|
||||
|
@ -54,7 +54,7 @@ fi
|
||||
HOST_PORT_HTTPD="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "HOST_PORT_HTTPD" )"
|
||||
TLD_SUFFIX="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "TLD_SUFFIX" )"
|
||||
HTTPD_DOCROOT_DIR="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "HTTPD_DOCROOT_DIR" )"
|
||||
HTTPD_TEMPLATE_DIR="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "HTTPD_TEMPLATE_DIR" )"
|
||||
#HTTPD_TEMPLATE_DIR="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "HTTPD_TEMPLATE_DIR" )"
|
||||
|
||||
|
||||
###
|
||||
@ -128,14 +128,14 @@ fi
|
||||
###
|
||||
### Vhost config link is available
|
||||
###
|
||||
printf "[TEST] vhost.d config link is available"
|
||||
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep 'vhost.d/${VHOST}.conf' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
printf "\\r[FAIL] vhost.d config link is available\\n"
|
||||
run "curl 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' || true"
|
||||
exit 1
|
||||
else
|
||||
printf "\\r[OK] vhost.d config link is available\\n"
|
||||
fi
|
||||
#printf "[TEST] vhost.d config link is available"
|
||||
#if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep 'vhost.d/${VHOST}.conf' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
# printf "\\r[FAIL] vhost.d config link is available\\n"
|
||||
# run "curl 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' || true"
|
||||
# exit 1
|
||||
#else
|
||||
# printf "\\r[OK] vhost.d config link is available\\n"
|
||||
#fi
|
||||
|
||||
|
||||
###
|
||||
@ -154,62 +154,62 @@ fi
|
||||
###
|
||||
### vhost-gen config link should appear
|
||||
###
|
||||
run "docker-compose exec --user devilbox -T php mkdir -p /shared/httpd/${VHOST}/${HTTPD_TEMPLATE_DIR}" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache22.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml" "${RETRIES}"
|
||||
run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache24.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml" "${RETRIES}"
|
||||
run "cp ${DVLBOX_PATH}/cfg/vhost-gen/nginx.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml" "${RETRIES}"
|
||||
|
||||
printf "[TEST] vhost-gen config link is available"
|
||||
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep 'info_vhostgen.php?name=${VHOST}' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
printf "\\r[FAIL] vhost-gen config link is available\\n"
|
||||
run "curl 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' || true"
|
||||
exit 1
|
||||
else
|
||||
printf "\\r[OK] vhost-gen config link is available\\n"
|
||||
fi
|
||||
#run "docker-compose exec --user devilbox -T php mkdir -p /shared/httpd/${VHOST}/${HTTPD_TEMPLATE_DIR}" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
#run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache22.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml" "${RETRIES}"
|
||||
#run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache24.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml" "${RETRIES}"
|
||||
#run "cp ${DVLBOX_PATH}/cfg/vhost-gen/nginx.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml" "${RETRIES}"
|
||||
#
|
||||
#printf "[TEST] vhost-gen config link is available"
|
||||
#if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep 'info_vhostgen.php?name=${VHOST}' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
# printf "\\r[FAIL] vhost-gen config link is available\\n"
|
||||
# run "curl 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' || true"
|
||||
# exit 1
|
||||
#else
|
||||
# printf "\\r[OK] vhost-gen config link is available\\n"
|
||||
#fi
|
||||
|
||||
|
||||
###
|
||||
### vhost-gen config should be available
|
||||
###
|
||||
printf "[TEST] vhost-gen config is available"
|
||||
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' | tac | tac | grep '__VHOST_NAME__' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
printf "\\r[FAIL] vhost-gen config is available\\n"
|
||||
run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' || true"
|
||||
exit 1
|
||||
else
|
||||
printf "\\r[OK] vhost-gen config is available\\n"
|
||||
fi
|
||||
#printf "[TEST] vhost-gen config is available"
|
||||
#if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' | tac | tac | grep '__VHOST_NAME__' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
# printf "\\r[FAIL] vhost-gen config is available\\n"
|
||||
# run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' || true"
|
||||
# exit 1
|
||||
#else
|
||||
# printf "\\r[OK] vhost-gen config is available\\n"
|
||||
#fi
|
||||
|
||||
|
||||
###
|
||||
### vhost-gen config changes are shown in intranet
|
||||
###
|
||||
replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml"
|
||||
replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml"
|
||||
replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml"
|
||||
|
||||
printf "[TEST] vhost-gen config changes are shown"
|
||||
if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' | tac | tac | grep '__MY_GREP_VALUE__' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
printf "\\r[FAIL] vhost-gen config changes are shown\\n"
|
||||
run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' || true"
|
||||
exit 1
|
||||
else
|
||||
printf "\\r[OK] vhost-gen config changes are shown\\n"
|
||||
fi
|
||||
#replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml"
|
||||
#replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml"
|
||||
#replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml"
|
||||
#
|
||||
#printf "[TEST] vhost-gen config changes are shown"
|
||||
#if ! run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' | tac | tac | grep '__MY_GREP_VALUE__' >/dev/null" "${RETRIES}" "" "0"; then
|
||||
# printf "\\r[FAIL] vhost-gen config changes are shown\\n"
|
||||
# run "curl 'http://localhost:${HOST_PORT_HTTPD}/info_vhostgen.php?name=${VHOST}' || true"
|
||||
# exit 1
|
||||
#else
|
||||
# printf "\\r[OK] vhost-gen config changes are shown\\n"
|
||||
#fi
|
||||
|
||||
|
||||
###
|
||||
### Vhost disappears after removing its dir
|
||||
###
|
||||
run "docker-compose exec --user devilbox -T php rm -rf /shared/httpd/${VHOST}" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "sleep 4"
|
||||
|
||||
printf "[TEST] vhost disappears after removing its dir"
|
||||
if ! run "test \"\$(curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep -c '${VHOST}')\" = \"0\"" "${RETRIES}" "" "0"; then
|
||||
printf "\\r[FAIL] vhost disappears after removing its dir\\n"
|
||||
run "curl 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep '${VHOST}' || true"
|
||||
exit 1
|
||||
else
|
||||
printf "\\r[OK] vhost disappears after removing its dir\\n"
|
||||
fi
|
||||
#run "docker-compose exec --user devilbox -T php rm -rf /shared/httpd/${VHOST}" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
#run "sleep 4"
|
||||
#
|
||||
#printf "[TEST] vhost disappears after removing its dir"
|
||||
#if ! run "test \"\$(curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep -c '${VHOST}')\" = \"0\"" "${RETRIES}" "" "0"; then
|
||||
# printf "\\r[FAIL] vhost disappears after removing its dir\\n"
|
||||
# run "curl 'http://localhost:${HOST_PORT_HTTPD}/vhosts.php' | tac | tac | grep '${VHOST}' || true"
|
||||
# exit 1
|
||||
#else
|
||||
# printf "\\r[OK] vhost disappears after removing its dir\\n"
|
||||
#fi
|
||||
|
205
CHANGELOG.md
205
CHANGELOG.md
@ -6,6 +6,211 @@ Make sure to have a look at [UPDATING.md](https://github.com/cytopia/devilbox/bl
|
||||
## Unreleased
|
||||
|
||||
|
||||
## Release v3.0.0-beta-0.3 (2022-01-02)
|
||||
|
||||
This release provides the `dvl.to` domain to be used with `TLD_SUFFIX` (set to default), which eliminates the need to set any entries in `/etc/hosts`, as all of its subdomain will point to `127.0.0.1` via official DNS. Domain has been acquired thanks to awesome sponsors!
|
||||
|
||||
### Fixed
|
||||
- Intranet: mail.php fixed deprecation warnings [#798](https://github.com/cytopia/devilbox/issues/798)
|
||||
- Added `host.docker.internal` to extra_hosts to be able to connect to the host system [#919](https://github.com/cytopia/devilbox/issues/919)
|
||||
|
||||
### Changed
|
||||
- Use `dvl.to` as default `TLD_SUFFIX` (it always poits to `127.0.0.1` removing the need to create `/etc/hosts` entries)
|
||||
|
||||
### Added
|
||||
- Intranet: vhost overview shows listening ports
|
||||
- Intranet: vhost overview now has modals to show httpd and vhost-gen configs
|
||||
- Docs: Show available tools per version in README.md
|
||||
- Added `xhprof` PHP extension
|
||||
|
||||
|
||||
## Release v3.0.0-beta-0.2 (2022-12-27)
|
||||
|
||||
The Backend configuration now supports websockets as well:
|
||||
|
||||
file: `/shared/httpd/<project>/.devilbox/backend.cfg`
|
||||
```bash
|
||||
# PHP-FPM backend
|
||||
conf:phpfpm:tcp:php80:9000
|
||||
|
||||
# HTTP Reverse Proxy backend
|
||||
conf:rproxy:http:172.16.238.10:3000
|
||||
|
||||
# HTTPS Reverse Proxy backend
|
||||
conf:rproxy:https:172.16.238.10:3000
|
||||
|
||||
# Websocket Reverse Proxy backend
|
||||
conf:rproxy:ws:172.16.238.10:3000
|
||||
|
||||
# SSL Websocket Reverse Proxy backend
|
||||
conf:rproxy:wss:172.16.238.10:3000
|
||||
```
|
||||
|
||||
Once you're done with `backend.cfg` changes, head over to the Intranet C&C page (http://localhost/cnc.php) and Reload `watcherd`.
|
||||
|
||||
|
||||
### Fixed
|
||||
- Intranet: vhost overview: allow HTTP 426 to succeed in vhost page (websocket projects)
|
||||
- Intranet: vhost overview: Reverse Proxy or Websocket backends do not require a `htdocs/` dir for healthcheck
|
||||
- Fixed reverse proxy template generation for Apache 2.2 and Apache 2.4 [vhost-gen #51](https://github.com/devilbox/vhost-gen/pull/51)
|
||||
- Fixed Nginx hash bucket size length to allow long hostnames
|
||||
|
||||
### Added
|
||||
- Reverse Proxy automation for websocket projects (`ws://<host>:<port>` or `wss:<host>:<port>`) (Does not work with Apache 2.2)
|
||||
- Added tool `wscat` to be able to test websocket connections
|
||||
- Intranet: show `wscat` version
|
||||
- Intranet: vhost overview now also shows websocket projects
|
||||
|
||||
### Changed
|
||||
- Do not mount any startup/autostart script directories for multi-php compose as they do not contain tools
|
||||
- Updated vhost-gen templates in `cfg/vhost-gen` (replace your project templates with new ones)
|
||||
|
||||
|
||||
## Release v3.0.0-beta-0.1 (2022-12-24) 🎅🎄🎁
|
||||
|
||||
This is a beta release, using a completely rewritten set of HTTPD server, which allow easy reverse Proxy integration and different PHP versions per project:
|
||||
|
||||
* https://github.com/devilbox/docker-nginx-stable/pull/55
|
||||
* https://github.com/devilbox/docker-nginx-mainline/pull/57
|
||||
* https://github.com/devilbox/docker-apache-2.2/pull/53
|
||||
* https://github.com/devilbox/docker-apache-2.4/pull/54
|
||||
|
||||
Once it has been tested by the community, and potential errors have been addressed, a new major version will be released.
|
||||
|
||||
**IMPORTANT:** This release required you to copy `env-example` over onto `.env` due to some changes in variables.
|
||||
|
||||
### TL;DR
|
||||
|
||||
1. **Multiple PHP Versions**<br/>
|
||||
Here is an example to run one project with a specific PHP version<br/>
|
||||
```bash
|
||||
# Enable all PHP versions
|
||||
cp compose/docker-compose.override.yml-php-multi.yml docker-compose.override.yml
|
||||
# Start default set and php80
|
||||
docker-compose up php httpd bind php80
|
||||
```
|
||||
file: `/shared/httpd/<project>/.devilbox/backend.cfg`
|
||||
```
|
||||
conf:phpfpm:tcp:php80:9000
|
||||
```
|
||||
2. **Automated Reverse Proxy setup**<br/>
|
||||
Here is an example to proxy one project to a backend service (e.g. NodeJS or Python application, which runs in the PHP container on port 3000)<br/>
|
||||
file: `/shared/httpd/<project>/.devilbox/backend.cfg`
|
||||
```
|
||||
conf:rproxy:http:127.0.0.1:3000
|
||||
```
|
||||
#### PHP hostnames and IP addresses
|
||||
|
||||
| PHP Version | Hostname | IP address |
|
||||
|-------------|----------|----------------|
|
||||
| 5.4 | php54 | 172.16.238.201 |
|
||||
| 5.5 | php55 | 172.16.238.202 |
|
||||
| 5.6 | php56 | 172.16.238.203 |
|
||||
| 7.0 | php70 | 172.16.238.204 |
|
||||
| 7.1 | php71 | 172.16.238.205 |
|
||||
| 7.2 | php72 | 172.16.238.206 |
|
||||
| 7.3 | php73 | 172.16.238.207 |
|
||||
| 7.4 | php74 | 172.16.238.208 |
|
||||
| 8.0 | php80 | 172.16.238.209 |
|
||||
| 8.1 | php81 | 172.16.238.210 |
|
||||
| 8.2 | php82 | 172.16.238.211 |
|
||||
|
||||
### Fixed
|
||||
- Fixed Protocol substitution bug in Reverse Proxy generation for Apache 2.2 and Apache 2.4 [vhost-gen #49](https://github.com/devilbox/vhost-gen/pull/49) [vhost-gen #50](https://github.com/devilbox/vhost-gen/pull/50)
|
||||
- Fixed missing module `mod_proxy_html` in Apache 2.4 as per requirement from `vhost-gen` for Reverse Proxy setup
|
||||
- Fixed encoding issue with Apache 2.4 Reverse Proxy by enabling `mod_xml2enc` module (Required by `mod_proxy_html`)
|
||||
- Allow to run different PHP versions per project. fixes [#146](https://github.com/cytopia/devilbox/issues/146)
|
||||
|
||||
### Added
|
||||
- New HTTPD server capable of auto reverse proxy creation (and different PHP versions per project)
|
||||
- Intranet: Added Command & Control center to view watcherd logs and retrigger config in case of vhost changes
|
||||
- Intranet: vhost page now also shows the configured Backend
|
||||
- Environment variable `DEVILBOX_HTTPD_MGMT_PASS`
|
||||
- Environment variable `DEVILBOX_HTTPD_MGMT_USER`
|
||||
- New Docker Compose Override file `docker-compose.override.yml-php-multi.yml` (allows to run multiple PHP versions).
|
||||
- Update Bind to latest version
|
||||
|
||||
### Changed
|
||||
- Disabled `psr` extension by default [php-psr #78](https://github.com/jbboehr/php-psr/issues/78#issuecomment-722290110)
|
||||
- Disabled `phalcon` extension by default
|
||||
- Environment variable `DEBUG_COMPOSE_ENTRYPOINT` renamed to `DEBUG_ENTRYPOINT`
|
||||
- Environment variable `HTTPD_TIMEOUT_TO_PHP_FPM` renamed to `HTTPD_BACKEND_TIMEOUT`
|
||||
|
||||
|
||||
## Release v2.4.0 (2022-12-18)
|
||||
|
||||
This release might be a bit bumpy due to a massive amount of changes in upstream projects. If you encounter issues, please do raise tickets.
|
||||
|
||||
### General
|
||||
|
||||
#### New PHP-FPM images
|
||||
This release uses a new set of PHP-FPM images. They have been heavily rewritten and modularized in order to make PHP extension and PHP tool generation more easy. See the following release notes for details:
|
||||
|
||||
> 499 changed files with 29,281 additions and 13,977 deletions.
|
||||
|
||||
* https://github.com/devilbox/docker-php-fpm/releases/tag/0.145
|
||||
* https://github.com/devilbox/docker-php-fpm/releases/tag/0.146
|
||||
* https://github.com/devilbox/docker-php-fpm/releases/tag/0.147
|
||||
|
||||
#### How to add modules/tools?
|
||||
* **[How to build PHP modules](https://github.com/devilbox/docker-php-fpm/blob/master/php_modules/README.md)**
|
||||
* **[How to install tools in PHP images](https://github.com/devilbox/docker-php-fpm/blob/master/php_tools/README.md)**
|
||||
|
||||
#### Available Tools
|
||||
You can now also find a detailed overview about what tools are installed in what PHP version image. See here: https://github.com/devilbox/docker-php-fpm/blob/master/doc/available-tools.md
|
||||
|
||||
#### Gitter -> Discord
|
||||
Additionally I am moving away from Gitter to **Discord**. See reason and announcement here: https://devilbox.discourse.group/t/migrating-from-gitter-to-discord/716/2
|
||||
|
||||
**🎮 Discord:** https://discord.gg/2wP3V6kBj4
|
||||
|
||||
### Fixed
|
||||
- Intranet: Fixed PostgreSQL database overview
|
||||
- Fixed PATH for all pre-installed composer and node tools
|
||||
|
||||
### Changed
|
||||
- Updated PHP versions (https://github.com/cytopia/devilbox/issues/940)
|
||||
- Updated MySQL versions
|
||||
- Intranet: Improved installed tools overview (index.php)
|
||||
- Intranet: Delayed message loading (https://github.com/cytopia/devilbox/pull/904)
|
||||
|
||||
### Added
|
||||
- Added tool `mhsendmail` for arm64 images
|
||||
- Added tool `wkhtmltopdf` for arm64 images (https://github.com/cytopia/devilbox/issues/936)
|
||||
- Added tool `taskfile` (https://github.com/cytopia/devilbox/issues/934)
|
||||
|
||||
### Removed
|
||||
- Removed tool `drush` (detail: https://github.com/cytopia/devilbox/issues/930#issuecomment-1344764908)
|
||||
|
||||
|
||||
## Release v2.3.0 (2022-12-04)
|
||||
|
||||
### Fixed
|
||||
- Fixed correct permission for `/opt/nvm` in PHP container [#499](https://github.com/cytopia/devilbox/issues/499), [#PHP-FPM 0.141](https://github.com/devilbox/docker-php-fpm/releases/tag/0.141)
|
||||
- Fixed Debian Jessie repository trust beyond EOL [#PHP-FPM 0.140](https://github.com/devilbox/docker-php-fpm/releases/tag/0.140)
|
||||
- Fixed phpPgAdmin to work with PostgreSQL 15
|
||||
|
||||
### Added
|
||||
- Added env var to Bind to specify overall memory consumption via `MAX_CACHE_SIZE` [#BIND 0.30](https://github.com/cytopia/docker-bind/releases/tag/0.30)
|
||||
- Added PHP extension: `lz4` [#PHP-FPM 0.144](https://github.com/devilbox/docker-php-fpm/releases/tag/0.144)
|
||||
- Added PHP extension: `lzf` [#PHP-FPM 0.144](https://github.com/devilbox/docker-php-fpm/releases/tag/0.144)
|
||||
- Added PHP extension: `zstd` [#PHP-FPM 0.144](https://github.com/devilbox/docker-php-fpm/releases/tag/0.144)
|
||||
- Added serializer to Redis extension: `lz4`, `lzf` and` zstd` [#PHP-FPM 0.144](https://github.com/devilbox/docker-php-fpm/releases/tag/0.144)
|
||||
- Added MariaDB 10.9 and 10.11 [#MYSQL 0.19](https://github.com/devilbox/docker-mysql/pull/24)
|
||||
- Added PGSQL 15
|
||||
- Added Redis 7.0
|
||||
|
||||
### Changed
|
||||
- Switched to `phalcon` 5.x extension for PHP 8.0 and PHP 8.1 [#913](https://github.com/cytopia/devilbox/issues/913), [#PHP-FPM 0.143](https://github.com/devilbox/docker-php-fpm/releases/tag/0.143)
|
||||
- Updated to latest minor versions of Apache 2.2, Apache 2.4, Nginx stable and Nginx mainline
|
||||
- Updated to latest minor versions of PHP [#917](https://github.com/cytopia/devilbox/issues/917)
|
||||
- Updated to latest minor versions of MySQL, MariaDB and Percona DB
|
||||
- Updated PHP extensions to lastest versions [#899](https://github.com/cytopia/devilbox/issues/899)
|
||||
|
||||
### Removed
|
||||
- Removed Phalcon DevTools for PHP 7.4 due to build error [#PHP-FPM 0.142](https://github.com/devilbox/docker-php-fpm/releases/tag/0.142)
|
||||
|
||||
|
||||
## Release v2.2.0 (2022-04-14)
|
||||
|
||||
This release adds PHP-FPM community images via `docker-compose.override.yml`, which easily allows you
|
||||
|
11
UPDATING.md
11
UPDATING.md
@ -3,6 +3,17 @@
|
||||
This document will hold all information on how to update between major versions.
|
||||
|
||||
|
||||
## Update from `v2.4.0` to `v3.0.0` (`v3.0.0-beta-1`)
|
||||
|
||||
**PR:** https://github.com/cytopia/devilbox/pull/942
|
||||
|
||||
This PR introduces new `.env` variables, so you are required to copy `env-example` over to `.env`.
|
||||
Also ensure to stop and remove containers.
|
||||
```bash
|
||||
docker-compose stop
|
||||
docker-compose rm -f
|
||||
```
|
||||
|
||||
## Update from `v1.8.1` to `v1.8.2`
|
||||
|
||||
**PR:** https://github.com/cytopia/devilbox/pull/750
|
||||
|
5
cfg/mariadb-10.10/devilbox-custom.cnf-example
Normal file
5
cfg/mariadb-10.10/devilbox-custom.cnf-example
Normal file
@ -0,0 +1,5 @@
|
||||
[mysqld]
|
||||
;key_buffer_size=16M
|
||||
|
||||
[mysqldump]
|
||||
;quick
|
5
cfg/mariadb-10.8/devilbox-custom.cnf-example
Normal file
5
cfg/mariadb-10.8/devilbox-custom.cnf-example
Normal file
@ -0,0 +1,5 @@
|
||||
[mysqld]
|
||||
;key_buffer_size=16M
|
||||
|
||||
[mysqldump]
|
||||
;quick
|
5
cfg/mariadb-10.9/devilbox-custom.cnf-example
Normal file
5
cfg/mariadb-10.9/devilbox-custom.cnf-example
Normal file
@ -0,0 +1,5 @@
|
||||
[mysqld]
|
||||
;key_buffer_size=16M
|
||||
|
||||
[mysqldump]
|
||||
;quick
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 5.3 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 5.4 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 5.5 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 5.6 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 7.0 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 7.1 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 7.2 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 7.3 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 7.4 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 8.0 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 8.1 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP-FPM config directory
|
||||
# PHP-FPM 8.2 config directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 5.2 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 5.3 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 5.4 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 5.5 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 5.6 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 7.0 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 7.1 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 7.2 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 7.3 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 7.4 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 8.0 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 8.1 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# PHP ini directory
|
||||
# PHP 8.2 ini directory
|
||||
|
||||
## General
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 5.2 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 5.3 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 5.4 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 5.5 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 5.6 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 7.0 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 7.1 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 7.2 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 7.3 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 7.4 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 8.0 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 8.1 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts (per PHP version)
|
||||
# Custom startup scripts (for PHP 8.2 only)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
|
@ -34,10 +34,23 @@
|
||||
# __ERROR_LOG__
|
||||
#
|
||||
|
||||
###
|
||||
### Notes about Apache
|
||||
###
|
||||
|
||||
#
|
||||
# 1. Each same directive is checked in order of definition (last one wins)
|
||||
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
|
||||
# * Last match always takes precedence
|
||||
#
|
||||
# Exception: Directories, where shortest path is matched first
|
||||
# Exception: ProxyPass and Alias first match and then stops
|
||||
|
||||
###
|
||||
### Basic vHost skeleton
|
||||
###
|
||||
### Note: Reverse Proxy section must be last for Apache 2.2
|
||||
###
|
||||
vhost: |
|
||||
<VirtualHost __DEFAULT_VHOST__:__PORT__>
|
||||
ServerName __VHOST_NAME__
|
||||
@ -45,11 +58,17 @@ vhost: |
|
||||
CustomLog "__ACCESS_LOG__" combined
|
||||
ErrorLog "__ERROR_LOG__"
|
||||
|
||||
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
|
||||
ProxyRequests On
|
||||
# ProxyRequests: Disable "Forward Proxy"
|
||||
# ProxyPreserveHost: Pass "Host" header to remote
|
||||
# ProxyVia: Add "Via" header
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyPass / http://php:8000/
|
||||
ProxyPassReverse / http://php:8000/
|
||||
ProxyVia On
|
||||
<Location />
|
||||
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
|
||||
ProxyPass http://php:8000/ retry=0
|
||||
ProxyPassReverse http://php:8000/
|
||||
</Location>
|
||||
|
||||
__REDIRECT__
|
||||
__SSL__
|
||||
@ -92,6 +111,7 @@ features:
|
||||
# Alias Definition
|
||||
Alias "__ALIAS__" "__PATH____ALIAS__"
|
||||
<Location "__ALIAS__">
|
||||
ProxyPass !
|
||||
__XDOMAIN_REQ__
|
||||
</Location>
|
||||
<Directory "__PATH____ALIAS__">
|
||||
@ -101,10 +121,10 @@ features:
|
||||
|
||||
deny: |
|
||||
# Deny Definition
|
||||
<FilesMatch "__REGEX__">
|
||||
<LocationMatch "__REGEX__">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
</LocationMatch>
|
||||
|
||||
server_status: |
|
||||
# Status Page
|
||||
@ -114,13 +134,16 @@ features:
|
||||
Allow from all
|
||||
</Location>
|
||||
|
||||
# https://stackoverflow.com/a/42558499
|
||||
# https://fetch.spec.whatwg.org/#forbidden-header-name
|
||||
xdomain_request: |
|
||||
# Allow cross domain request from these hosts
|
||||
SetEnvIf Origin "__REGEX__" AccessControlAllowOrigin=$0
|
||||
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS"
|
||||
Header always set Access-Control-Allow-Headers "Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With"
|
||||
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
|
||||
Header always set Access-Control-Max-Age "0"
|
||||
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||
|
@ -40,10 +40,23 @@
|
||||
# __PHP_PORT__
|
||||
#
|
||||
|
||||
###
|
||||
### Notes about Apache
|
||||
###
|
||||
|
||||
#
|
||||
# 1. Each same directive is checked in order of definition (last one wins)
|
||||
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
|
||||
# * Last match always takes precedence
|
||||
#
|
||||
# Exception: Directories, where shortest path is matched first
|
||||
# Exception: ProxyPass and Alias first match and then stops
|
||||
|
||||
###
|
||||
### Basic vHost skeleton
|
||||
###
|
||||
### Note: Reverse Proxy section must be last for Apache 2.2
|
||||
###
|
||||
vhost: |
|
||||
<VirtualHost __DEFAULT_VHOST__:__PORT__>
|
||||
ServerName __VHOST_NAME__
|
||||
@ -54,13 +67,13 @@ vhost: |
|
||||
__REDIRECT__
|
||||
__SSL__
|
||||
__VHOST_DOCROOT__
|
||||
__VHOST_RPROXY__
|
||||
__PHP_FPM__
|
||||
__ALIASES__
|
||||
__DENIES__
|
||||
__SERVER_STATUS__
|
||||
# Custom directives
|
||||
__CUSTOM__
|
||||
__VHOST_RPROXY__
|
||||
</VirtualHost>
|
||||
|
||||
###
|
||||
@ -84,13 +97,38 @@ vhost_type:
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
# Reverse Proxy (-r)
|
||||
# Reverse Proxy (-r http(s)://ADDR:PORT)
|
||||
rproxy: |
|
||||
# Define the vhost to reverse proxy
|
||||
ProxyRequests On
|
||||
# ProxyRequests: Disable "Forward Proxy"
|
||||
# ProxyPreserveHost: Pass "Host" header to remote
|
||||
# ProxyVia: Add "Via" header
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
|
||||
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
|
||||
ProxyVia On
|
||||
<Location __LOCATION__>
|
||||
# Reverse Proxy
|
||||
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
|
||||
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
|
||||
</Location>
|
||||
|
||||
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
|
||||
rproxy_ws: |
|
||||
# ProxyRequests: Disable "Forward Proxy"
|
||||
# ProxyPreserveHost: Pass "Host" header to remote
|
||||
# ProxyVia: Add "Via" header
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyVia On
|
||||
<Location __LOCATION__>
|
||||
# Websocket Rewrite Settings
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTP:Connection} Upgrade [NC]
|
||||
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||
RewriteRule ^/?(.*)$ __WS_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/$1 [P,L]
|
||||
# Reverse Proxy
|
||||
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
|
||||
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
|
||||
</Location>
|
||||
|
||||
|
||||
###
|
||||
@ -120,6 +158,7 @@ features:
|
||||
# Alias Definition
|
||||
Alias "__ALIAS__" "__PATH____ALIAS__"
|
||||
<Location "__ALIAS__">
|
||||
ProxyPass !
|
||||
__XDOMAIN_REQ__
|
||||
</Location>
|
||||
<Directory "__PATH____ALIAS__">
|
||||
@ -129,10 +168,10 @@ features:
|
||||
|
||||
deny: |
|
||||
# Deny Definition
|
||||
<FilesMatch "__REGEX__">
|
||||
<LocationMatch "__REGEX__">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
</LocationMatch>
|
||||
|
||||
server_status: |
|
||||
# Status Page
|
||||
@ -142,13 +181,16 @@ features:
|
||||
Allow from all
|
||||
</Location>
|
||||
|
||||
# https://stackoverflow.com/a/42558499
|
||||
# https://fetch.spec.whatwg.org/#forbidden-header-name
|
||||
xdomain_request: |
|
||||
# Allow cross domain request from these hosts
|
||||
SetEnvIf Origin "__REGEX__" AccessControlAllowOrigin=$0
|
||||
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS"
|
||||
Header always set Access-Control-Allow-Headers "Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With"
|
||||
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
|
||||
Header always set Access-Control-Max-Age "0"
|
||||
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||
|
@ -34,6 +34,17 @@
|
||||
# __ERROR_LOG__
|
||||
#
|
||||
|
||||
###
|
||||
### Notes about Apache
|
||||
###
|
||||
|
||||
#
|
||||
# 1. Each same directive is checked in order of definition (last one wins)
|
||||
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
|
||||
# * Last match always takes precedence
|
||||
#
|
||||
# Exception: Directories, where shortest path is matched first
|
||||
# Exception: ProxyPass and Alias first match and then stops
|
||||
|
||||
###
|
||||
### Basic vHost skeleton
|
||||
@ -46,11 +57,19 @@ vhost: |
|
||||
CustomLog "__ACCESS_LOG__" combined
|
||||
ErrorLog "__ERROR_LOG__"
|
||||
|
||||
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
|
||||
ProxyRequests On
|
||||
# ProxyRequests: Disable "Forward Proxy"
|
||||
# ProxyPreserveHost: Pass "Host" header to remote
|
||||
# ProxyAddHeaders: Add "X-Forward-*" headers
|
||||
# ProxyVia: Add "Via" header
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyPass / http://php:8000/
|
||||
ProxyPassReverse / http://php:8000/
|
||||
ProxyAddHeaders On
|
||||
ProxyVia On
|
||||
<Location />
|
||||
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
|
||||
ProxyPass http://php:8000/ retry=0
|
||||
ProxyPassReverse http://php:8000/
|
||||
</Location>
|
||||
|
||||
__REDIRECT__
|
||||
__SSL__
|
||||
@ -93,6 +112,7 @@ features:
|
||||
# Alias Definition
|
||||
Alias "__ALIAS__" "__PATH____ALIAS__"
|
||||
<Location "__ALIAS__">
|
||||
ProxyPass !
|
||||
__XDOMAIN_REQ__
|
||||
</Location>
|
||||
<Directory "__PATH____ALIAS__">
|
||||
@ -103,10 +123,10 @@ features:
|
||||
|
||||
deny: |
|
||||
# Deny Definition
|
||||
<FilesMatch "__REGEX__">
|
||||
<LocationMatch "__REGEX__">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
</LocationMatch>
|
||||
|
||||
server_status: |
|
||||
# Status Page
|
||||
@ -117,13 +137,16 @@ features:
|
||||
Require all granted
|
||||
</Location>
|
||||
|
||||
# https://stackoverflow.com/a/42558499
|
||||
# https://fetch.spec.whatwg.org/#forbidden-header-name
|
||||
xdomain_request: |
|
||||
# Allow cross domain request from these hosts
|
||||
SetEnvIf Origin "__REGEX__" AccessControlAllowOrigin=$0
|
||||
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS"
|
||||
Header always set Access-Control-Allow-Headers "Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With"
|
||||
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
|
||||
Header always set Access-Control-Max-Age "0"
|
||||
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||
|
@ -40,6 +40,17 @@
|
||||
# __PHP_PORT__
|
||||
#
|
||||
|
||||
###
|
||||
### Notes about Apache
|
||||
###
|
||||
|
||||
#
|
||||
# 1. Each same directive is checked in order of definition (last one wins)
|
||||
# 2. Directives are ordered: Directory, DirectoryMatch, Files, and finally Location (last one wins)
|
||||
# * Last match always takes precedence
|
||||
#
|
||||
# Exception: Directories, where shortest path is matched first
|
||||
# Exception: ProxyPass and Alias first match and then stops
|
||||
|
||||
###
|
||||
### Basic vHost skeleton
|
||||
@ -86,13 +97,42 @@ vhost_type:
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
# Reverse Proxy (-r)
|
||||
# Reverse Proxy (-r http(s)://ADDR:PORT)
|
||||
rproxy: |
|
||||
# Define the vhost to reverse proxy
|
||||
ProxyRequests On
|
||||
# ProxyRequests: Disable "Forward Proxy"
|
||||
# ProxyPreserveHost: Pass "Host" header to remote
|
||||
# ProxyAddHeaders: Add "X-Forward-*" headers
|
||||
# ProxyVia: Add "Via" header
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyPass __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
|
||||
ProxyPassReverse __LOCATION__ __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT____LOCATION__
|
||||
ProxyAddHeaders On
|
||||
ProxyVia On
|
||||
<Location __LOCATION__>
|
||||
# Reverse Proxy
|
||||
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
|
||||
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
|
||||
</Location>
|
||||
|
||||
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
|
||||
rproxy_ws: |
|
||||
# ProxyRequests: Disable "Forward Proxy"
|
||||
# ProxyPreserveHost: Pass "Host" header to remote
|
||||
# ProxyAddHeaders: Add "X-Forward-*" headers
|
||||
# ProxyVia: Add "Via" header
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyAddHeaders On
|
||||
ProxyVia On
|
||||
<Location __LOCATION__>
|
||||
# Websocket Rewrite Settings
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTP:Connection} Upgrade [NC]
|
||||
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||
RewriteRule ^/?(.*)$ __WS_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/$1 [P,L]
|
||||
# Reverse Proxy
|
||||
ProxyPass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/ retry=0
|
||||
ProxyPassReverse __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__/
|
||||
</Location>
|
||||
|
||||
|
||||
###
|
||||
@ -141,6 +181,7 @@ features:
|
||||
# Alias Definition
|
||||
Alias "__ALIAS__" "__PATH____ALIAS__"
|
||||
<Location "__ALIAS__">
|
||||
ProxyPass !
|
||||
__XDOMAIN_REQ__
|
||||
</Location>
|
||||
<Directory "__PATH____ALIAS__">
|
||||
@ -151,10 +192,10 @@ features:
|
||||
|
||||
deny: |
|
||||
# Deny Definition
|
||||
<FilesMatch "__REGEX__">
|
||||
<LocationMatch "__REGEX__">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</FilesMatch>
|
||||
</LocationMatch>
|
||||
|
||||
server_status: |
|
||||
# Status Page
|
||||
@ -165,13 +206,16 @@ features:
|
||||
Require all granted
|
||||
</Location>
|
||||
|
||||
# https://stackoverflow.com/a/42558499
|
||||
# https://fetch.spec.whatwg.org/#forbidden-header-name
|
||||
xdomain_request: |
|
||||
# Allow cross domain request from these hosts
|
||||
SetEnvIf Origin "__REGEX__" AccessControlAllowOrigin=$0
|
||||
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
|
||||
Header always set Access-Control-Allow-Methods "HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS"
|
||||
Header always set Access-Control-Allow-Headers "Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With"
|
||||
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
|
||||
Header always set Access-Control-Max-Age "0"
|
||||
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||
|
@ -48,8 +48,11 @@ vhost: |
|
||||
|
||||
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# https://stackoverflow.com/a/72586833
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# Proxy connection
|
||||
proxy_pass http://php:8000;
|
||||
}
|
||||
|
||||
@ -111,11 +114,12 @@ features:
|
||||
|
||||
xdomain_request: |
|
||||
# Allow cross domain request from these hosts
|
||||
# https://fetch.spec.whatwg.org/#forbidden-header-name
|
||||
if ( $http_origin ~* (__REGEX__) ) {
|
||||
add_header "Access-Control-Allow-Origin" "$http_origin";
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
||||
add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
||||
add_header "Access-Control-Allow-Origin" "$http_origin";
|
||||
add_header 'Access-Control-Allow-Methods' 'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With';
|
||||
add_header 'Access-Control-Expose-Headers' 'Content-Security-Policy, Location';
|
||||
add_header 'Access-Control-Max-Age' 0;
|
||||
return 200;
|
||||
}
|
||||
|
@ -75,12 +75,31 @@ vhost_type:
|
||||
root "__DOCUMENT_ROOT__";
|
||||
index __INDEX__;
|
||||
|
||||
# Reverse Proxy (-r)
|
||||
# Reverse Proxy (-r http(s)://ADDR:PORT)
|
||||
rproxy: |
|
||||
# Define the vhost to reverse proxy
|
||||
# Define Reverse Proxy
|
||||
location __LOCATION__ {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# https://stackoverflow.com/a/72586833
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# Proxy connection
|
||||
proxy_pass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__;
|
||||
}
|
||||
|
||||
# Reverse Proxy with websocket support (-r ws(s)://ADDR:PORT)
|
||||
rproxy_ws: |
|
||||
# Define Reverse Proxy with Websock support
|
||||
location __LOCATION__ {
|
||||
# https://stackoverflow.com/a/72586833
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# Websocket settings
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
# Proxy connection
|
||||
proxy_pass __PROXY_PROTO__://__PROXY_ADDR__:__PROXY_PORT__;
|
||||
}
|
||||
|
||||
@ -147,11 +166,12 @@ features:
|
||||
|
||||
xdomain_request: |
|
||||
# Allow cross domain request from these hosts
|
||||
# https://fetch.spec.whatwg.org/#forbidden-header-name
|
||||
if ( $http_origin ~* (__REGEX__) ) {
|
||||
add_header "Access-Control-Allow-Origin" "$http_origin";
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
||||
add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
|
||||
add_header "Access-Control-Allow-Origin" "$http_origin";
|
||||
add_header 'Access-Control-Allow-Methods' 'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With';
|
||||
add_header 'Access-Control-Expose-Headers' 'Content-Security-Policy, Location';
|
||||
add_header 'Access-Control-Max-Age' 0;
|
||||
return 200;
|
||||
}
|
||||
|
@ -219,13 +219,13 @@ print_head_1 "Checking .env file values"
|
||||
|
||||
WRONG_ENV_FILES_VALUES=0
|
||||
|
||||
DEBUG_COMPOSE_ENTRYPOINT="$( get_env_value "DEBUG_COMPOSE_ENTRYPOINT" )"
|
||||
if [ "${DEBUG_COMPOSE_ENTRYPOINT}" != "0" ] && [ "${DEBUG_COMPOSE_ENTRYPOINT}" != "1" ] && [ "${DEBUG_COMPOSE_ENTRYPOINT}" != "2" ]; then
|
||||
log_err "Variable 'DEBUG_COMPOSE_ENTRYPOINT' should be 0, 1 or 2. Has: ${DEBUG_COMPOSE_ENTRYPOINT}"
|
||||
DEBUG_ENTRYPOINT="$( get_env_value "DEBUG_ENTRYPOINT" )"
|
||||
if [ "${DEBUG_ENTRYPOINT}" != "0" ] && [ "${DEBUG_ENTRYPOINT}" != "1" ] && [ "${DEBUG_ENTRYPOINT}" != "2" ] && [ "${DEBUG_ENTRYPOINT}" != "3" ] && [ "${DEBUG_ENTRYPOINT}" != "4" ]; then
|
||||
log_err "Variable 'DEBUG_ENTRYPOINT' should be 0, 1, 2, 3 or 4. Has: ${DEBUG_ENTRYPOINT}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DEBUG_COMPOSE_ENTRYPOINT' has correct value: ${DEBUG_COMPOSE_ENTRYPOINT}"
|
||||
log_debug "Variable 'DEBUG_ENTRYPOINT' has correct value: ${DEBUG_ENTRYPOINT}"
|
||||
fi
|
||||
|
||||
DOCKER_LOGS="$( get_env_value "DOCKER_LOGS" )"
|
||||
@ -430,7 +430,7 @@ fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Ensure cfg/, mod/ and log/ directories exist
|
||||
# Ensure cfg/ and log/ directories exist
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking required Devilbox core directories exist"
|
||||
|
||||
@ -464,21 +464,6 @@ if [ "${DIR_MISSING}" = "0" ]; then
|
||||
log_ok "All PHP log/ sub directories are present"
|
||||
fi
|
||||
|
||||
# /mod/php-fpm-VERSION
|
||||
DIR_MISSING=0
|
||||
while read -r php_version; do
|
||||
if [ ! -d "mod/php-fpm-${php_version}" ]; then
|
||||
log_err "Directory 'mod/php-fpm-${php_version}' is missing"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DIR_MISSING=1
|
||||
else
|
||||
log_debug "Directory 'mod/php-fpm-${php_version}' is present"
|
||||
fi
|
||||
done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
if [ "${DIR_MISSING}" = "0" ]; then
|
||||
log_ok "All PHP mod/ sub directories are present"
|
||||
fi
|
||||
|
||||
# /cfg/apache|nginx-VERSION
|
||||
DIR_MISSING=0
|
||||
while read -r httpd_version; do
|
||||
@ -522,7 +507,6 @@ DEVILBOX_DIRS=(
|
||||
"cfg"
|
||||
"compose"
|
||||
"log"
|
||||
"mod"
|
||||
"supervisor"
|
||||
)
|
||||
|
||||
@ -591,7 +575,6 @@ DEVILBOX_DIRS=(
|
||||
"ca"
|
||||
"cfg"
|
||||
"compose"
|
||||
"mod"
|
||||
"supervisor"
|
||||
)
|
||||
|
||||
|
@ -243,6 +243,26 @@ services:
|
||||
- bind
|
||||
- httpd
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
# Meilisearch
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:${MEILI_SERVER:-latest}
|
||||
hostname: meilisearch
|
||||
command: meilisearch
|
||||
environment:
|
||||
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY-""}
|
||||
ports:
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MEILI:-7700}:7700"
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.203
|
||||
volumes:
|
||||
- devilbox-meilisearch:/meili_data
|
||||
depends_on:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
|
||||
###
|
||||
### Volumes
|
||||
@ -252,3 +272,4 @@ volumes:
|
||||
devilbox-solr:
|
||||
devilbox-elastic:
|
||||
devilbox-logstash:
|
||||
devilbox-meilisearch:
|
||||
|
29
compose/docker-compose.override.yml-meilisearch
Normal file
29
compose/docker-compose.override.yml-meilisearch
Normal file
@ -0,0 +1,29 @@
|
||||
# vim: set ft=yaml:
|
||||
---
|
||||
version: '2.3'
|
||||
|
||||
services:
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
# Meilisearch
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:${MEILI_SERVER:-latest}
|
||||
hostname: meilisearch
|
||||
command: meilisearch
|
||||
environment:
|
||||
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY-""}
|
||||
ports:
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_MEILI:-7700}:7700"
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.203
|
||||
volumes:
|
||||
- devilbox-meilisearch:/meili_data
|
||||
depends_on:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
|
||||
volumes:
|
||||
devilbox-meilisearch:
|
231
compose/docker-compose.override.yml-php-multi.yml
Normal file
231
compose/docker-compose.override.yml-php-multi.yml
Normal file
@ -0,0 +1,231 @@
|
||||
# vim: set ft=yaml:
|
||||
---
|
||||
version: '2.3'
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Yaml Default
|
||||
# ------------------------------------------------------------
|
||||
|
||||
###
|
||||
### Default PHP-FPM config
|
||||
###
|
||||
x-app: &default-php
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
# Debug/Logging
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2}
|
||||
- DOCKER_LOGS=1
|
||||
# Enable/Disable PHP Modules
|
||||
- ENABLE_MODULES=${PHP_MODULES_ENABLE}
|
||||
- DISABLE_MODULES=${PHP_MODULES_DISABLE}
|
||||
# Mail-catching
|
||||
- ENABLE_MAIL=${PHP_MAIL_CATCH_ALL:-2}
|
||||
dns:
|
||||
- 172.16.238.100
|
||||
depends_on:
|
||||
- bind
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# PHP Services
|
||||
# ------------------------------------------------------------
|
||||
services:
|
||||
|
||||
php54:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:5.4-prod-0.150
|
||||
hostname: php54
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.201
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-5.4:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-5.4:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-5.4:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php55:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:5.5-prod-0.150
|
||||
hostname: php55
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.202
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-5.5:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-5.5:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-5.5:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php56:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:5.6-prod-0.150
|
||||
hostname: php56
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.203
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-5.6:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-5.6:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-5.6:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php70:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:7.0-prod-0.150
|
||||
hostname: php70
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.204
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-7.0:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-7.0:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-7.0:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php71:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:7.1-prod-0.150
|
||||
hostname: php71
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.205
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-7.1:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-7.1:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-7.1:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php72:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:7.2-prod-0.150
|
||||
hostname: php72
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.206
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-7.2:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-7.2:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-7.2:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php73:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:7.3-prod-0.150
|
||||
hostname: php73
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.207
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-7.3:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-7.3:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-7.3:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php74:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:7.4-prod-0.150
|
||||
hostname: php74
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.208
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-7.4:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-7.4:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-7.4:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php80:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:8.0-prod-0.150
|
||||
hostname: php80
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.209
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-8.0:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-8.0:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-8.0:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php81:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:8.1-prod-0.150
|
||||
hostname: php81
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.210
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-8.1:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-8.1:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-8.1:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
php82:
|
||||
<<: *default-php
|
||||
image: devilbox/php-fpm:8.2-prod-0.150
|
||||
hostname: php82
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.211
|
||||
volumes:
|
||||
# Specific volumes
|
||||
- ${DEVILBOX_PATH}/cfg/php-ini-8.2:/etc/php-custom.d:ro${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-8.2:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/cfg/php-startup-8.2:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
# Generic volumes
|
||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
# - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
@ -34,7 +34,7 @@ services:
|
||||
# Bind (DNS Server)
|
||||
# ------------------------------------------------------------
|
||||
bind:
|
||||
image: cytopia/bind:alpine-0.28
|
||||
image: cytopia/bind:alpine-0.35
|
||||
hostname: bind
|
||||
restart: always
|
||||
ports:
|
||||
@ -46,7 +46,12 @@ services:
|
||||
##
|
||||
## Debug?
|
||||
##
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2}
|
||||
|
||||
##
|
||||
## Memory consumption
|
||||
##
|
||||
- MAX_CACHE_SIZE=${BIND_MAX_CACHE_SIZE:-90%}
|
||||
|
||||
##
|
||||
## Bind wildcard/host settings
|
||||
@ -84,6 +89,7 @@ services:
|
||||
extra_hosts:
|
||||
docker.for.lin.host.internal: 172.16.238.1
|
||||
docker.for.lin.localhost: 172.16.238.1
|
||||
host.docker.internal: host-gateway
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
@ -94,7 +100,7 @@ services:
|
||||
# PHP
|
||||
# ------------------------------------------------------------
|
||||
php:
|
||||
image: devilbox/php-fpm:${PHP_SERVER}-work-0.139
|
||||
image: devilbox/php-fpm:${PHP_SERVER}-work-0.150
|
||||
hostname: php
|
||||
|
||||
##
|
||||
@ -107,11 +113,17 @@ services:
|
||||
- ./.env
|
||||
|
||||
environment:
|
||||
##
|
||||
## Supervisord Management (to connect to HTTPD supvervisord)
|
||||
##
|
||||
- SVCTL_LISTEN_PORT=9001
|
||||
- SVCTL_USER=${DEVILBOX_HTTPD_MGMT_USER:-supervisor}
|
||||
- SVCTL_PASS=${DEVILBOX_HTTPD_MGMT_PASS:-mypassword}
|
||||
|
||||
##
|
||||
## Debug/Logging
|
||||
##
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||
- DEBUG_COMPOSE_ENTRYPOINT
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2}
|
||||
- DOCKER_LOGS
|
||||
|
||||
##
|
||||
@ -160,6 +172,7 @@ services:
|
||||
extra_hosts:
|
||||
docker.for.lin.host.internal: 172.16.238.1
|
||||
docker.for.lin.localhost: 172.16.238.1
|
||||
host.docker.internal: host-gateway
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
@ -192,10 +205,6 @@ services:
|
||||
# to overwrite the default PHP-FPM configuration
|
||||
- ${DEVILBOX_PATH}/cfg/php-fpm-${PHP_SERVER}:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS}
|
||||
|
||||
# Mount devilbox user-defined *.so files in order
|
||||
# to load custom PHP modules
|
||||
- ${DEVILBOX_PATH}/mod/php-fpm-${PHP_SERVER}:/usr/lib64/php/custom-modules:ro${MOUNT_OPTIONS}
|
||||
|
||||
# Mount devilbox user-defined PHP-FPM startup *.sh scripts
|
||||
- ${DEVILBOX_PATH}/cfg/php-startup-${PHP_SERVER}:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
@ -220,16 +229,26 @@ services:
|
||||
# Web Server
|
||||
# ------------------------------------------------------------
|
||||
httpd:
|
||||
image: devilbox/${HTTPD_SERVER}:${HTTPD_FLAVOUR:-alpine}-0.47
|
||||
image: devilbox/${HTTPD_SERVER}:${HTTPD_FLAVOUR:-alpine}-1.0
|
||||
hostname: httpd
|
||||
|
||||
environment:
|
||||
|
||||
##
|
||||
## Supervisord Management
|
||||
##
|
||||
- SVCTL_ENABLE=1
|
||||
- SVCTL_LISTEN_ADDR=0.0.0.0
|
||||
- SVCTL_LISTEN_PORT=9001
|
||||
- SVCTL_REMOTE_LOGS_ENABLE=1
|
||||
- SVCTL_USER=${DEVILBOX_HTTPD_MGMT_USER:-supervisor}
|
||||
- SVCTL_PASS=${DEVILBOX_HTTPD_MGMT_PASS:-mypassword}
|
||||
|
||||
##
|
||||
## Debug/Logging
|
||||
##
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||
- DEBUG_RUNTIME=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2}
|
||||
- DEBUG_RUNTIME=1
|
||||
- DOCKER_LOGS
|
||||
|
||||
##
|
||||
@ -263,25 +282,23 @@ services:
|
||||
- MAIN_VHOST_SSL_TYPE=${HTTPD_VHOST_SSL_TYPE:-both}
|
||||
- MAIN_VHOST_SSL_GEN=1
|
||||
- MAIN_VHOST_SSL_CN=${DEVILBOX_UI_SSL_CN:-localhost}
|
||||
- MAIN_VHOST_BACKEND=conf:phpfpm:tcp:172.16.238.10:9000
|
||||
- MAIN_VHOST_BACKEND_TIMEOUT=${HTTPD_BACKEND_TIMEOUT:-180}
|
||||
- MAIN_VHOST_ALIASES_ALLOW=/devilbox-api/:/var/www/default/api, /vhost.d/:/etc/httpd
|
||||
|
||||
##
|
||||
## Enable Mass Vhosts
|
||||
##
|
||||
- MASS_VHOST_ENABLE=1
|
||||
- MASS_VHOST_TLD=.${TLD_SUFFIX}
|
||||
- MASS_VHOST_DOCROOT=${HTTPD_DOCROOT_DIR}
|
||||
- MASS_VHOST_TPL=${HTTPD_TEMPLATE_DIR}
|
||||
- MASS_VHOST_TLD_SUFFIX=.${TLD_SUFFIX}
|
||||
- MASS_VHOST_DOCROOT_DIR=${HTTPD_DOCROOT_DIR}
|
||||
- MASS_VHOST_TEMPLATE_DIR=${HTTPD_TEMPLATE_DIR}
|
||||
- MASS_VHOST_SSL_TYPE=${HTTPD_VHOST_SSL_TYPE:-both}
|
||||
- MASS_VHOST_SSL_GEN=1
|
||||
|
||||
##
|
||||
## PHP-FPM Remote Server
|
||||
##
|
||||
- COMPAT=${PHP_SERVER}
|
||||
- PHP_FPM_ENABLE=1
|
||||
- PHP_FPM_SERVER_ADDR=172.16.238.10
|
||||
- PHP_FPM_SERVER_PORT=9000
|
||||
- PHP_FPM_TIMEOUT=${HTTPD_TIMEOUT_TO_PHP_FPM:-180}
|
||||
- MASS_VHOST_BACKEND=conf:phpfpm:tcp:172.16.238.10:9000
|
||||
- MASS_VHOST_BACKEND_REWRITE=file:backend.cfg
|
||||
- MASS_VHOST_BACKEND_TIMEOUT=${HTTPD_BACKEND_TIMEOUT:-180}
|
||||
- MASS_VHOST_ALIASES_ALLOW=/devilbox-api/:/var/www/default/api:http(s)?://(.*)$$
|
||||
|
||||
ports:
|
||||
# ---- Format: ----
|
||||
@ -310,7 +327,7 @@ services:
|
||||
- ${DEVILBOX_PATH}/cfg/vhost-gen:/etc/vhost-gen.d:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Mount logs
|
||||
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/httpd:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Certificate Authority public key
|
||||
- ${DEVILBOX_PATH}/ca:/ca:rw${MOUNT_OPTIONS}
|
||||
@ -324,7 +341,7 @@ services:
|
||||
# MySQL Database
|
||||
# ------------------------------------------------------------
|
||||
mysql:
|
||||
image: devilbox/mysql:${MYSQL_SERVER}-0.15
|
||||
image: devilbox/mysql:${MYSQL_SERVER}-0.21
|
||||
hostname: mysql
|
||||
|
||||
environment:
|
||||
@ -508,6 +525,8 @@ volumes:
|
||||
devilbox-mariadb-10.6:
|
||||
devilbox-mariadb-10.7:
|
||||
devilbox-mariadb-10.8:
|
||||
devilbox-mariadb-10.9:
|
||||
devilbox-mariadb-10.10:
|
||||
devilbox-percona-5.5:
|
||||
devilbox-percona-5.6:
|
||||
devilbox-percona-5.7:
|
||||
@ -538,6 +557,8 @@ volumes:
|
||||
devilbox-pgsql-13-alpine:
|
||||
devilbox-pgsql-14:
|
||||
devilbox-pgsql-14-alpine:
|
||||
devilbox-pgsql-15:
|
||||
devilbox-pgsql-15-alpine:
|
||||
devilbox-pgsql-latest:
|
||||
devilbox-pgsql-alpine:
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
.. |ext_lnk_doc_bind_soa| raw:: html
|
||||
|
||||
<a target="_blank" href="https://bind9.readthedocs.io/en/latest/introduction.html?highlight=soa#secondary-servers">
|
||||
BIND SOA <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
<a target="_blank" href="https://bind9.readthedocs.io/en/latest/reference.html">
|
||||
BIND Reference <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_doc_wiki_database_timezones| raw:: html
|
||||
@ -135,3 +135,16 @@
|
||||
<a target="_blank" href="https://github.com/elastic/kibana">
|
||||
GitHub: Kibana <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_meilisearch_github| raw:: html
|
||||
|
||||
<a target="_blank" href="https://github.com/meilisearch/meilisearch">
|
||||
Github: Meilisearch <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_meilisearch_dockerhub| raw:: html
|
||||
|
||||
<a target="_blank" href="https://hub.docker.com/r/getmeili/meilisearch">
|
||||
Dockerhub: Meilisearch <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
|
@ -4,7 +4,13 @@
|
||||
Official CakePHP Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_example_codeignitor_documentation| raw:: html
|
||||
.. |ext_lnk_example_codeigniter_documentation| raw:: html
|
||||
|
||||
<a target="_blank" href="https://www.codeigniter.com/userguide3/installation/index.html">
|
||||
Official CodeIgniter Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_example_codeigniter4_documentation| raw:: html
|
||||
|
||||
<a target="_blank" href="https://www.codeigniter.com/user_guide/installation/index.html">
|
||||
Official CodeIgniter Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
@ -66,7 +72,7 @@
|
||||
|
||||
.. |ext_lnk_example_magento2_documentation| raw:: html
|
||||
|
||||
<a target="_blank" href="https://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html">
|
||||
<a target="_blank" href="https://docs.magento.com/user-guide/v2.3/magento/installation.html">
|
||||
Official Magento 2 Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
.. |ext_lnk_xdebug_ide_atom_php_debug| raw:: html
|
||||
|
||||
<a target="_blank" href="https://atom.io/packages/php-debug">
|
||||
<a target="_blank" href="https://github.blog/2022-06-08-sunsetting-atom/">
|
||||
php-debug <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
.. |ext_lnk_php_community_github_announce| raw:: html
|
||||
.. |ext_lnk_devilbox_pr_announce| raw:: html
|
||||
|
||||
<a target="_blank" href="https://github.com/devilbox/docker-php-fpm-community/">
|
||||
<strong>PHP-FPM Community <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" /></strong>
|
||||
<a target="_blank" href="https://github.com/cytopia/devilbox/pull/942">
|
||||
<strong>Release v3.0.0-beta-0.1 <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" /></strong>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
.. attention::
|
||||
|
||||
You can now create your own **custom flavour** of PHP-FPM Community images and easily add them to the Devilbox: |ext_lnk_php_community_github_announce|
|
||||
You can now run different PHP versions per project: |ext_lnk_devilbox_pr_announce|
|
||||
|
@ -12,6 +12,7 @@ However, each example also exists in its standalone file as shown below:
|
||||
├── docker-compose.override.yml-blackfire
|
||||
├── docker-compose.override.yml-elk
|
||||
├── docker-compose.override.yml-mailhog
|
||||
├── docker-compose.override.yml-meilisearch
|
||||
├── docker-compose.override.yml-ngrok
|
||||
├── docker-compose.override.yml-php-community
|
||||
├── docker-compose.override.yml-python-flask
|
||||
|
@ -67,7 +67,7 @@ First you simply copy the while definition of the bind service from ``docker-com
|
||||
##
|
||||
## Debug?
|
||||
##
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT}
|
||||
- DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT}
|
||||
- DOCKER_LOGS=1
|
||||
|
||||
##
|
||||
|
@ -32,18 +32,18 @@ to ``.env`` to initially create it with sane defaults.
|
||||
Core settings
|
||||
=============
|
||||
|
||||
DEBUG_COMPOSE_ENTRYPOINT
|
||||
------------------------
|
||||
DEBUG_ENTRYPOINT
|
||||
----------------
|
||||
|
||||
This variable controls the docker-compose log verbosity during service startup.
|
||||
When set to ``1`` verbose output as well as executed commands are shown.
|
||||
When set to ``0`` only warnings and errors are shown.
|
||||
|
||||
+------------------------------+----------------+---------------+
|
||||
| Name | Allowed values | Default value |
|
||||
+==============================+================+===============+
|
||||
| ``DEBUG_COMPOSE_ENTRYPOINT`` | ``0`` or ``1`` | ``1`` |
|
||||
+------------------------------+----------------+---------------+
|
||||
+------------------------------+-----------------------------------+---------------+
|
||||
| Name | Allowed values | Default value |
|
||||
+==============================+===================================+===============+
|
||||
| ``DEBUG_ENTRYPOINT`` | ``0``, ``1``, ``2``, ``3``, ``4`` | ``2`` |
|
||||
+------------------------------+-----------------------------------+---------------+
|
||||
|
||||
|
||||
.. _env_docker_logs:
|
||||
@ -659,6 +659,8 @@ All values are already available in the ``.env`` file and just need to be commen
|
||||
MYSQL_SERVER=mariadb-10.6
|
||||
#MYSQL_SERVER=mariadb-10.7
|
||||
#MYSQL_SERVER=mariadb-10.8
|
||||
#MYSQL_SERVER=mariadb-10.9
|
||||
#MYSQL_SERVER=mariadb-10.10
|
||||
|
||||
|
||||
.. _env_pgsql_server:
|
||||
@ -704,6 +706,8 @@ All values are already available in the ``.env`` file and just need to be commen
|
||||
#PGSQL_SERVER=13-alpine
|
||||
#PGSQL_SERVER=14
|
||||
PGSQL_SERVER=14-alpine
|
||||
#PGSQL_SERVER=15
|
||||
#PGSQL_SERVER=15-alpine
|
||||
#PGSQL_SERVER=latest
|
||||
#PGSQL_SERVER=alpine
|
||||
|
||||
@ -747,6 +751,8 @@ All values are already available in the ``.env`` file and just need to be commen
|
||||
#REDIS_SERVER=6.0-alpine
|
||||
#REDIS_SERVER=6.2
|
||||
REDIS_SERVER=6.2-alpine
|
||||
#REDIS_SERVER=7.0
|
||||
#REDIS_SERVER=7.0-alpine
|
||||
#REDIS_SERVER=latest
|
||||
#REDIS_SERVER=alpine
|
||||
|
||||
@ -1499,8 +1505,8 @@ changing the server name or adding locations to other assets.
|
||||
|
||||
.. _env_httpd_timeout_to_php_fpm:
|
||||
|
||||
HTTPD_TIMEOUT_TO_PHP_FPM
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
HTTPD_BACKEND_TIMEOUT
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This variable specifies after how many seconds the webserver should quit an unanswered connection
|
||||
to PHP-FPM.
|
||||
@ -1509,17 +1515,17 @@ Ensure that this value is higher than PHP's ``max_execution_time``, otherwise th
|
||||
could still run and the webserver will simply drop the connection before getting an answer
|
||||
by PHP.
|
||||
|
||||
If ``HTTPD_TIMEOUT_TO_PHP_FPM`` is smaller then ``max_execution_time`` and a script runs longer
|
||||
If ``HTTPD_BACKEND_TIMEOUT`` is smaller then ``max_execution_time`` and a script runs longer
|
||||
than ``max_execution_time``, you will get a: ``504 Gateway timeout`` in the browser.
|
||||
|
||||
If ``HTTPD_TIMEOUT_TO_PHP_FPM`` is greater then ``max_execution_time`` and a script runs longer
|
||||
If ``HTTPD_BACKEND_TIMEOUT`` is greater then ``max_execution_time`` and a script runs longer
|
||||
than ``max_execution_time``, you will get a proper PHP error message in the browser.
|
||||
|
||||
|
||||
+------------------------------+-------------------+------------------+
|
||||
| Name | Allowed values | Default value |
|
||||
+==============================+===================+==================+
|
||||
| ``HTTPD_TIMEOUT_TO_PHP_FPM`` | positive integer | ``180`` |
|
||||
| ``HTTPD_BACKEND_TIMEOUT`` | positive integer | ``180`` |
|
||||
+------------------------------+-------------------+------------------+
|
||||
|
||||
HTTPD_NGINX_WORKER_PROCESSES
|
||||
|
153
docs/custom-container/enable-meilisearch.rst
Normal file
153
docs/custom-container/enable-meilisearch.rst
Normal file
@ -0,0 +1,153 @@
|
||||
.. include:: /_includes/all.rst
|
||||
.. include:: /_includes/snippets/__ANNOUNCEMENTS__.rst
|
||||
|
||||
.. _custom_container_enable_meilisearch:
|
||||
|
||||
********************************
|
||||
Enable and configure Meilisearch
|
||||
********************************
|
||||
|
||||
This section will guide you through getting Meilisearch integrated into the Devilbox.
|
||||
|
||||
.. seealso::
|
||||
* |ext_lnk_meilisearch_github|
|
||||
* |ext_lnk_meilisearch_dockerhub|
|
||||
* :ref:`custom_container_enable_all_additional_container`
|
||||
* :ref:`docker_compose_override_yml_how_does_it_work`
|
||||
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. contents:: :local:
|
||||
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
Available overwrites
|
||||
--------------------
|
||||
|
||||
.. include:: /_includes/snippets/docker-compose-override-tree-view.rst
|
||||
|
||||
|
||||
Meilisearch settings
|
||||
--------------------
|
||||
|
||||
In case of Meilisearch, the file is ``compose/docker-compose.override.yml-meilisearch``. This file
|
||||
must be copied into the root of the Devilbox git directory.
|
||||
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| What | How and where |
|
||||
+=======================+========================================================================================================+
|
||||
| Example compose file | ``compose/docker-compose.override.yml-all`` or |br| ``compose/docker-compose.override.yml-meilisearch``|
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Container IP address | ``172.16.238.203`` |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Container host name | ``meilisearch`` |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Container name | ``meilisearch`` |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Mount points | via Docker volumes |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Exposed port | ``7700`` (can be changed via ``.env``) |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Available at | ``http://localhost:7700`` (API and Admin WebUI) |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| Further configuration | none |
|
||||
+-----------------------+--------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Meilisearch env variables
|
||||
-------------------------
|
||||
|
||||
Additionally the following ``.env`` variables can be created for easy configuration:
|
||||
|
||||
+------------------------------+-------------------+----------------------------------------------------------------------------------+
|
||||
| Variable | Default value | Description |
|
||||
+==============================+===================+==================================================================================+
|
||||
| ``HOST_PORT_MEILI`` | ``7700`` | Controls the host port on which Meilisearch API and WebUI will be available at. |
|
||||
+------------------------------+-------------------+----------------------------------------------------------------------------------+
|
||||
| ``MEILI_SERVER`` | ``latest`` | Controls the Meilisearch version to use. |
|
||||
+------------------------------+-------------------+----------------------------------------------------------------------------------+
|
||||
| ``MEILI_MASTER_KEY`` | none | Default Meilisearch master key. |
|
||||
+------------------------------+-------------------+----------------------------------------------------------------------------------+
|
||||
|
||||
|
||||
Instructions
|
||||
============
|
||||
|
||||
1. Copy docker-compose.override.yml
|
||||
-----------------------------------
|
||||
|
||||
Copy the Meilisearch Docker Compose overwrite file into the root of the Devilbox git directory.
|
||||
(It must be at the same level as the default ``docker-compose.yml`` file).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
host> cp compose/docker-compose.override.yml-meilisearch docker-compose.override.yml
|
||||
|
||||
.. seealso::
|
||||
* :ref:`docker_compose_override_yml`
|
||||
* :ref:`add_your_own_docker_image`
|
||||
* :ref:`overwrite_existing_docker_image`
|
||||
|
||||
|
||||
2. Adjust ``.env`` settings (optional)
|
||||
--------------------------------------
|
||||
|
||||
Meilisearch is using sane defaults, which can be changed by adding variables to the ``.env`` file
|
||||
and assigning custom values.
|
||||
|
||||
Add the following variables to ``.env`` and adjust them to your needs:
|
||||
|
||||
.. code-block:: bash
|
||||
:caption: .env
|
||||
|
||||
# Meilisearch version to choose
|
||||
#MEILI_SERVER=v0.26.0
|
||||
#MEILI_SERVER=v0.27.0
|
||||
#MEILI_SERVER=v0.28
|
||||
MEILI_SERVER=latest
|
||||
|
||||
MEILI_MASTER_KEY=
|
||||
HOST_PORT_MEILI=7700
|
||||
|
||||
.. seealso:: :ref:`env_file`
|
||||
|
||||
|
||||
3. Start the Devilbox
|
||||
---------------------
|
||||
|
||||
The final step is to start the Devilbox with Meilisearch.
|
||||
|
||||
Let's assume you want to start ``php``, ``httpd``, ``bind``, ``meilisearch``.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
host> docker-compose up -d php httpd bind meilisearch
|
||||
|
||||
.. seealso:: :ref:`start_the_devilbox`
|
||||
|
||||
|
||||
TL;DR
|
||||
=====
|
||||
|
||||
For the lazy readers, here are all commands required to get you started.
|
||||
Simply copy and paste the following block into your terminal from the root of your Devilbox git
|
||||
directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Copy compose-override.yml into place
|
||||
cp compose/docker-compose.override.yml-meilisearch docker-compose.override.yml
|
||||
|
||||
# Create .env variable
|
||||
echo "# Meilisearch version to choose" >> .env
|
||||
echo "#MEILI_SERVER=v0.26.0" >> .env
|
||||
echo "#MEILI_SERVER=v0.27.0" >> .env
|
||||
echo "#MEILI_SERVER=v0.28" >> .env
|
||||
echo "MEILI_SERVER=latest" >> .env
|
||||
echo "MEILI_MASTER_KEY=" >> .env
|
||||
echo "HOST_PORT_MEILI=7700" >> .env
|
||||
|
||||
# Start container
|
||||
docker-compose up -d php httpd bind meilisearch
|
@ -136,7 +136,7 @@ Let's assume you want to start ``php``, ``httpd``, ``bind``, ``rabbit``.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
host> docker-compose up -d php httpd bind rabbitmq
|
||||
host> docker-compose up -d php httpd bind rabbit
|
||||
|
||||
.. seealso:: :ref:`start_the_devilbox`
|
||||
|
||||
|
@ -12,7 +12,7 @@ This example will use ``wget`` to install CodeIgniter from within the Devilbox P
|
||||
After completing the below listed steps, you will have a working CodeIgniter setup ready to be
|
||||
served via http and https.
|
||||
|
||||
.. seealso:: |ext_lnk_example_codeignitor_documentation|
|
||||
.. seealso:: |ext_lnk_example_codeigniter_documentation|
|
||||
|
||||
|
||||
**Table of Contents**
|
||||
|
216
docs/examples/setup-codeigniter4.rst
Normal file
216
docs/examples/setup-codeigniter4.rst
Normal file
@ -0,0 +1,216 @@
|
||||
.. include:: /_includes/all.rst
|
||||
.. include:: /_includes/snippets/__ANNOUNCEMENTS__.rst
|
||||
|
||||
.. _example_setup_codeigniter4:
|
||||
|
||||
******************
|
||||
Setup CodeIgniter4
|
||||
******************
|
||||
|
||||
After completing the below listed steps, you will have a working CodeIgniter setup ready to be
|
||||
served via http and https.
|
||||
|
||||
.. seealso:: |ext_lnk_example_codeigniter4_documentation|
|
||||
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. contents:: :local:
|
||||
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
The following configuration will be used:
|
||||
|
||||
+--------------+--------------------------+-------------+------------+-----------------------------------------+
|
||||
| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL |
|
||||
+==============+==========================+=============+============+=========================================+
|
||||
| my-ci | /shared/httpd/my-ci | my_ci | loc | http://my-ci.loc |br| https://my-ci.loc |
|
||||
+--------------+--------------------------+-------------+------------+-----------------------------------------+
|
||||
|
||||
.. note::
|
||||
* Inside the Devilbox PHP container, projects are always in ``/shared/httpd/``.
|
||||
* On your host operating system, projects are by default in ``./data/www/`` inside the
|
||||
Devilbox git directory. This path can be changed via :ref:`env_httpd_datadir`.
|
||||
|
||||
|
||||
Walk through
|
||||
============
|
||||
|
||||
It will be ready in eight simple steps:
|
||||
|
||||
1. Enter the PHP container
|
||||
2. Create a new VirtualHost directory
|
||||
3. Download CodeIgniter
|
||||
4. Symlink webroot directory
|
||||
5. Add MySQL database
|
||||
6. Configure datbase connection
|
||||
7. Setup DNS record
|
||||
8. Visit http://my-ci.loc in your browser
|
||||
|
||||
|
||||
1. Enter the PHP container
|
||||
--------------------------
|
||||
|
||||
All work will be done inside the PHP container as it provides you with all required command line
|
||||
tools.
|
||||
|
||||
Navigate to the Devilbox git directory and execute ``shell.sh`` (or ``shell.bat`` on Windows) to
|
||||
enter the running PHP container.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
host> ./shell.sh
|
||||
|
||||
.. seealso::
|
||||
* :ref:`enter_the_php_container`
|
||||
* :ref:`work_inside_the_php_container`
|
||||
* :ref:`available_tools`
|
||||
|
||||
|
||||
2. Create new vhost directory
|
||||
-----------------------------
|
||||
|
||||
The vhost directory defines the name under which your project will be available. |br|
|
||||
( ``<vhost dir>.TLD_SUFFIX`` will be the final URL ).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd $ mkdir my-ci
|
||||
|
||||
.. seealso:: :ref:`env_tld_suffix`
|
||||
|
||||
|
||||
3. Download CodeIgniter
|
||||
-----------------------
|
||||
|
||||
Navigate into your newly created vhost directory and install CodeIgniter.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd $ cd my-ci
|
||||
devilbox@php-8.1.6 in /shared/httpd/my-ci $ composer create-project codeigniter4/appstarter ci4app
|
||||
|
||||
How does the directory structure look after installation:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd/my-ci $ tree -L 1
|
||||
.
|
||||
└── ci4app
|
||||
|
||||
1 directory, 0 files
|
||||
|
||||
|
||||
4. Symlink webroot
|
||||
------------------
|
||||
|
||||
Symlinking the actual webroot directory to ``htdocs`` is important. The web server expects every
|
||||
project's document root to be in ``<vhost dir>/htdocs/``. This is the path where it will serve
|
||||
the files. This is also the path where your frameworks entrypoint (usually ``index.php``) should
|
||||
be found.
|
||||
|
||||
Some frameworks however provide its actual content in nested directories of unknown levels.
|
||||
This would be impossible to figure out by the web server, so you manually have to symlink it back
|
||||
to its expected path.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd/my-ci $ ln -s ci4app/public htdocs
|
||||
|
||||
How does the directory structure look after symlinking:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd/my-ci $ tree -L 1
|
||||
.
|
||||
├── ci4app
|
||||
└── htdocs -> ci4app/public
|
||||
|
||||
2 directories, 0 files
|
||||
|
||||
As you can see from the above directory structure, ``htdocs`` is available in its expected
|
||||
path and points to the frameworks entrypoint.
|
||||
|
||||
.. important::
|
||||
When using **Docker Toolbox**, you need to **explicitly allow** the usage of **symlinks**.
|
||||
See below for instructions:
|
||||
|
||||
* Docker Toolbox and :ref:`howto_docker_toolbox_and_the_devilbox_windows_symlinks`
|
||||
|
||||
|
||||
5. Add MySQL Database
|
||||
---------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd/my-ci $ mysql -u root -h 127.0.0.1 -p -e 'CREATE DATABASE my_ci;'
|
||||
|
||||
|
||||
6. Configure database connection
|
||||
--------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
devilbox@php-8.1.6 in /shared/httpd/my-ci $ vi htdocs/app/Config/Database.php
|
||||
|
||||
.. code-block:: php
|
||||
:caption: htdocs/app/Config/Database.php
|
||||
:emphasize-lines: 4-7
|
||||
|
||||
<?php
|
||||
public $default = [
|
||||
'DSN' => '',
|
||||
'hostname' => '127.0.0.1',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'database' => 'my_ci',
|
||||
'DBDriver' => 'MySQLi',
|
||||
'DBPrefix' => '',
|
||||
'pConnect' => false,
|
||||
'DBDebug' => (ENVIRONMENT !== 'production'),
|
||||
'charset' => 'utf8',
|
||||
'DBCollat' => 'utf8_general_ci',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
];
|
||||
|
||||
|
||||
7. DNS record
|
||||
-------------
|
||||
|
||||
If you **have** Auto DNS configured already, you can skip this section, because DNS entries will
|
||||
be available automatically by the bundled DNS server.
|
||||
|
||||
If you **don't have** Auto DNS configured, you will need to add the following line to your
|
||||
host operating systems ``/etc/hosts`` file (or ``C:\Windows\System32\drivers\etc`` on Windows):
|
||||
|
||||
.. code-block:: bash
|
||||
:caption: /etc/hosts
|
||||
|
||||
127.0.0.1 my-ci.loc
|
||||
|
||||
.. seealso::
|
||||
|
||||
* :ref:`howto_add_project_hosts_entry_on_mac`
|
||||
* :ref:`howto_add_project_hosts_entry_on_win`
|
||||
* :ref:`setup_auto_dns`
|
||||
|
||||
|
||||
8. Open your browser
|
||||
--------------------
|
||||
|
||||
All set now, you can visit http://my-ci.loc or https://my-ci.loc in your browser.
|
||||
|
||||
.. seealso:: :ref:`setup_valid_https`
|
||||
|
||||
|
||||
Next steps
|
||||
==========
|
||||
|
||||
.. include:: /_includes/snippets/examples/next-steps.rst
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user