9.0.0-debian-10-r0 release

This commit is contained in:
Bitnami Bot
2020-06-09 14:43:47 +00:00
parent 894472ca82
commit 63b5570764
21 changed files with 698 additions and 3 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Check whether Apache ports must be configured
if [[ -n "${APACHE_HTTP_PORT_NUMBER:-}" || -n "${APACHE_HTTPS_PORT_NUMBER:-}" ]]; then
export APACHE_ENABLE_CUSTOM_PORTS="yes"
fi
# Copy vhosts file
if [[ "$(ls -A /vhosts 2>/dev/null)" ]]; then
info "Found vhost definitions in /vhosts. Copying them to /opt/bitnami/apache/conf/vhosts"
cp -r /vhosts/* /opt/bitnami/apache/conf/vhosts
fi
# Mount certificate files
if [[ -d "/opt/bitnami/apache/certs" ]]; then
warn "The directory '/opt/bitnami/apache/certs' was externally mounted. This is a legacy configuration and will be deprecated soon. Please mount certificate files at '/opt/bitnami/apache/conf/bitnami/certs' instead. Find an example at: https://github.com/bitnami/bitnami-docker-apache#using-custom-ssl-certificates"
warn "Restoring certificates at '/opt/bitnami/apache/certs' to '/opt/bitnami/apache/conf/bitnami/certs'..."
rm -rf /opt/bitnami/apache/conf/bitnami/certs
ln -sf /opt/bitnami/apache/certs /opt/bitnami/apache/conf/bitnami/certs
elif [ "$(ls -A /certs 2>/dev/null)" ]; then
info "Mounting certificates files from /certs..."
rm -rf /opt/bitnami/apache/conf/bitnami/certs
ln -sf /certs /opt/bitnami/apache/conf/bitnami/certs
fi

View File

@@ -0,0 +1,5 @@
{
"enableCustomPorts": "{{$global.env.APACHE_ENABLE_CUSTOM_PORTS}}",
"httpPort": "{{$global.env.APACHE_HTTP_PORT_NUMBER}}",
"httpsPort": "{{$global.env.APACHE_HTTPS_PORT_NUMBER}}"
}

View File

@@ -0,0 +1,16 @@
#!/bin/bash -e
. /opt/bitnami/base/functions
. /opt/bitnami/base/helpers
print_welcome_page
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "httpd" ]]; then
. /apache-init.sh
. /drupal-init.sh
nami_initialize apache mysql-client drupal
info "Starting drupal... "
. /post-init.sh
fi
exec tini -- "$@"

View File

@@ -0,0 +1,31 @@
#!/bin/bash
##
## @brief Helper function to show an error when a password is empty and exit
## param $1 Input name
##
empty_password_error() {
error "The $1 environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development."
exit 1
}
##
## @brief Helper function to show a warning when the ALLOW_EMPTY_PASSWORD flag is enabled
##
empty_password_enabled_warn() {
warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}. For safety reasons, do not use this flag in a production environment."
}
# Validate passwords
if [[ "$ALLOW_EMPTY_PASSWORD" =~ ^(yes|Yes|YES)$ ]]; then
empty_password_enabled_warn
else
# Database creation by MySQL client
if [[ -n "$MYSQL_CLIENT_CREATE_DATABASE_USER" && -z "$MYSQL_CLIENT_CREATE_DATABASE_PASSWORD" ]]; then
empty_password_error MYSQL_CLIENT_CREATE_DATABASE_PASSWORD
fi
# Drupal database
if [[ -z "$DRUPAL_DATABASE_PASSWORD" ]]; then
empty_password_error DRUPAL_DATABASE_PASSWORD
fi
fi

View File

@@ -0,0 +1,14 @@
{
"databaseName": "{{$global.env.DRUPAL_DATABASE_NAME}}",
"databasePassword": "{{$global.env.DRUPAL_DATABASE_PASSWORD}}",
"databaseServerHost": "{{$global.env.MARIADB_HOST}}",
"databaseServerPort": "{{$global.env.MARIADB_PORT_NUMBER}}",
"databaseUser": "{{$global.env.DRUPAL_DATABASE_USER}}",
"email": "{{$global.env.DRUPAL_EMAIL}}",
"httpPort": "{{$global.env.DRUPAL_HTTP_PORT}}",
"httpsPort": "{{$global.env.DRUPAL_HTTPS_PORT}}",
"installationProfile": "{{$global.env.DRUPAL_PROFILE}}",
"password": "{{$global.env.DRUPAL_PASSWORD}}",
"phpMemoryLimit": "{{$global.env.PHP_MEMORY_LIMIT}}",
"username": "{{$global.env.DRUPAL_USERNAME}}"
}

View File

@@ -0,0 +1,13 @@
{
"allowEmptyPassword": "{{$global.env.ALLOW_EMPTY_PASSWORD}}",
"createDatabaseName": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_NAME}}",
"createDatabasePassword": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_PASSWORD}}",
"createDatabasePrivileges": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_PRIVILEGES}}",
"createDatabaseUser": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_USER}}",
"host": "{{$global.env.MARIADB_HOST}}",
"port": "{{$global.env.MARIADB_PORT_NUMBER}}",
"rootPassword": "{{$global.env.MARIADB_ROOT_PASSWORD}}",
"rootUser": "{{$global.env.MARIADB_ROOT_USER}}",
"sslCAFile": "{{$global.env.MYSQL_CLIENT_SSL_CA_FILE}}",
"sslEnable": "{{$global.env.MYSQL_CLIENT_ENABLE_SSL}}"
}

View File

@@ -0,0 +1,21 @@
#!/bin/bash
#
# Post-init script to execute PHP files
# shellcheck disable=SC1091
# set -o xtrace # Uncomment this line for debugging purposes
. /opt/bitnami/base/functions
readonly f="${1:?missing PHP file}"
failure=0
if [[ "$f" == *".php" ]]; then
info "Executing $f with PHP interpreter"
php "$f" || failure=$?
fi
if [[ "$failure" -ne 0 ]]; then
error "Failed to execute ${f}"
exit "$failure"
fi

View File

@@ -0,0 +1,24 @@
#!/bin/bash
#
# Post-init script to execute Shell files
# shellcheck disable=SC1090,SC1091
# set -o xtrace # Uncomment this line for debugging purposes
. /opt/bitnami/base/functions
readonly f="${1:?missing SHELL file}"
failure=0
if [[ "$f" == *".sh" ]]; then
if [[ -x "$f" ]]; then
info "Executing $f"; "$f" || failure=$?
else
info "Sourcing $f"; . "$f"
fi
fi
if [[ "$failure" -ne 0 ]]; then
error "Failed to execute ${f}"
exit "$failure"
fi

View File

@@ -0,0 +1,29 @@
#!/bin/bash
#
# Post-init script to execute SQL files with MySQL client
# shellcheck disable=SC1091
# set -o xtrace # Uncomment this line for debugging purposes
. /opt/bitnami/base/functions
readonly f="${1:?missing SQL file}"
failure=0
if [[ "$f" =~ ^.*(\.sql|\.sql\.gz)$ ]]; then
info "Executing $f"
mysql_cmd=( mysql -h "$MARIADB_HOST" -P "$MARIADB_PORT_NUMBER" -u "$MARIADB_ROOT_USER" )
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
mysql_cmd+=( -p"$MARIADB_ROOT_PASSWORD" )
fi
if [[ "$f" == *".sql" ]]; then
"${mysql_cmd[@]}" < "$f" || failure=$?
elif [[ "$f" == *".sql.gz" ]]; then
gunzip -c "$f" | "${mysql_cmd[@]}" || failure=$?
fi
fi
if [[ "$failure" -ne 0 ]]; then
error "Failed to execute ${f}"
exit "$failure"
fi

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# set -o xtrace # Uncomment this line for debugging purposes
. /opt/bitnami/base/functions
if [[ -d /docker-entrypoint-init.d ]] && [[ ! -f "/bitnami/drupal/.user_scripts_initialized" ]]; then
for f in /docker-entrypoint-init.d/*; do
for p in /post-init.d/*.sh; do
"$p" "$f"
done
done
info "Custom scripts were executed"
touch "/bitnami/drupal/.user_scripts_initialized"
fi