mirror of
https://github.com/bitnami/containers.git
synced 2026-03-16 06:49:12 +08:00
9.0.0-debian-10-r0 release
This commit is contained in:
24
bitnami/drupal/9/debian-10/rootfs/apache-init.sh
Normal file
24
bitnami/drupal/9/debian-10/rootfs/apache-init.sh
Normal 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
|
||||
5
bitnami/drupal/9/debian-10/rootfs/apache-inputs.json
Normal file
5
bitnami/drupal/9/debian-10/rootfs/apache-inputs.json
Normal 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}}"
|
||||
}
|
||||
16
bitnami/drupal/9/debian-10/rootfs/app-entrypoint.sh
Executable file
16
bitnami/drupal/9/debian-10/rootfs/app-entrypoint.sh
Executable 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 -- "$@"
|
||||
31
bitnami/drupal/9/debian-10/rootfs/drupal-init.sh
Executable file
31
bitnami/drupal/9/debian-10/rootfs/drupal-init.sh
Executable 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
|
||||
14
bitnami/drupal/9/debian-10/rootfs/drupal-inputs.json
Normal file
14
bitnami/drupal/9/debian-10/rootfs/drupal-inputs.json
Normal 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}}"
|
||||
}
|
||||
13
bitnami/drupal/9/debian-10/rootfs/mysql-client-inputs.json
Normal file
13
bitnami/drupal/9/debian-10/rootfs/mysql-client-inputs.json
Normal 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}}"
|
||||
}
|
||||
21
bitnami/drupal/9/debian-10/rootfs/post-init.d/php.sh
Executable file
21
bitnami/drupal/9/debian-10/rootfs/post-init.d/php.sh
Executable 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
|
||||
24
bitnami/drupal/9/debian-10/rootfs/post-init.d/shell.sh
Executable file
24
bitnami/drupal/9/debian-10/rootfs/post-init.d/shell.sh
Executable 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
|
||||
29
bitnami/drupal/9/debian-10/rootfs/post-init.d/sql-mysql.sh
Executable file
29
bitnami/drupal/9/debian-10/rootfs/post-init.d/sql-mysql.sh
Executable 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
|
||||
15
bitnami/drupal/9/debian-10/rootfs/post-init.sh
Normal file
15
bitnami/drupal/9/debian-10/rootfs/post-init.sh
Normal 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
|
||||
Reference in New Issue
Block a user