From d3592df9e755332c5fe257ae92724c04a801374c Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Sun, 30 Apr 2023 09:00:03 +0100 Subject: [PATCH] [bitnami/drupal] Release 9.5.8-debian-11-r0 (#32194) Signed-off-by: Bitnami Containers --- bitnami/drupal/9/debian-11/Dockerfile | 24 ++--- .../opt/bitnami/.bitnami_components.json | 18 ++-- .../prebuildfs/opt/bitnami/scripts/libos.sh | 95 +++++++++++++++++++ .../apache/bitnami-templates/bitnami.conf.tpl | 1 - .../opt/bitnami/scripts/apache/setup.sh | 4 + .../rootfs/opt/bitnami/scripts/libapache.sh | 10 +- .../rootfs/opt/bitnami/scripts/libdrupal.sh | 2 +- .../opt/bitnami/scripts/libmysqlclient.sh | 6 +- .../rootfs/opt/bitnami/scripts/libphp.sh | 1 + .../rootfs/opt/bitnami/scripts/php-env.sh | 1 + bitnami/drupal/9/debian-11/tags-info.yaml | 2 +- 11 files changed, 130 insertions(+), 34 deletions(-) diff --git a/bitnami/drupal/9/debian-11/Dockerfile b/bitnami/drupal/9/debian-11/Dockerfile index d1d310412662..b8eccc82d341 100644 --- a/bitnami/drupal/9/debian-11/Dockerfile +++ b/bitnami/drupal/9/debian-11/Dockerfile @@ -2,14 +2,15 @@ FROM docker.io/bitnami/minideb:bullseye ARG TARGETARCH -LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2023-04-17T15:24:20Z" \ +LABEL com.vmware.cp.artifact.flavor="sha256:109c7d51bd69bb6b3df71017440c1ea0699454f81fe188056c083f0b57c96ea6" \ + org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ + org.opencontainers.image.created="2023-04-30T07:13:03Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="9.5.7-debian-11-r8" \ + org.opencontainers.image.ref.name="9.5.8-debian-11-r0" \ org.opencontainers.image.title="drupal" \ org.opencontainers.image.vendor="VMware, Inc." \ - org.opencontainers.image.version="9.5.7" + org.opencontainers.image.version="9.5.8" ENV HOME="/" \ OS_ARCH="${TARGETARCH:-amd64}" \ @@ -22,13 +23,12 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN install_packages acl ca-certificates curl gnupg libaudit1 libbrotli1 libbsd0 libbz2-1.0 libcap-ng0 libcom-err2 libcrypt1 libcurl4 libexpat1 libffi7 libfftw3-double3 libfontconfig1 libfreetype6 libgcc-s1 libgcrypt20 libglib2.0-0 libgmp10 libgnutls30 libgomp1 libgpg-error0 libgssapi-krb5-2 libhogweed6 libicu67 libidn2-0 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblcms2-2 libldap-2.4-2 liblqr-1-0 libltdl7 liblzma5 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmd0 libmemcached11 libncurses6 libnettle8 libnghttp2-14 libonig5 libp11-kit0 libpam0g libpcre2-8-0 libpcre3 libpng16-16 libpq5 libpsl5 libreadline8 librtmp1 libsasl2-2 libsodium23 libsqlite3-0 libssh2-1 libssl1.1 libstdc++6 libsybdb5 libtasn1-6 libtidy5deb1 libtinfo6 libunistring2 libuuid1 libwebp6 libx11-6 libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxslt1.1 libzip4 procps unzip zlib1g RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \ COMPONENTS=( \ - "php-8.1.18-0-linux-${OS_ARCH}-debian-11" \ - "apache-2.4.57-3-linux-${OS_ARCH}-debian-11" \ - "mysql-client-10.6.12-4-linux-${OS_ARCH}-debian-11" \ - "libphp-8.1.18-0-linux-${OS_ARCH}-debian-11" \ - "render-template-1.0.5-4-linux-${OS_ARCH}-debian-11" \ - "gosu-1.16.0-5-linux-${OS_ARCH}-debian-11" \ - "drupal-9.5.7-3-linux-${OS_ARCH}-debian-11" \ + "php-8.1.18-1-linux-${OS_ARCH}-debian-11" \ + "apache-2.4.57-6-linux-${OS_ARCH}-debian-11" \ + "mysql-client-10.11.2-5-linux-${OS_ARCH}-debian-11" \ + "libphp-8.1.18-2-linux-${OS_ARCH}-debian-11" \ + "render-template-1.0.5-5-linux-${OS_ARCH}-debian-11" \ + "drupal-9.5.8-0-linux-${OS_ARCH}-debian-11" \ ) && \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ @@ -52,7 +52,7 @@ RUN /opt/bitnami/scripts/drupal/postunpack.sh RUN /opt/bitnami/scripts/mysql-client/postunpack.sh ENV APACHE_HTTPS_PORT_NUMBER="" \ APACHE_HTTP_PORT_NUMBER="" \ - APP_VERSION="9.5.7" \ + APP_VERSION="9.5.8" \ BITNAMI_APP_NAME="drupal" \ PATH="/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/apache/bin:/opt/bitnami/mysql/bin:/opt/bitnami/common/bin:/opt/bitnami/drupal/vendor/bin:$PATH" diff --git a/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json index 761a98345b6f..a6ec734122b1 100644 --- a/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json @@ -3,42 +3,36 @@ "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "2.4.57-3" + "version": "2.4.57-6" }, "drupal": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "9.5.7-3" - }, - "gosu": { - "arch": "amd64", - "distro": "debian-11", - "type": "NAMI", - "version": "1.16.0-5" + "version": "9.5.8-0" }, "libphp": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "8.1.18-0" + "version": "8.1.18-2" }, "mysql-client": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "10.6.12-4" + "version": "10.11.2-5" }, "php": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "8.1.18-0" + "version": "8.1.18-1" }, "render-template": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "1.0.5-4" + "version": "1.0.5-5" } } \ No newline at end of file diff --git a/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/scripts/libos.sh b/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/scripts/libos.sh index 5e141d4ce3f1..e573899abacb 100644 --- a/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/scripts/libos.sh +++ b/bitnami/drupal/9/debian-11/prebuildfs/opt/bitnami/scripts/libos.sh @@ -553,3 +553,98 @@ get_root_disk_device_id() { get_root_disk_size() { fdisk -l "$(get_root_disk_device_id)" | grep 'Disk.*bytes' | sed -E 's/.*, ([0-9]+) bytes,.*/\1/' || true } + +######################## +# Run command as a specific user and group (optional) +# Arguments: +# $1 - USER(:GROUP) to switch to +# $2..$n - command to execute +# Returns: +# Exit code of the specified command +######################### +run_as_user() { + run_chroot "$@" +} + +######################## +# Execute command as a specific user and group (optional), +# replacing the current process image +# Arguments: +# $1 - USER(:GROUP) to switch to +# $2..$n - command to execute +# Returns: +# Exit code of the specified command +######################### +exec_as_user() { + run_chroot --replace-process "$@" +} + +######################## +# Run a command using chroot +# Arguments: +# $1 - USER(:GROUP) to switch to +# $2..$n - command to execute +# Flags: +# -r | --replace-process - Replace the current process image (optional) +# Returns: +# Exit code of the specified command +######################### +run_chroot() { + local userspec + local user + local homedir + local replace=false + local -r cwd="$(pwd)" + + # Parse and validate flags + while [[ "$#" -gt 0 ]]; do + case "$1" in + -r | --replace-process) + replace=true + ;; + --) + shift + break + ;; + -*) + stderr_print "unrecognized flag $1" + return 1 + ;; + *) + break + ;; + esac + shift + done + + # Parse and validate arguments + if [[ "$#" -lt 2 ]]; then + echo "expected at least 2 arguments" + return 1 + else + userspec=$1 + shift + + # userspec can optionally include the group, so we parse the user + user=$(echo "$userspec" | cut -d':' -f1) + fi + + if ! am_i_root; then + error "Could not switch to '${userspec}': Operation not permitted" + return 1 + fi + + # Get the HOME directory for the user to switch, as chroot does + # not properly update this env and some scripts rely on it + homedir=$(eval echo "~${user}") + if [[ ! -d $homedir ]]; then + homedir="${HOME:-/}" + fi + + # Obtaining value for "$@" indirectly in order to properly support shell parameter expansion + if [[ "$replace" = true ]]; then + exec chroot --userspec="$userspec" / bash -c "cd ${cwd}; export HOME=${homedir}; exec \"\$@\"" -- "$@" + else + chroot --userspec="$userspec" / bash -c "cd ${cwd}; export HOME=${homedir}; exec \"\$@\"" -- "$@" + fi +} \ No newline at end of file diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami.conf.tpl b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami.conf.tpl index 6d3b22894445..75a255c3efee 100644 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami.conf.tpl +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/bitnami-templates/bitnami.conf.tpl @@ -15,4 +15,3 @@ SetEnvIf X-Forwarded-Proto https HTTPS=on ErrorDocument 503 /503.html -Include "{{APACHE_CONF_DIR}}/bitnami/bitnami-ssl.conf" diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/setup.sh b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/setup.sh index bad7b1b943f5..131f5acba447 100755 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/setup.sh +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/apache/setup.sh @@ -35,6 +35,10 @@ if [[ ! -f "${APACHE_CONF_DIR}/bitnami/certs/server.crt" ]]; then openssl x509 -req -sha256 -in "$SSL_CSR_FILE" -signkey "$SSL_KEY_FILE" -out "$SSL_CERT_FILE" -days 1825 -extfile <(echo -n "$SSL_EXT") rm -f "$SSL_CSR_FILE" fi +# Load SSL configuration +if [[ -f "${APACHE_CONF_DIR}/bitnami/bitnami.conf" ]] && [[ -f "${APACHE_CONF_DIR}/bitnami/bitnami-ssl.conf" ]]; then + ensure_apache_configuration_exists "Include \"${APACHE_CONF_DIR}/bitnami/bitnami-ssl.conf\"" "bitnami-ssl\.conf" "${APACHE_CONF_DIR}/bitnami/bitnami.conf" +fi # Copy vhosts files if ! is_dir_empty "/vhosts"; then diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libapache.sh b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libapache.sh index 0aeb9a906755..f64a8b0b5e14 100644 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libapache.sh +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libapache.sh @@ -237,18 +237,20 @@ is_apache_not_running() { # Arguments: # $1 - configuration string # $2 - pattern to use for checking if the configuration already exists (default: $1) +# $3 - Apache configuration file (default: $APACHE_CONF_FILE) # Returns: # None ######################## ensure_apache_configuration_exists() { local -r conf="${1:?conf missing}" local -r pattern="${2:-"$conf"}" + local -r conf_file="${3:-"$APACHE_CONF_FILE"}" # Enable configuration by appending to httpd.conf - if ! grep -E -q "$pattern" "$APACHE_CONF_FILE"; then - if is_file_writable "$APACHE_CONF_FILE"; then - cat >> "$APACHE_CONF_FILE" <<< "$conf" + if ! grep -E -q "$pattern" "$conf_file"; then + if is_file_writable "$conf_file"; then + cat >> "$conf_file" <<< "$conf" else - error "Could not add the following configuration to '${APACHE_CONF_FILE}:" + error "Could not add the following configuration to '${conf_file}:" error "" error "$(indent "$conf" 4)" error "" diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libdrupal.sh b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libdrupal.sh index 225e5b186def..aced20a86f0c 100644 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libdrupal.sh +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libdrupal.sh @@ -346,7 +346,7 @@ drupal_set_hash_salt() { ######################### drush_execute() { if am_i_root; then - debug_execute gosu "$WEB_SERVER_DAEMON_USER" drush "--root=${DRUPAL_BASE_DIR}" "$@" + debug_execute run_as_user "$WEB_SERVER_DAEMON_USER" drush "--root=${DRUPAL_BASE_DIR}" "$@" else debug_execute drush "--root=${DRUPAL_BASE_DIR}" "$@" fi diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libmysqlclient.sh b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libmysqlclient.sh index f63dea741844..c8bc278d0266 100644 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libmysqlclient.sh +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libmysqlclient.sh @@ -447,7 +447,7 @@ mysql_stop() { mysql_install_db() { local command="${DB_BIN_DIR}/mysql_install_db" local -a args=("--defaults-file=${DB_CONF_FILE}" "--basedir=${DB_BASE_DIR}" "--datadir=${DB_DATA_DIR}") - + # Add flags specified via the 'DB_EXTRA_FLAGS' environment variable read -r -a db_extra_flags <<< "$(mysql_extra_flags)" [[ "${#db_extra_flags[@]}" -gt 0 ]] && args+=("${db_extra_flags[@]}") @@ -586,9 +586,9 @@ mysql_ensure_user_exists() { auth_string="identified via pam using '$DB_FLAVOR'" elif [[ -n "$password" ]]; then if [[ -n "$auth_plugin" ]]; then - auth_string="identified with $auth_plugin by \"$password\"" + auth_string="identified with $auth_plugin by '$password'" else - auth_string="identified by \"$password\"" + auth_string="identified by '$password'" fi fi debug "creating database user \'$user\'" diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libphp.sh b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libphp.sh index a9bd719ef266..9226d0523aeb 100644 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libphp.sh +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/libphp.sh @@ -87,6 +87,7 @@ php_set_runtime_config() { ! is_empty_value "$PHP_MEMORY_LIMIT" && info "Setting PHP memory_limit option" && php_conf_set memory_limit "$PHP_MEMORY_LIMIT" "$conf_file" ! is_empty_value "$PHP_POST_MAX_SIZE" && info "Setting PHP post_max_size option" && php_conf_set post_max_size "$PHP_POST_MAX_SIZE" "$conf_file" ! is_empty_value "$PHP_UPLOAD_MAX_FILESIZE" && info "Setting PHP upload_max_filesize option" && php_conf_set upload_max_filesize "$PHP_UPLOAD_MAX_FILESIZE" "$conf_file" + ! is_empty_value "$PHP_OUTPUT_BUFFERING" && info "Setting PHP output_buffering option" && php_conf_set output_buffering "$PHP_OUTPUT_BUFFERING" "$conf_file" true } diff --git a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/php-env.sh b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/php-env.sh index 4de618688f75..c67a87029398 100644 --- a/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/php-env.sh +++ b/bitnami/drupal/9/debian-11/rootfs/opt/bitnami/scripts/php-env.sh @@ -83,5 +83,6 @@ export PHP_MAX_INPUT_VARS="${PHP_MAX_INPUT_VARS:-}" export PHP_MEMORY_LIMIT="${PHP_MEMORY_LIMIT:-}" export PHP_POST_MAX_SIZE="${PHP_POST_MAX_SIZE:-}" export PHP_UPLOAD_MAX_FILESIZE="${PHP_UPLOAD_MAX_FILESIZE:-}" +export PHP_OUTPUT_BUFFERING="8196" # Custom environment variables may be defined below diff --git a/bitnami/drupal/9/debian-11/tags-info.yaml b/bitnami/drupal/9/debian-11/tags-info.yaml index a5c63740e9e2..e778ad50f7e2 100644 --- a/bitnami/drupal/9/debian-11/tags-info.yaml +++ b/bitnami/drupal/9/debian-11/tags-info.yaml @@ -1,4 +1,4 @@ rolling-tags: - "9" - 9-debian-11 -- 9.5.7 +- 9.5.8