mirror of
https://github.com/cytopia/devilbox.git
synced 2025-06-24 18:25:17 +00:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
a78bccfd33 | |||
2679acc569 | |||
6b18f7b71d | |||
df6ee3fb36 | |||
fda37efc64 | |||
e9281c9b40 | |||
dfd3e27882 | |||
8e7069f893 | |||
c96f740c39 | |||
fe54bbf714 | |||
9660c37937 | |||
0d6ecf23e3 | |||
3a2dacf748 | |||
467fc03640 | |||
7480eb4e08 | |||
f348fa7814 | |||
b8055a175b | |||
9b58e2daa8 | |||
30e2b08c72 | |||
1f0676de4a | |||
6735daaaeb | |||
657ba28afd | |||
14259518c6 | |||
d406eac805 | |||
dfb2a1097d |
@ -13,8 +13,8 @@ error_reporting(-1);
|
||||
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');
|
||||
|
||||
|
||||
$DEVILBOX_VERSION = 'v1.8.1';
|
||||
$DEVILBOX_DATE = '2020-11-12';
|
||||
$DEVILBOX_VERSION = 'v1.8.3';
|
||||
$DEVILBOX_DATE = '2020-11-22';
|
||||
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';
|
||||
|
||||
//
|
||||
|
62
.devilbox/www/htdocs/config_httpd.php
Normal file
62
.devilbox/www/htdocs/config_httpd.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php require '../config.php'; ?>
|
||||
<?php loadClass('Helper')->authPage(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php echo loadClass('Html')->getHead(); ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo loadClass('Html')->getNavbar(); ?>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1>Httpd custom configs</h1>
|
||||
<br/>
|
||||
<br/>
|
||||
<p>Shows your currently custom configuration files applied to the Httpd container.</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php $vHosts = loadClass('Httpd')->getVirtualHosts(); ?>
|
||||
<?php $custom = false; ?>
|
||||
<?php foreach ($vHosts as $vHost): ?>
|
||||
<?php if (($vhostGen = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
|
||||
<?php $custom = true; ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($custom): ?>
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th>Project</th>
|
||||
<th>Host</th>
|
||||
<th>Container</th>
|
||||
<th>Files</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($vHosts as $vHost): ?>
|
||||
<?php if (($vhostGen = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
|
||||
<tr>
|
||||
<th><?php echo $vHost['domain']; ?></th>
|
||||
<td><?php echo loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vHost['name'].'/'.loadClass('Helper')->getEnv('HTTPD_TEMPLATE_DIR');?></td>
|
||||
<td><?php echo dirname($vhostGen); ?></td>
|
||||
<td><code><?php echo basename($vhostGen); ?></code></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>No custom configurations applied.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- /.container -->
|
||||
|
||||
<?php echo loadClass('Html')->getFooter(); ?>
|
||||
</body>
|
||||
</html>
|
126
.devilbox/www/htdocs/config_php.php
Normal file
126
.devilbox/www/htdocs/config_php.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php require '../config.php'; ?>
|
||||
<?php loadClass('Helper')->authPage(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php echo loadClass('Html')->getHead(); ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo loadClass('Html')->getNavbar(); ?>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1>PHP custom configs</h1>
|
||||
<br/>
|
||||
<br/>
|
||||
<p>Shows your currently custom configuration files applied to the PHP-FPM container.</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th>Section</th>
|
||||
<th>Host</th>
|
||||
<th>Container</th>
|
||||
<th>Files</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Supervisord</th>
|
||||
<td>supervisor/</td>
|
||||
<td>/etc/supervisor/custom.d/</td>
|
||||
<td>
|
||||
<?php
|
||||
$files = glob('/etc/supervisor/custom.d/*.conf');
|
||||
if ($files) {
|
||||
foreach ($files as $file) {
|
||||
echo '<code>'.basename($file). '</code><br/>';
|
||||
}
|
||||
} else {
|
||||
echo 'No custom files';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Autostart (global)</th>
|
||||
<td>autostart/</td>
|
||||
<td>/startup.2.d/</td>
|
||||
<td>
|
||||
<?php
|
||||
$files = glob('/startup.2.d/*.sh');
|
||||
if ($files) {
|
||||
foreach ($files as $file) {
|
||||
echo '<code>'.basename($file). '</code><br/>';
|
||||
}
|
||||
} else {
|
||||
echo 'No custom files';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Autostart (version)</th>
|
||||
<td>cfg/php-startup-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
|
||||
<td>/startup.1.d/</td>
|
||||
<td>
|
||||
<?php
|
||||
$files = glob('/startup.1.d/*.sh');
|
||||
if ($files) {
|
||||
foreach ($files as $file) {
|
||||
echo '<code>'.basename($file). '</code><br/>';
|
||||
}
|
||||
} else {
|
||||
echo 'No custom files';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PHP-FPM</th>
|
||||
<td>cfg/php-fpm-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
|
||||
<td>/etc/php-fpm-custom.d/</td>
|
||||
<td>
|
||||
<?php
|
||||
$files = glob('/etc/php-fpm-custom.d/*.conf');
|
||||
if ($files) {
|
||||
foreach ($files as $file) {
|
||||
echo '<code>'.basename($file). '</code><br/>';
|
||||
}
|
||||
} else {
|
||||
echo 'No custom files';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PHP</th>
|
||||
<td>cfg/php-ini-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
|
||||
<td>/etc/php-custom.d/</td>
|
||||
<td>
|
||||
<?php
|
||||
$files = glob('/etc/php-custom.d/*.ini');
|
||||
if ($files) {
|
||||
foreach ($files as $file) {
|
||||
echo '<code>'.basename($file). '</code><br/>';
|
||||
}
|
||||
} else {
|
||||
echo 'No custom files';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- /.container -->
|
||||
|
||||
<?php echo loadClass('Html')->getFooter(); ?>
|
||||
</body>
|
||||
</html>
|
@ -23,6 +23,19 @@ class Html
|
||||
'path' => '/mail.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'name' => 'Configs',
|
||||
'menu' => array(
|
||||
array(
|
||||
'name' => 'PHP',
|
||||
'path' => '/config_php.php'
|
||||
),
|
||||
array(
|
||||
'name' => 'Httpd',
|
||||
'path' => '/config_httpd.php'
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'name' => 'Databases',
|
||||
'menu' => array(
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -137,6 +137,9 @@
|
||||
/mod/php-fpm-8.0/*.so
|
||||
/mod/php-fpm-8.1/*.so
|
||||
|
||||
# Ignore supervisord configs
|
||||
/supervisor/*.conf
|
||||
|
||||
# Ignore custom bash and other confi files
|
||||
/bash/*
|
||||
!/bash/bashrc.sh-example
|
||||
|
@ -226,3 +226,29 @@ run_fail() {
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
### Create and validate vhost directory
|
||||
###
|
||||
create_vhost_dir() {
|
||||
local vhost="${1}"
|
||||
|
||||
echo "Ensure vhost '${vhost}' is created"
|
||||
|
||||
# Clean vhost dir
|
||||
cd "${DVLBOX_PATH}"
|
||||
while docker-compose exec --user devilbox -T php curl -sS --fail "http://php/vhosts.php" | grep ">${vhost}<" >/dev/null; do
|
||||
echo "Deleting vhost: ${vhost}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'rm -rf /shared/httpd/${vhost} && sleep 5;'" "1" "${DVLBOX_PATH}"
|
||||
done
|
||||
|
||||
# Create vhost dir
|
||||
cd "${DVLBOX_PATH}"
|
||||
while ! docker-compose exec --user devilbox -T php curl -sS --fail "http://php/vhosts.php" | grep ">${vhost}<" >/dev/null; do
|
||||
echo "Recreating vhost: ${vhost}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'rm -rf /shared/httpd/${vhost} && sleep 5;'" "1" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'mkdir -p /shared/httpd/${vhost} && sleep 5;'" "1" "${DVLBOX_PATH}"
|
||||
done
|
||||
echo "Vhost is present: ${vhost}"
|
||||
}
|
||||
|
@ -43,42 +43,45 @@ fi
|
||||
###
|
||||
MYSQL_ROOT_PASSWORD="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "MYSQL_ROOT_PASSWORD" )"
|
||||
TLD_SUFFIX="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "TLD_SUFFIX" )"
|
||||
VHOST="my-cakephp"
|
||||
|
||||
# Create vhost dir
|
||||
create_vhost_dir "${VHOST}"
|
||||
|
||||
|
||||
# Setup CakePHP project
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'mkdir -p /shared/httpd/cakephp'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/cakephp; rm -rf cakephp; composer create-project --no-interaction --prefer-dist cakephp/app cakephp 3.8'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/cakephp; ln -sf cakephp/webroot htdocs'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/${VHOST}; composer create-project --no-interaction --prefer-dist cakephp/app cakephp 3.8'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/${VHOST}; ln -sf cakephp/webroot htdocs'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php mysql -u root -h mysql --password=\"${MYSQL_ROOT_PASSWORD}\" -e \"DROP DATABASE IF EXISTS my_cake; CREATE DATABASE my_cake;\"" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
|
||||
# Configure CakePHP database settings
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'host' =>.*/'host' => 'mysql',/g\" /shared/httpd/cakephp/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'username' =>.*/'username' => 'root',/g\" /shared/httpd/cakephp/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'password' =>.*/'password' => '${MYSQL_ROOT_PASSWORD}',/g\" /shared/httpd/cakephp/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'database' =>.*/'database' => 'my_cake',/g\" /shared/httpd/cakephp/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'host' =>.*/'host' => 'mysql',/g\" /shared/httpd/${VHOST}/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'username' =>.*/'username' => 'root',/g\" /shared/httpd/${VHOST}/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'password' =>.*/'password' => '${MYSQL_ROOT_PASSWORD}',/g\" /shared/httpd/${VHOST}/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php sed -i\"\" \"s/'database' =>.*/'database' => 'my_cake',/g\" /shared/httpd/${VHOST}/cakephp/config/app.php" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
|
||||
# Test CakePHP
|
||||
ERROR=0
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://cakephp.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'mbstring'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'mbstring'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://cakephp.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'openssl'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'openssl'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://cakephp.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'intl'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'intl'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://cakephp.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'tmp directory'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'tmp directory'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://cakephp.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'logs directory'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'logs directory'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://cakephp.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'connect to the database'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep '\"bullet success\"' | grep 'connect to the database'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
ERROR=1
|
||||
fi
|
||||
|
||||
if [ "${ERROR}" = "1" ]; then
|
||||
run "docker-compose exec --user devilbox -T php curl 'http://cakephp.${TLD_SUFFIX}' || true" "1" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php curl 'http://${VHOST}.${TLD_SUFFIX}' || true" "1" "${DVLBOX_PATH}"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -67,19 +67,22 @@ fi
|
||||
###
|
||||
MYSQL_ROOT_PASSWORD="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "MYSQL_ROOT_PASSWORD" )"
|
||||
TLD_SUFFIX="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "TLD_SUFFIX" )"
|
||||
VHOST="my-drupal"
|
||||
|
||||
# Create vhost dir
|
||||
create_vhost_dir "${VHOST}"
|
||||
|
||||
|
||||
# Setup Drupal project
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'mkdir -p /shared/httpd/drupal'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/drupal; sudo rm -rf drupal; composer-1 create-project --no-interaction --prefer-dist drupal-composer/drupal-project drupal 8.x-dev'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/drupal; ln -sf drupal/web htdocs'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/${VHOST}; composer-1 create-project --no-interaction --prefer-dist drupal-composer/drupal-project drupal 8.x-dev'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/${VHOST}; ln -sf drupal/web htdocs'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php mysql -u root -h mysql --password=\"${MYSQL_ROOT_PASSWORD}\" -e \"DROP DATABASE IF EXISTS my_drupal; CREATE DATABASE my_drupal;\"" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
|
||||
# Configure Drupal
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/drupal/htdocs/; ${DRUSH} site-install standard --db-url='mysql://root:${MYSQL_ROOT_PASSWORD}@mysql/my_drupal' --site-name=Example -y'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
run "docker-compose exec --user devilbox -T php bash -c 'cd /shared/httpd/${VHOST}/htdocs/; ${DRUSH} site-install standard --db-url='mysql://root:${MYSQL_ROOT_PASSWORD}@mysql/my_drupal' --site-name=Example -y'" "${RETRIES}" "${DVLBOX_PATH}"
|
||||
|
||||
# Test Drupal
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://drupal.${TLD_SUFFIX}' | tac | tac | grep 'Welcome to Example'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
run "docker-compose exec --user devilbox -T php curl 'http://drupal.${TLD_SUFFIX}' || true"
|
||||
if ! run "docker-compose exec --user devilbox -T php curl -sS --fail 'http://${VHOST}.${TLD_SUFFIX}' | tac | tac | grep 'Welcome to Example'" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
run "docker-compose exec --user devilbox -T php curl 'http://${VHOST}.${TLD_SUFFIX}' || true"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -12,7 +12,7 @@ DVLBOX_PATH="$( cd "${SCRIPT_PATH}/../.." && pwd -P )"
|
||||
# shellcheck disable=SC1090
|
||||
. "${SCRIPT_PATH}/../scripts/.lib.sh"
|
||||
|
||||
RETRIES=10
|
||||
RETRIES=20
|
||||
DISABLED_VERSIONS=("8.0" "8.1")
|
||||
|
||||
|
||||
@ -49,16 +49,17 @@ TLD_SUFFIX="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "TLD_SUFFIX" )"
|
||||
###
|
||||
### Custom variables
|
||||
###
|
||||
VHOST="my-wordpress"
|
||||
DB_NAME="my_wp"
|
||||
PROJECT_NAME="this-is-my-grepable-project-name"
|
||||
VHOST="my-wordpress"
|
||||
|
||||
# Create vhost dir
|
||||
create_vhost_dir "${VHOST}"
|
||||
|
||||
|
||||
# Download Wordpress
|
||||
run "docker-compose exec --user devilbox -T php bash -c ' \
|
||||
rm -rf /shared/httpd/${VHOST} \
|
||||
&& mkdir -p /shared/httpd/${VHOST} \
|
||||
&& git clone https://github.com/WordPress/WordPress /shared/httpd/${VHOST}/wordpress \
|
||||
git clone https://github.com/WordPress/WordPress /shared/httpd/${VHOST}/wordpress \
|
||||
&& ln -sf wordpress /shared/httpd/${VHOST}/htdocs'" \
|
||||
"${RETRIES}" "${DVLBOX_PATH}"
|
||||
|
||||
@ -95,7 +96,13 @@ if ! run "docker-compose exec --user devilbox -T php curl -sS --fail -L -XPOST -
|
||||
--data 'language=1' >/dev/null" "${RETRIES}" "${DVLBOX_PATH}"; then
|
||||
run "docker-compose exec --user devilbox -T php curl -sS --fail -L -XPOST -c cookie.txt -b cookie.txt \
|
||||
'http://${VHOST}.${TLD_SUFFIX}/wp-admin/install.php?step=1'\
|
||||
--data 'language=1' >/dev/null" "1" "${DVLBOX_PATH}"
|
||||
--data 'language=1' >/dev/null" "1" "${DVLBOX_PATH}" || true
|
||||
run "docker-compose exec --user devilbox -T php curl -sS --fail -L -I \
|
||||
'http://${VHOST}.${TLD_SUFFIX}/wp-admin/install.php?step=1'" "1" "${DVLBOX_PATH}" || true
|
||||
run "docker-compose exec --user devilbox -T php curl -sS --fail -L \
|
||||
'http://${VHOST}.${TLD_SUFFIX}/'" "1" "${DVLBOX_PATH}" || true
|
||||
run "docker-compose logs php" || true
|
||||
run "docker-compose logs httpd" || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -119,7 +126,9 @@ if ! run "docker-compose exec --user devilbox -T php curl -sS --fail -L -XPOST -
|
||||
--data 'admin_email=test%40test.com' \
|
||||
--data 'blog_public=0' \
|
||||
--data 'Submit=Install+WordPress' \
|
||||
--data 'language='" "1" "${DVLBOX_PATH}"
|
||||
--data 'language='" "1" "${DVLBOX_PATH}" || true
|
||||
run "docker-compose logs php" || true
|
||||
run "docker-compose logs httpd" || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
31
CHANGELOG.md
31
CHANGELOG.md
@ -7,6 +7,37 @@ major versions.
|
||||
## Unreleased
|
||||
|
||||
|
||||
## Release v1.8.3 (2020-11-22)
|
||||
|
||||
#### Fixed
|
||||
|
||||
- [#753](https://github.com/cytopia/devilbox/issues/753) Fixed symlink handling in watcherd
|
||||
- [#751](https://github.com/cytopia/devilbox/issues/751) Fixed duplicate output in check-config.sh
|
||||
|
||||
#### Added
|
||||
|
||||
- [#755](https://github.com/cytopia/devilbox/issues/755) Added ~/.composer/vendor/bin to $PATH
|
||||
- [#692](https://github.com/cytopia/devilbox/issues/692) Added custom supervisor configs
|
||||
- Added project and customization checks in check-config.sh
|
||||
- Intranet: show custom PHP configuration files
|
||||
- Intranet: show custom Httpd configuration files
|
||||
|
||||
|
||||
## Release v1.8.2 (2020-11-14)
|
||||
|
||||
#### Fixed
|
||||
- [#643](https://github.com/cytopia/devilbox/issues/643) Wrong entrypoint in mysql images
|
||||
- [#703](https://github.com/cytopia/devilbox/issues/703) Don't fail on uid/gid change
|
||||
- [#749](https://github.com/cytopia/devilbox/issues/749) Fix to disable PHP modules without `*.so` ext
|
||||
- Fixed `check-config.sh` to properly expand `~` character in path
|
||||
|
||||
#### Added
|
||||
- [#707](https://github.com/cytopia/devilbox/issues/707) New `.env` variable: `HOST_PATH_BACKUPDIR`
|
||||
|
||||
#### Changed
|
||||
- [#547](https://github.com/cytopia/devilbox/issues/547) Added link to official Contao Devilbox Documentation
|
||||
|
||||
|
||||
## Release v1.8.1 (2020-11-12)
|
||||
|
||||
#### Fixed
|
||||
|
25
UPDATING.md
25
UPDATING.md
@ -3,6 +3,31 @@
|
||||
This document will hold all information on how to update between major versions.
|
||||
|
||||
|
||||
## Update from `v1.8.1` to `v1.8.2`
|
||||
|
||||
**PR:** https://github.com/cytopia/devilbox/pull/750
|
||||
|
||||
This PR adds many new images, ensure to remove your current old state before running them:
|
||||
```bash
|
||||
docker-compose stop
|
||||
docker-compose rm -f
|
||||
```
|
||||
|
||||
|
||||
## Update from `v1.8.0` to `v1.8.1`
|
||||
|
||||
**PR:** https://github.com/cytopia/devilbox/pull/747
|
||||
|
||||
This PR ensures to have all directories in log/ mod/ cfg/ added by default. Prior this, some
|
||||
of those directories might have been created by Docker (running as root) and they have the wrong
|
||||
permissions (root instead of local user).
|
||||
To mitigate this, you need to adjust directory permissions prior pulling this tag.
|
||||
|
||||
```bash
|
||||
sudo chown -R <user>:<group> .
|
||||
```
|
||||
|
||||
|
||||
## Update from `v1.6.2` to `v1.6.3`
|
||||
|
||||
**PR:** https://github.com/cytopia/devilbox/pull/689
|
||||
|
399
check-config.sh
399
check-config.sh
@ -11,6 +11,7 @@ set -o pipefail
|
||||
RET_CODE=0
|
||||
MY_UID="$( id -u )"
|
||||
MY_GID="$( id -g )"
|
||||
DEBUG=0
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
@ -21,15 +22,24 @@ MY_GID="$( id -g )"
|
||||
### Logger functions
|
||||
###
|
||||
log_err() {
|
||||
>&2 printf "\\e[1;31m[ERR] %s\\e[0m\\n" "${1}"
|
||||
>&2 printf "\\e[1;31m[ERR] %s\\e[0m\\n" "${1}"
|
||||
}
|
||||
|
||||
log_note() {
|
||||
>&2 printf "\\e[1;33m[NOTE] %s\\e[0m\\n" "${1}"
|
||||
}
|
||||
|
||||
log_info() {
|
||||
printf "\\e[;34m[INFO] %s\\e[0m\\n" "${1}"
|
||||
printf "\\e[;34m[INFO] %s\\e[0m\\n" "${1}"
|
||||
}
|
||||
|
||||
log_ok() {
|
||||
printf "\\e[;32m[SUCC] %s\\e[0m\\n" "${1}"
|
||||
printf "\\e[;32m[SUCC] %s\\e[0m\\n" "${1}"
|
||||
}
|
||||
log_debug() {
|
||||
if [ "${DEBUG}" -eq "1" ]; then
|
||||
printf "[DEBUG] %s\\n" "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
###
|
||||
@ -51,11 +61,19 @@ print_head_1() {
|
||||
### File functions
|
||||
###
|
||||
file_get_uid() {
|
||||
stat -c '%u' "${1}"
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
stat --format '%u' "${1}"
|
||||
else
|
||||
stat -f '%u' "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
file_get_gid() {
|
||||
stat -c '%g' "${1}"
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
stat --format '%g' "${1}"
|
||||
else
|
||||
stat -f '%g' "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Returns 4-digit format
|
||||
@ -80,6 +98,52 @@ file_get_perm() {
|
||||
echo "${perm}"
|
||||
}
|
||||
|
||||
# Get path with '~' replace with correct home path
|
||||
get_path() {
|
||||
echo "${1/#\~/${HOME}}"
|
||||
}
|
||||
|
||||
# Returns sub directories by one level
|
||||
# Also returns symlinks if they point to a directory
|
||||
get_sub_dirs_level_1() {
|
||||
local dir="${1}"
|
||||
dir="${dir#./}" # Remove leading './' if it exists
|
||||
dir="${dir%/}" # Remove trailing '/' if it exists
|
||||
# shellcheck disable=SC2016
|
||||
find "${dir}" \
|
||||
| grep -Ev "^${dir}\$" \
|
||||
| grep -Ev "^${dir}/.+/" \
|
||||
| xargs -n1 sh -c 'if [ -d "${1}" ]; then echo "${1}"; fi' -- \
|
||||
| sort
|
||||
}
|
||||
|
||||
# Returns sub directories by two level
|
||||
# Also returns symlinks if they point to a directory
|
||||
get_sub_dirs_level_2() {
|
||||
local dir="${1}"
|
||||
dir="${dir#./}" # Remove leading './' if it exists
|
||||
dir="${dir%/}" # Remove trailing '/' if it exists
|
||||
# shellcheck disable=SC2016
|
||||
find "${dir}" \
|
||||
| grep -Ev "^${dir}\$" \
|
||||
| grep -Ev "^${dir}/.+/.+/" \
|
||||
| xargs -n1 sh -c 'if [ -d "${1}" ]; then echo "${1}"; fi' -- \
|
||||
| sort
|
||||
}
|
||||
|
||||
# Returns the value of .env var
|
||||
get_env_value() {
|
||||
local val
|
||||
val="$( grep -E "^${1}=" .env )"
|
||||
echo "${val#*=}"
|
||||
}
|
||||
|
||||
# Validate a DNS record
|
||||
validate_dns() {
|
||||
ping -c1 "${1}" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Check git
|
||||
@ -88,7 +152,7 @@ print_head_1 "Checking git"
|
||||
|
||||
GIT_STATUS="$( git status -s )"
|
||||
if [ -z "${GIT_STATUS}" ]; then
|
||||
log_info "git is clean"
|
||||
log_ok "git is clean"
|
||||
else
|
||||
log_err "git is unclean"
|
||||
echo "${GIT_STATUS}"
|
||||
@ -123,6 +187,8 @@ while read -r env_var; do
|
||||
log_err "Variable '${env_var}' missing in .env file"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
ENV_VAR_MISSING=1
|
||||
else
|
||||
log_debug "Variable '${env_var}' is present in '.env file"
|
||||
fi
|
||||
done < <(grep -E '^[A-Z].+=' env-example | awk -F'=' '{print $1}')
|
||||
if [ "${ENV_VAR_MISSING}" = "0" ]; then
|
||||
@ -137,6 +203,8 @@ while read -r env_var; do
|
||||
log_err "Variable '${env_var}' should only be defined once. Occurances: ${OCCURANCES}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
ENV_VAR_DUPLICATED=1
|
||||
else
|
||||
log_debug "Variable '${env_var}' is defined exactly once."
|
||||
fi
|
||||
done < <(grep -E '^[A-Z].+=' env-example | awk -F'=' '{print $1}')
|
||||
if [ "${ENV_VAR_DUPLICATED}" = "0" ]; then
|
||||
@ -150,126 +218,190 @@ fi
|
||||
print_head_1 "Checking .env file values"
|
||||
|
||||
WRONG_ENV_FILES_VALUES=0
|
||||
DEBUG_COMPOSE_ENTRYPOINT="$( grep -E '^DEBUG_COMPOSE_ENTRYPOINT=' .env | awk -F'=' '{print $2}' )"
|
||||
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}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DEBUG_COMPOSE_ENTRYPOINT' has correct value: ${DEBUG_COMPOSE_ENTRYPOINT}"
|
||||
fi
|
||||
|
||||
DOCKER_LOGS="$( grep -E '^DOCKER_LOGS=' .env | awk -F'=' '{print $2}' )"
|
||||
DOCKER_LOGS="$( get_env_value "DOCKER_LOGS" )"
|
||||
if [ "${DOCKER_LOGS}" != "0" ] && [ "${DOCKER_LOGS}" != "1" ]; then
|
||||
log_err "Variable 'DOCKER_LOGS' should be 0 or 1. Has: ${DOCKER_LOGS}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DOCKER_LOGS' has correct value: ${DOCKER_LOGS}"
|
||||
fi
|
||||
|
||||
DEVILBOX_PATH="$( grep -E '^DEVILBOX_PATH=' .env | awk -F'=' '{print $2}' )"
|
||||
DEVILBOX_PATH="$( get_env_value "DEVILBOX_PATH" )"
|
||||
if [ ! -d "${DEVILBOX_PATH}" ]; then
|
||||
log_err "Variable 'DEVILBOX_PATH' directory does not exist: ${DEVILBOX_PATH}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DEVILBOX_PATH' directory exists: ${DEVILBOX_PATH}"
|
||||
fi
|
||||
|
||||
DEVILBOX_PATH_PERM="$( file_get_perm "${DEVILBOX_PATH}" )"
|
||||
if [ "${DEVILBOX_PATH_PERM}" != "0755" ] && [ "${DEVILBOX_PATH_PERM}" != "0775" ] && [ "${DEVILBOX_PATH_PERM}" != "0777" ]; then
|
||||
log_err "Variable 'DEVILBOX_PATH' directory must be 0755, 0775 or 0777. Has: ${DEVILBOX_PATH_PERM}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DEVILBOX_PATH' directory has correct permissions: ${DEVILBOX_PATH_PERM}"
|
||||
fi
|
||||
|
||||
DEVILBOX_PATH_PERM="$( file_get_uid "${DEVILBOX_PATH}" )"
|
||||
if [ "${DEVILBOX_PATH_PERM}" != "${MY_UID}" ]; then
|
||||
log_err "Variable 'DEVILBOX_PATH' directory uid must be ${MY_UID}. Has: ${DEVILBOX_PATH_PERM}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DEVILBOX_PATH' diretory has correct uid: ${DEVILBOX_PATH_PERM}"
|
||||
fi
|
||||
|
||||
DEVILBOX_PATH_PERM="$( file_get_gid "${DEVILBOX_PATH}" )"
|
||||
if [ "${DEVILBOX_PATH_PERM}" != "${MY_GID}" ]; then
|
||||
log_err "Variable 'DEVILBOX_PATH' directory gid must be ${MY_GID}. Has: ${DEVILBOX_PATH_PERM}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'DEVILBOX_PATH' diretory has correct gid: ${DEVILBOX_PATH_PERM}"
|
||||
fi
|
||||
|
||||
if [ "${WRONG_ENV_FILES_VALUES}" = "0" ]; then
|
||||
log_ok "All .env file variables have correct values"
|
||||
LOCAL_LISTEN_ADDR="$( get_env_value "LOCAL_LISTEN_ADDR" )"
|
||||
if [ -n "${LOCAL_LISTEN_ADDR}" ]; then
|
||||
if ! echo "${LOCAL_LISTEN_ADDR}" | grep -E ':$' >/dev/null; then
|
||||
log_err "Variable 'LOCAL_LISTEN_ADDR' is not empty and missing trailing ':'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
elif ! echo "${LOCAL_LISTEN_ADDR}" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:$' >/dev/null; then
|
||||
log_err "Variable 'LOCAL_LISTEN_ADDR' has wrong value: '${LOCAL_LISTEN_ADDR}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'LOCAL_LISTEN_ADDR' has correct value: ${LOCAL_LISTEN_ADDR}"
|
||||
fi
|
||||
else
|
||||
log_debug "Variable 'LOCAL_LISTEN_ADDR' has correct value: ${LOCAL_LISTEN_ADDR}"
|
||||
fi
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR="$( grep -E '^HOST_PATH_HTTPD_DATADIR=' .env | awk -F'=' '{print $2}' )"
|
||||
HOST_PATH_HTTPD_DATADIR="$( get_path "$( get_env_value "HOST_PATH_HTTPD_DATADIR" )" )"
|
||||
if [ ! -d "${HOST_PATH_HTTPD_DATADIR}" ]; then
|
||||
log_err "Variable 'HOST_PATH_HTTPD_DATADIR' directory does not exist: ${HOST_PATH_HTTPD_DATADIR}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'HOST_PATH_HTTPD_DATADIR' directory exists: ${HOST_PATH_HTTPD_DATADIR}"
|
||||
fi
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR_PERM="$( file_get_perm "${HOST_PATH_HTTPD_DATADIR}" )"
|
||||
if [ "${HOST_PATH_HTTPD_DATADIR_PERM}" != "0755" ] && [ "${HOST_PATH_HTTPD_DATADIR_PERM}" != "0775" ] && [ "${HOST_PATH_HTTPD_DATADIR_PERM}" != "0777" ]; then
|
||||
log_err "Variable 'HOST_PATH_HTTPD_DATADIR' directory must be 0755, 0775 or 0777. Has: ${HOST_PATH_HTTPD_DATADIR_PERM}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'HOST_PATH_HTTPD_DATADIR' directory has correct permissions: ${HOST_PATH_HTTPD_DATADIR_PERM}"
|
||||
fi
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR_PERM="$( file_get_uid "${HOST_PATH_HTTPD_DATADIR}" )"
|
||||
if [ "${HOST_PATH_HTTPD_DATADIR_PERM}" != "${MY_UID}" ]; then
|
||||
log_err "Variable 'HOST_PATH_HTTPD_DATADIR' directory uid must be ${MY_UID}. Has: ${HOST_PATH_HTTPD_DATADIR_PERM}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'HOST_PATH_HTTPD_DATADIR' directory has correct uid: ${HOST_PATH_HTTPD_DATADIR_PERM}"
|
||||
fi
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR_PERM="$( file_get_gid "${HOST_PATH_HTTPD_DATADIR}" )"
|
||||
if [ "${HOST_PATH_HTTPD_DATADIR_PERM}" != "${MY_GID}" ]; then
|
||||
log_err "Variable 'HOST_PATH_HTTPD_DATADIR' directory gid must be ${MY_GID}. Has: ${HOST_PATH_HTTPD_DATADIR_PERM}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'HOST_PATH_HTTPD_DATADIR' directory has correct gid: ${HOST_PATH_HTTPD_DATADIR_PERM}"
|
||||
fi
|
||||
|
||||
PHP_SERVER="$( grep -E '^PHP_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
PHP_SERVER="$( get_env_value "PHP_SERVER" )"
|
||||
if ! grep -E "^#?PHP_SERVER=${PHP_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'PHP_SERVER' has wrong value: ${PHP_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'PHP_SERVER' has correct value: ${PHP_SERVER}"
|
||||
fi
|
||||
HTTPD_SERVER="$( grep -E '^HTTPD_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
HTTPD_SERVER="$( get_env_value "HTTPD_SERVER" )"
|
||||
if ! grep -E "^#?HTTPD_SERVER=${HTTPD_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'HTTPD_SERVER' has wrong value: ${HTTPD_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'HTTPD_SERVER' has correct value: ${HTTPD_SERVER}"
|
||||
fi
|
||||
MYSQL_SERVER="$( grep -E '^MYSQL_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
MYSQL_SERVER="$( get_env_value "MYSQL_SERVER" )"
|
||||
if ! grep -E "^#?MYSQL_SERVER=${MYSQL_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'MYSQL_SERVER' has wrong value: ${MYSQL_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'MYSQL_SERVER' has correct value: ${MYSQL_SERVER}"
|
||||
fi
|
||||
PGSQL_SERVER="$( grep -E '^PGSQL_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
PGSQL_SERVER="$( get_env_value "PGSQL_SERVER" )"
|
||||
if ! grep -E "^#?PGSQL_SERVER=${PGSQL_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'PGSQL_SERVER' has wrong value: ${PGSQL_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'PGSQL_SERVER' has correct value: ${PGSQL_SERVER}"
|
||||
fi
|
||||
REDIS_SERVER="$( grep -E '^REDIS_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
REDIS_SERVER="$( get_env_value "REDIS_SERVER" )"
|
||||
if ! grep -E "^#?REDIS_SERVER=${REDIS_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'REDIS_SERVER' has wrong value: ${REDIS_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'REDIS_SERVER' has correct value: ${REDIS_SERVER}"
|
||||
fi
|
||||
MEMCD_SERVER="$( grep -E '^MEMCD_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
MEMCD_SERVER="$( get_env_value "MEMCD_SERVER" )"
|
||||
if ! grep -E "^#?MEMCD_SERVER=${MEMCD_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'MEMCD_SERVER' has wrong value: ${MEMCD_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'MEMCD_SERVER' has correct value: ${MEMCD_SERVER}"
|
||||
fi
|
||||
MONGO_SERVER="$( grep -E '^MONGO_SERVER=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
MONGO_SERVER="$( get_env_value "MONGO_SERVER" )"
|
||||
if ! grep -E "^#?MONGO_SERVER=${MONGO_SERVER}\$" env-example >/dev/null; then
|
||||
log_err "Variable 'MONGO_SERVER' has wrong value: ${MONGO_SERVER}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
WRONG_ENV_FILES_VALUES=1
|
||||
else
|
||||
log_debug "Variable 'MONGO_SERVER' has correct value: ${MONGO_SERVER}"
|
||||
fi
|
||||
|
||||
NEW_UID="$( grep -E '^NEW_UID=' .env | awk -F'=' '{print $2}' )"
|
||||
NEW_UID="$( get_env_value "NEW_UID" )"
|
||||
if [ "${NEW_UID}" != "${MY_UID}" ]; then
|
||||
log_err "Variable 'NEW_UID' has wrong value: '${NEW_UID}'. Should have: ${MY_UID}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
else
|
||||
log_debug "Variable 'NEW_UID' has correct value: '${NEW_UID}'"
|
||||
fi
|
||||
NEW_GID="$( grep -E '^NEW_GID=' .env | awk -F'=' '{print $2}' )"
|
||||
|
||||
NEW_GID="$( get_env_value "NEW_GID" )"
|
||||
if [ "${NEW_GID}" != "${MY_GID}" ]; then
|
||||
log_err "Variable 'NEW_GID' has wrong value: '${NEW_GID}'. Should have: ${MY_GID}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
else
|
||||
log_debug "Variable 'NEW_GID' has correct value: '${NEW_GID}'"
|
||||
fi
|
||||
|
||||
|
||||
@ -278,11 +410,10 @@ if [ "${WRONG_ENV_FILES_VALUES}" = "0" ]; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Ensure cfg/, mod/ and log/ directories exist
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking required directories"
|
||||
print_head_1 "Checking required Devilbox core directories exist"
|
||||
|
||||
# /cfg/php-fpm-VERSION
|
||||
DIR_MISSING=0
|
||||
@ -291,6 +422,8 @@ while read -r php_version; do
|
||||
log_err "Directory 'cfg/php-fpm-${php_version}' is missing"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DIR_MISSING=1
|
||||
else
|
||||
log_debug "Directory 'cfg/php-fpm-${php_version}' is present"
|
||||
fi
|
||||
done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
if [ "${DIR_MISSING}" = "0" ]; then
|
||||
@ -304,6 +437,8 @@ while read -r php_version; do
|
||||
log_err "Directory 'log/php-fpm-${php_version}' is missing"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DIR_MISSING=1
|
||||
else
|
||||
log_debug "Directory 'log/php-fpm-${php_version}' is present"
|
||||
fi
|
||||
done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
if [ "${DIR_MISSING}" = "0" ]; then
|
||||
@ -317,6 +452,8 @@ while read -r php_version; do
|
||||
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
|
||||
@ -330,6 +467,8 @@ while read -r httpd_version; do
|
||||
log_err "Directory 'cfg/${httpd_version}' is missing"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DIR_MISSING=1
|
||||
else
|
||||
log_debug "Directory 'cfg/${httpd_version}' is present"
|
||||
fi
|
||||
done < <(grep -E '^#?HTTPD_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
if [ "${DIR_MISSING}" = "0" ]; then
|
||||
@ -343,6 +482,8 @@ while read -r httpd_version; do
|
||||
log_err "Directory 'log/${httpd_version}' is missing"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DIR_MISSING=1
|
||||
else
|
||||
log_debug "Directory 'log/${httpd_version}' is present"
|
||||
fi
|
||||
done < <(grep -E '^#?HTTPD_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
if [ "${DIR_MISSING}" = "0" ]; then
|
||||
@ -351,19 +492,19 @@ fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Directory permissions
|
||||
# Devilbox Directory permissions
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking directory permissions"
|
||||
print_head_1 "Checking devilbox core directory permissions"
|
||||
|
||||
DEVILBOX_DIRS=(
|
||||
"autostart"
|
||||
"backups"
|
||||
"bash"
|
||||
"ca"
|
||||
"cfg"
|
||||
"compose"
|
||||
"log"
|
||||
"mod"
|
||||
"supervisor"
|
||||
)
|
||||
|
||||
# Check allowed directory permissions: 0755 0775 0777
|
||||
@ -375,6 +516,8 @@ for search_dir in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "Directory '${my_dir}' should have 0755, 0775 or 0777 permissions. Has: ${PERM} permissions"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "Directory '${my_dir}' has correct permissions: ${PERM}"
|
||||
fi
|
||||
done < <(find "${search_dir}" -type d)
|
||||
done
|
||||
@ -391,6 +534,8 @@ for search_dir in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "Directory '${my_dir}' should have uid '${MY_UID}' Has: '${PERM}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "Directory '${my_dir}' has correct uid: ${PERM}"
|
||||
fi
|
||||
done < <(find "${search_dir}" -type d)
|
||||
done
|
||||
@ -407,6 +552,8 @@ for search_dir in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "Directory '${my_dir}' should have gid '${MY_GID}' Has: '${PERM}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "Directory '${my_dir}' has correct gid: ${PERM}"
|
||||
fi
|
||||
done < <(find "${search_dir}" -type d)
|
||||
done
|
||||
@ -416,17 +563,17 @@ fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# File permissions
|
||||
# Devilbox File permissions
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking file permissions"
|
||||
print_head_1 "Checking devilbox core file permissions"
|
||||
|
||||
DEVILBOX_DIRS=(
|
||||
"autostart"
|
||||
"backups"
|
||||
"ca"
|
||||
"cfg"
|
||||
"compose"
|
||||
"mod"
|
||||
"supervisor"
|
||||
)
|
||||
|
||||
# Check allowed directory permissions: 0644 0664 0666
|
||||
@ -440,6 +587,8 @@ for search_file in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "File '${my_file}' should have 0600 permissions. Has: ${PERM} permissions"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "File '${my_file}' has correct permissions: ${PERM}"
|
||||
fi
|
||||
# Executable files
|
||||
elif echo "${my_file}" | grep -E '.+\.sh(-example)?$' >/dev/null; then
|
||||
@ -447,6 +596,8 @@ for search_file in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "File '${my_file}' should have 0755, 0775 or 0777 permissions. Has: ${PERM} permissions"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "File '${my_file}' has correct permissions: ${PERM}"
|
||||
fi
|
||||
# All other files
|
||||
else
|
||||
@ -454,6 +605,8 @@ for search_file in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "File '${my_file}' should have 0644, 0664 or 0666 permissions. Has: ${PERM} permissions"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "File '${my_file}' has correct permissions: ${PERM}"
|
||||
fi
|
||||
fi
|
||||
done < <(find "${search_file}" -type f)
|
||||
@ -471,6 +624,8 @@ for search_file in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "File '${my_file}' should have uid '${MY_UID}' Has: '${PERM}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "File '${my_file}' has correct uid: ${PERM}"
|
||||
fi
|
||||
done < <(find "${search_file}" -type f)
|
||||
done
|
||||
@ -487,6 +642,8 @@ for search_file in "${DEVILBOX_DIRS[@]}"; do
|
||||
log_err "File '${my_file}' should have gid '${MY_GID}' Has: '${PERM}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DEVILBOX_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "File '${my_file}' has correct gid: ${PERM}"
|
||||
fi
|
||||
done < <(find "${search_file}" -type f)
|
||||
done
|
||||
@ -496,11 +653,11 @@ fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Check projects
|
||||
# Check projects permissions
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking projects"
|
||||
print_head_1 "Checking projects permissions"
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR="$( grep -E '^HOST_PATH_HTTPD_DATADIR=' .env | awk -F'=' '{print $2}' )"
|
||||
HOST_PATH_HTTPD_DATADIR="$( get_path "$( get_env_value "HOST_PATH_HTTPD_DATADIR" )" )"
|
||||
|
||||
DATA_DIR_PERM_WRONG=0
|
||||
while read -r project; do
|
||||
@ -509,8 +666,10 @@ while read -r project; do
|
||||
log_err "Directory '${project}' should have 0755, 0775 or 0777 permissions. Has: ${PERM} permissions"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DATA_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "Directory '${project}' has correct permissions: ${PERM}"
|
||||
fi
|
||||
done < <(find "${HOST_PATH_HTTPD_DATADIR}" -type d | grep -Ev "${HOST_PATH_HTTPD_DATADIR}/.+/.+")
|
||||
done < <(get_sub_dirs_level_1 "${HOST_PATH_HTTPD_DATADIR}")
|
||||
if [ "${DATA_DIR_PERM_WRONG}" = "0" ]; then
|
||||
log_ok "All project dirs have correct permissions"
|
||||
fi
|
||||
@ -522,8 +681,10 @@ while read -r project; do
|
||||
log_err "Directory '${project}' should have uid '${MY_UID}' Has: '${PERM}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DATA_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "Directory '${project}' has correct uid: ${PERM}"
|
||||
fi
|
||||
done < <(find "${HOST_PATH_HTTPD_DATADIR}" -type d | grep -Ev "${HOST_PATH_HTTPD_DATADIR}/.+/.+")
|
||||
done < <(get_sub_dirs_level_1 "${HOST_PATH_HTTPD_DATADIR}")
|
||||
if [ "${DATA_DIR_PERM_WRONG}" = "0" ]; then
|
||||
log_ok "All project dirs have correct uid"
|
||||
fi
|
||||
@ -535,13 +696,167 @@ while read -r project; do
|
||||
log_err "Directory '${project}' should have gid '${MY_GID}' Has: '${PERM}'"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DATA_DIR_PERM_WRONG=1
|
||||
else
|
||||
log_debug "Directory '${project}' has correct gid: ${PERM}"
|
||||
fi
|
||||
done < <(find "${HOST_PATH_HTTPD_DATADIR}" -type d | grep -Ev "${HOST_PATH_HTTPD_DATADIR}/.+/.+")
|
||||
done < <(get_sub_dirs_level_1 "${HOST_PATH_HTTPD_DATADIR}")
|
||||
if [ "${DATA_DIR_PERM_WRONG}" = "0" ]; then
|
||||
log_ok "All project dirs have correct gid"
|
||||
fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Check projects settings
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking projects settings"
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR="$( get_path "$( get_env_value "HOST_PATH_HTTPD_DATADIR" )" )"
|
||||
|
||||
TLD_SUFFIX="$( get_env_value "TLD_SUFFIX" )"
|
||||
DNS_RECORD_WRONG=0
|
||||
while read -r project; do
|
||||
VHOST="$( basename "${project}" ).${TLD_SUFFIX}"
|
||||
if ! validate_dns "${VHOST}"; then
|
||||
log_err "Project '${VHOST}' has no valid DNS record"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DNS_RECORD_WRONG=1
|
||||
else
|
||||
log_debug "Project '${VHOST}' has valid DNS record"
|
||||
fi
|
||||
done < <(get_sub_dirs_level_1 "${HOST_PATH_HTTPD_DATADIR}")
|
||||
if [ "${DNS_RECORD_WRONG}" = "0" ]; then
|
||||
log_ok "All projects have valid DNS records"
|
||||
fi
|
||||
|
||||
HTTPD_DOCROOT_DIR="$( get_env_value "HTTPD_DOCROOT_DIR" )"
|
||||
DOCROOT_WRONG=0
|
||||
while read -r project; do
|
||||
if [ ! -d "${project}/${HTTPD_DOCROOT_DIR}" ]; then
|
||||
log_err "Missing HTTPD_DOCROOT_DIR '${HTTPD_DOCROOT_DIR}' in: ${project}"
|
||||
RET_CODE=$(( RET_CODE + 1))
|
||||
DOCROOT_WRONG=1
|
||||
else
|
||||
log_debug "HTTPD_DOCROOT_DIR '${HTTPD_DOCROOT_DIR}' present in: ${project}"
|
||||
fi
|
||||
done < <(get_sub_dirs_level_1 "${HOST_PATH_HTTPD_DATADIR}")
|
||||
if [ "${DOCROOT_WRONG}" = "0" ]; then
|
||||
log_ok "All projects have valid HTTPD_DOCROOT_DIR"
|
||||
fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Check Customizations
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
print_head_1 "Checking customizations"
|
||||
|
||||
CUSTOMIZATIONS=0
|
||||
|
||||
# vhost-gen
|
||||
HOST_PATH_HTTPD_DATADIR="$( get_path "$( get_env_value "HOST_PATH_HTTPD_DATADIR" )" )"
|
||||
HTTPD_TEMPLATE_DIR="$( get_env_value "HTTPD_TEMPLATE_DIR" )"
|
||||
while read -r project; do
|
||||
if [ -f "${project}/${HTTPD_TEMPLATE_DIR}/apache22.yml" ]; then
|
||||
log_note "[vhost-gen] Custom Apache 2.2 vhost-gen config present in: ${project}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
elif [ -f "${project}/${HTTPD_TEMPLATE_DIR}/apache24.yml" ]; then
|
||||
log_note "[vhost-gen] Custom Apache 2.4 vhost-gen config present in: ${project}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
elif [ -f "${project}/${HTTPD_TEMPLATE_DIR}/nginx.yml" ]; then
|
||||
log_note "[vhost-gen] Custom Nginx vhost-gen config present in: ${project}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[vhost-gen] No custom configuration for: ${project}/"
|
||||
fi
|
||||
done < <(get_sub_dirs_level_1 "${HOST_PATH_HTTPD_DATADIR}")
|
||||
|
||||
# docker-compose.override.yml
|
||||
if [ -f "docker-compose.override.yml" ]; then
|
||||
log_note "[docker] Custom docker-compose.override.yml present"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[docker] No custom docker-compose.override.yml present"
|
||||
fi
|
||||
|
||||
# cfg/HTTPD/
|
||||
while read -r httpd; do
|
||||
if find "cfg/${httpd}" | grep -E '\.conf$' >/dev/null; then
|
||||
log_note "[httpd] Custom config present in cfg/${httpd}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[httpd] No custom config present in cfg/${httpd}/"
|
||||
fi
|
||||
done < <(grep -E '^#?HTTPD_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
|
||||
# cfg/php-ini-${version}/
|
||||
while read -r php_version; do
|
||||
if find "cfg/php-ini-${php_version}" | grep -E '\.ini$' >/dev/null; then
|
||||
log_note "[php.ini] Custom config present in cfg/php-ini-${php_version}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[php.ini] No custom config present in cfg/php-ini-${php_version}/"
|
||||
fi
|
||||
done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
|
||||
# cfg/php-fpm-${version}/
|
||||
while read -r php_version; do
|
||||
if find "cfg/php-fpm-${php_version}" | grep -E '\.conf$' >/dev/null; then
|
||||
log_note "[php-fpm] Custom config present in cfg/php-fpm-${php_version}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[php-fpm] No custom config present in cfg/php-fpm-${php_version}/"
|
||||
fi
|
||||
done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
|
||||
# cfg/MYSQL/
|
||||
while read -r mysql; do
|
||||
if find "cfg/${mysql}" | grep -E '\.cnf$' >/dev/null; then
|
||||
log_note "[mysql] Custom config present in cfg/${mysql}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[mysql] No custom config present in cfg/${mysql}/"
|
||||
fi
|
||||
done < <(grep -E '^#?MYSQL_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
|
||||
# cfg/php-startup-${version}/
|
||||
while read -r php_version; do
|
||||
if find "cfg/php-startup-${php_version}" | grep -E '\.sh$' >/dev/null; then
|
||||
log_note "[startup] Custom script present in cfg/php-startup-${php_version}/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[startup] No custom script present in cfg/php-startup-${php_version}/"
|
||||
fi
|
||||
done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}')
|
||||
|
||||
# autostart/
|
||||
if find "autostart" | grep -E '\.sh$' >/dev/null; then
|
||||
log_note "[startup] Custom script present in autostart/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[startup] No custom script present in autostart/"
|
||||
fi
|
||||
|
||||
# supervisor/
|
||||
if find "supervisor" | grep -E '\.conf$' >/dev/null; then
|
||||
log_note "[supervisor] Custom config present in supervisor/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[supervisor] No custom config present in supervisor/"
|
||||
fi
|
||||
|
||||
# bash/
|
||||
if find "bash" | grep -E '\.sh$' >/dev/null; then
|
||||
log_note "[bash] Custom script present in bash/"
|
||||
CUSTOMIZATIONS=$(( CUSTOMIZATIONS + 1 ))
|
||||
else
|
||||
log_debug "[bash] No custom script present in bash/"
|
||||
fi
|
||||
|
||||
# Total?
|
||||
if [ "${CUSTOMIZATIONS}" = "0" ]; then
|
||||
log_info "No custom configurations applied"
|
||||
fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# Summary
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
@ -551,10 +866,20 @@ if [ "${RET_CODE}" -gt "0" ]; then
|
||||
log_err "Found ${RET_CODE} error(s)"
|
||||
log_err "Devilbox might not work properly"
|
||||
log_err "Fix the issues before submitting a bug report"
|
||||
log_info "Ensure to run 'docker-compose stop; docker-compose rm -f' on changes in .env"
|
||||
if [ "${CUSTOMIZATIONS}" -gt "0" ]; then
|
||||
log_note "${CUSTOMIZATIONS} custom configurations applied. If you encounter issues, reset them first."
|
||||
else
|
||||
log_info "No custom configurations applied"
|
||||
fi
|
||||
log_info "Ensure to run 'docker-compose stop; docker-compose rm -f' on .env changes or custom configs"
|
||||
exit 1
|
||||
else
|
||||
log_ok "Found no errors"
|
||||
log_info "Ensure to run 'docker-compose stop; docker-compose rm -f' when .env was changed"
|
||||
if [ "${CUSTOMIZATIONS}" -gt "0" ]; then
|
||||
log_note "${CUSTOMIZATIONS} custom configurations applied. If you encounter issues, reset them first."
|
||||
else
|
||||
log_info "No custom configurations applied"
|
||||
fi
|
||||
log_info "Ensure to run 'docker-compose stop; docker-compose rm -f' on .env changes or custom configs"
|
||||
exit 0
|
||||
fi
|
||||
|
@ -95,7 +95,7 @@ services:
|
||||
# PHP
|
||||
# ------------------------------------------------------------
|
||||
php:
|
||||
image: devilbox/php-fpm:${PHP_SERVER}-work-0.114
|
||||
image: devilbox/php-fpm:${PHP_SERVER}-work-0.117
|
||||
hostname: php
|
||||
|
||||
##
|
||||
@ -183,7 +183,7 @@ services:
|
||||
- devilbox-mail:/var/mail:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Mount DB Backup directory
|
||||
- ${DEVILBOX_PATH}/backups:/shared/backups:rw${MOUNT_OPTIONS}
|
||||
- ${HOST_PATH_BACKUPDIR:-./backups}:/shared/backups:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Mount devilbox user-defined *.ini files in order
|
||||
# to overwrite the default PHP.ini configuration
|
||||
@ -204,6 +204,9 @@ services:
|
||||
# Mount devilbox user-defined bash config
|
||||
- ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Mount devilbox user-defined supervisord config
|
||||
- ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Certificate Authority public key
|
||||
- ${DEVILBOX_PATH}/ca:/ca:rw${MOUNT_OPTIONS}
|
||||
|
||||
@ -218,7 +221,7 @@ services:
|
||||
# Web Server
|
||||
# ------------------------------------------------------------
|
||||
httpd:
|
||||
image: devilbox/${HTTPD_SERVER}:0.33
|
||||
image: devilbox/${HTTPD_SERVER}:0.35
|
||||
hostname: httpd
|
||||
|
||||
environment:
|
||||
@ -317,7 +320,7 @@ services:
|
||||
# MySQL Database
|
||||
# ------------------------------------------------------------
|
||||
mysql:
|
||||
image: devilbox/mysql:${MYSQL_SERVER}-0.6
|
||||
image: devilbox/mysql:${MYSQL_SERVER}-0.7
|
||||
hostname: mysql
|
||||
|
||||
environment:
|
||||
|
@ -16,6 +16,12 @@
|
||||
Official Contao Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_example_contao_devilbox_documentation| raw:: html
|
||||
|
||||
<a target="_blank" href="https://docs.contao.org/manual/en/guides/local-installation/devilbox/">
|
||||
Official Contao Devilbox Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_example_craftcms_documentation| raw:: html
|
||||
|
||||
<a target="_blank" href="https://docs.craftcms.com/v3/installation.html#step-1-download-craft">
|
||||
@ -28,13 +34,13 @@
|
||||
Official Drupal Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_example_expressionengine_documentation| raw:: html
|
||||
.. |ext_lnk_example_expressionengine_documentation| raw:: html
|
||||
|
||||
<a target="_blank" href="https://docs.expressionengine.com/latest/index.html">
|
||||
Official ExpressionEngine Documentation <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_example_expressionengine_primer| raw:: html
|
||||
.. |ext_lnk_example_expressionengine_primer| raw:: html
|
||||
|
||||
<a target="_blank" href="https://docs.expressionengine.com/latest/getting-started/ten-minute-primer.html">
|
||||
10 Minute Primer <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
|
@ -959,6 +959,22 @@ always be ``/shared/httpd/``.
|
||||
``docker-compose rm``.
|
||||
|
||||
|
||||
.. _env_host_path_backupdir:
|
||||
|
||||
HOST_PATH_BACKUPDIR
|
||||
-------------------
|
||||
|
||||
The path on your host OS of the database backup directory to be mounted into the
|
||||
PHP container into ``/shared/backups``.
|
||||
|
||||
|
||||
+------------------------------+----------------+----------------+
|
||||
| Name | Allowed values | Default value |
|
||||
+==============================+================+================+
|
||||
| ``HOST_PATH_BACKUPDIR`` | valid path | ``./backups`` |
|
||||
+------------------------------+----------------+----------------+
|
||||
|
||||
|
||||
HOST_PATH_SSH_DIR
|
||||
-----------------
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
Setup Contao
|
||||
************
|
||||
|
||||
.. important::
|
||||
**You can find a more up-to-date version in the official Contao Documentation:**
|
||||
|ext_lnk_example_contao_devilbox_documentation|
|
||||
|
||||
This example will use ``composer`` to install Contao CMS from within the Devilbox PHP container.
|
||||
|
||||
.. important::
|
||||
@ -19,7 +23,9 @@ This example will use ``composer`` to install Contao CMS from within the Devilbo
|
||||
After completing the below listed steps, you will have a working Contao CMS setup ready to be
|
||||
served via http and https.
|
||||
|
||||
.. seealso:: |ext_lnk_example_contao_documentation|
|
||||
.. seealso::
|
||||
* |ext_lnk_example_contao_documentation|
|
||||
* |ext_lnk_example_contao_devilbox_documentation|
|
||||
|
||||
|
||||
**Table of Contents**
|
||||
|
40
docs/howto/devilbox/move-backups-to-different-directory.rst
Normal file
40
docs/howto/devilbox/move-backups-to-different-directory.rst
Normal file
@ -0,0 +1,40 @@
|
||||
:orphan:
|
||||
|
||||
.. include:: /_includes/snippets/__ANNOUNCEMENTS__.rst
|
||||
|
||||
.. _howto_move_backups_to_a_different_directory:
|
||||
|
||||
*************************************
|
||||
Move backups to a different directory
|
||||
*************************************
|
||||
|
||||
No matter if your backups are already in a different location or if you want to move them out of
|
||||
the Devilbox git directory now, you can do that in a few simple steps.
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. contents:: :local:
|
||||
|
||||
Move backups out of the Devilbox git directory
|
||||
==============================================
|
||||
|
||||
All you have to do is to adjust the path of :ref:`env_host_path_backupdir` in the ``.env`` file.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Navigate to Devilbox git directory
|
||||
host> cd path/to/devilbox
|
||||
|
||||
# Open the .env file with your favourite editor
|
||||
host> vim .env
|
||||
|
||||
Now Adjust the value of :ref:`env_host_path_backupdir`
|
||||
|
||||
.. code-block:: bash
|
||||
:caption: .env
|
||||
:emphasize-lines: 1
|
||||
|
||||
HOST_PATH_HTTPD_DATADIR=/home/user/backups/devilbox/
|
||||
|
||||
That's it, whenever you start up the Devilbox, ``/home/user/backups/devilbox/`` will be mounted into
|
||||
the PHP container into ``/shared/backups/``.
|
@ -22,7 +22,7 @@ So let’s assume all of your projects are already in place under ``/home/user/w
|
||||
Now you decide to use the Devilbox, but still want to keep your projects where they are at the
|
||||
moment.
|
||||
|
||||
All you have to to is to adjust the path of :ref:`env_httpd_datadir` in the ``.env`` file.
|
||||
All you have to do is to adjust the path of :ref:`env_httpd_datadir` in the ``.env`` file.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -26,14 +26,26 @@ having to worry about loosing any project data. There could also be the case tha
|
||||
dedicated hard-disk to store your projects or you have your own idea about a directory structure
|
||||
where you want to store your projects.
|
||||
|
||||
Affected env variables to consider changing:
|
||||
|
||||
* :ref:`env_httpd_datadir`
|
||||
* :ref:`env_host_path_backupdir`
|
||||
|
||||
|
||||
Projects
|
||||
--------
|
||||
|
||||
.. seealso::
|
||||
:ref:`howto_move_projects_to_a_different_directory`
|
||||
* :ref:`howto_move_projects_to_a_different_directory`
|
||||
Follow this guide to keep your projects separated from the Devilbox git directory.
|
||||
|
||||
Backups
|
||||
-------
|
||||
|
||||
.. seealso::
|
||||
* :ref:`howto_move_backups_to_a_different_directory`
|
||||
Follow this guide to keep your backups separated from the Devilbox git directory.
|
||||
|
||||
|
||||
Version control ``.env`` file
|
||||
-----------------------------
|
||||
|
11
env-example
11
env-example
@ -465,6 +465,17 @@ MOUNT_OPTIONS=
|
||||
HOST_PATH_HTTPD_DATADIR=./data/www
|
||||
|
||||
|
||||
###
|
||||
### Local filesystem path to where your backups are stored
|
||||
###
|
||||
### Note: When changing this variable you must re-create the container.
|
||||
### Simply remove it, it will be auto-created during the next start:
|
||||
###
|
||||
### $ docker-compose rm -f
|
||||
###
|
||||
HOST_PATH_BACKUPDIR=./backups
|
||||
|
||||
|
||||
###
|
||||
### The path on your host OS of the ssh directory to be mounted into the
|
||||
### PHP container into /home/devilbox/.ssh.
|
||||
|
0
supervisor/.keepme
Normal file
0
supervisor/.keepme
Normal file
Reference in New Issue
Block a user