From bb310507d7219da98a0699130fffa3b06a1e3baa Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Wed, 31 Jul 2024 15:18:06 +0200 Subject: [PATCH] [bitnami/ghost] Release 5.88.3-debian-12-r0 (#70460) Signed-off-by: Bitnami Containers --- bitnami/ghost/5/debian-12/Dockerfile | 10 +- .../opt/bitnami/.bitnami_components.json | 2 +- .../opt/bitnami/scripts/libmysqlclient.sh | 94 ++++++++++++++++++- bitnami/ghost/5/debian-12/tags-info.yaml | 2 +- 4 files changed, 100 insertions(+), 8 deletions(-) diff --git a/bitnami/ghost/5/debian-12/Dockerfile b/bitnami/ghost/5/debian-12/Dockerfile index b9a76cadcc195..c1d78c4c6f04f 100644 --- a/bitnami/ghost/5/debian-12/Dockerfile +++ b/bitnami/ghost/5/debian-12/Dockerfile @@ -7,15 +7,15 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2024-07-26T18:08:43Z" \ + org.opencontainers.image.created="2024-07-31T12:25:36Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/ghost/README.md" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="5.88.2-debian-12-r0" \ + org.opencontainers.image.ref.name="5.88.3-debian-12-r0" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/ghost" \ org.opencontainers.image.title="ghost" \ org.opencontainers.image.vendor="Broadcom, Inc." \ - org.opencontainers.image.version="5.88.2" + org.opencontainers.image.version="5.88.3" ENV HOME="/" \ OS_ARCH="${TARGETARCH:-amd64}" \ @@ -31,7 +31,7 @@ RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \ "python-3.11.9-11-linux-${OS_ARCH}-debian-12" \ "node-18.20.4-4-linux-${OS_ARCH}-debian-12" \ "mysql-client-10.11.8-1-linux-${OS_ARCH}-debian-12" \ - "ghost-5.88.2-0-linux-${OS_ARCH}-debian-12" \ + "ghost-5.88.3-0-linux-${OS_ARCH}-debian-12" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ @@ -50,7 +50,7 @@ RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true COPY rootfs / RUN /opt/bitnami/scripts/ghost/postunpack.sh RUN /opt/bitnami/scripts/mysql-client/postunpack.sh -ENV APP_VERSION="5.88.2" \ +ENV APP_VERSION="5.88.3" \ BITNAMI_APP_NAME="ghost" \ PATH="/opt/bitnami/python/bin:/opt/bitnami/node/bin:/opt/bitnami/mysql/bin:/opt/bitnami/ghost/bin:$PATH" diff --git a/bitnami/ghost/5/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/ghost/5/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json index a394f2dd7df60..1ea3ac87ba400 100644 --- a/bitnami/ghost/5/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/ghost/5/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json @@ -3,7 +3,7 @@ "arch": "amd64", "distro": "debian-12", "type": "NAMI", - "version": "5.88.2-0" + "version": "5.88.3-0" }, "mysql-client": { "arch": "amd64", diff --git a/bitnami/ghost/5/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh b/bitnami/ghost/5/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh index ad32c9c374b64..3e2b3963bfbc6 100644 --- a/bitnami/ghost/5/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh +++ b/bitnami/ghost/5/debian-12/rootfs/opt/bitnami/scripts/libmysqlclient.sh @@ -466,6 +466,98 @@ mysql_migrate_old_configuration() { fi } +######################## +# Ensure a db user exists with the given password for the '%' host +# Globals: +# DB_* +# Flags: +# -p|--password - database password +# -u|--user - database user +# --auth-plugin - authentication plugin +# --use-ldap - authenticate user via LDAP +# --host - database host +# --port - database host +# Arguments: +# $1 - database user +# Returns: +# None +######################### +mysql_ensure_user_exists() { + local -r user="${1:?user is required}" + local password="" + local auth_plugin="" + local use_ldap="no" + local hosts + local auth_string="" + # For accessing an external database + local db_host="" + local db_port="" + + # Validate arguments + shift 1 + while [ "$#" -gt 0 ]; do + case "$1" in + -p|--password) + shift + password="${1:?missing database password}" + ;; + --auth-plugin) + shift + auth_plugin="${1:?missing authentication plugin}" + ;; + --use-ldap) + use_ldap="yes" + ;; + --host) + shift + db_host="${1:?missing database host}" + ;; + --port) + shift + db_port="${1:?missing database port}" + ;; + *) + echo "Invalid command line flag $1" >&2 + return 1 + ;; + esac + shift + done + if is_boolean_yes "$use_ldap"; then + 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'" + else + auth_string="identified by '$password'" + fi + fi + debug "creating database user \'$user\'" + + local -a mysql_execute_cmd=("mysql_execute") + local -a mysql_execute_print_output_cmd=("mysql_execute_print_output") + if [[ -n "$db_host" && -n "$db_port" ]]; then + mysql_execute_cmd=("mysql_remote_execute" "$db_host" "$db_port") + mysql_execute_print_output_cmd=("mysql_remote_execute_print_output" "$db_host" "$db_port") + fi + + local mysql_create_user_cmd + [[ "$DB_FLAVOR" = "mariadb" ]] && mysql_create_user_cmd="create or replace user" || mysql_create_user_cmd="create user if not exists" + "${mysql_execute_cmd[@]}" "mysql" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" <