diff --git a/bitnami/mastodon/4/debian-11/Dockerfile b/bitnami/mastodon/4/debian-11/Dockerfile index 509127b558af..f80897a9b522 100644 --- a/bitnami/mastodon/4/debian-11/Dockerfile +++ b/bitnami/mastodon/4/debian-11/Dockerfile @@ -4,7 +4,7 @@ ARG TARGETARCH LABEL org.opencontainers.image.authors="https://bitnami.com/contact" \ org.opencontainers.image.description="Application packaged by Bitnami" \ - org.opencontainers.image.ref.name="4.0.2-debian-11-r5" \ + org.opencontainers.image.ref.name="4.0.2-debian-11-r6" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/mastodon" \ org.opencontainers.image.title="mastodon" \ org.opencontainers.image.vendor="VMware, Inc." \ @@ -22,10 +22,11 @@ RUN install_packages acl ca-certificates curl ffmpeg file imagemagick libbsd0 li RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \ COMPONENTS=( \ "python-3.8.16-0-linux-${OS_ARCH}-debian-11" \ + "wait-for-port-1.0.5-1-linux-${OS_ARCH}-debian-11" \ "ruby-3.0.5-0-linux-${OS_ARCH}-debian-11" \ "redis-client-7.0.6-0-linux-${OS_ARCH}-debian-11" \ "postgresql-client-15.1.0-0-linux-${OS_ARCH}-debian-11" \ - "node-16.18.1-1-linux-${OS_ARCH}-debian-11" \ + "node-16.19.0-0-linux-${OS_ARCH}-debian-11" \ "mastodon-4.0.2-1-linux-${OS_ARCH}-debian-11" \ "gosu-1.14.0-156-linux-${OS_ARCH}-debian-11" \ ) && \ @@ -46,7 +47,7 @@ COPY rootfs / RUN /opt/bitnami/scripts/mastodon/postunpack.sh ENV APP_VERSION="4.0.2" \ BITNAMI_APP_NAME="mastodon" \ - PATH="/opt/bitnami/python/bin:/opt/bitnami/ruby/bin:/opt/bitnami/redis/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/node/bin:/opt/bitnami/mastodon/bin:/opt/bitnami/common/bin:$PATH" + PATH="/opt/bitnami/python/bin:/opt/bitnami/common/bin:/opt/bitnami/ruby/bin:/opt/bitnami/redis/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/node/bin:/opt/bitnami/mastodon/bin:$PATH" EXPOSE 3000 diff --git a/bitnami/mastodon/4/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/mastodon/4/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json index f06a4ce8561e..b23fde783ce3 100644 --- a/bitnami/mastodon/4/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/mastodon/4/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json @@ -15,10 +15,10 @@ }, "node": { "arch": "amd64", - "digest": "02c19388db4ac3c8d8d614285a7092714836f87c45cf2ab39982361346816749", + "digest": "14ee50e198ce5a739e1040de6428ed438fe5b1d45819a14e87f39c7d3d900197", "distro": "debian-11", "type": "NAMI", - "version": "16.18.1-1" + "version": "16.19.0-0" }, "postgresql-client": { "arch": "amd64", @@ -47,5 +47,12 @@ "distro": "debian-11", "type": "NAMI", "version": "3.0.5-0" + }, + "wait-for-port": { + "arch": "amd64", + "digest": "6b1bd6f534ef27b696922dcbdc0e377ac1a7db1e2bc1ff688ae0fa80bbfcb618", + "distro": "debian-11", + "type": "NAMI", + "version": "1.0.5-1" } } \ No newline at end of file diff --git a/bitnami/mastodon/4/debian-11/rootfs/opt/bitnami/scripts/libmastodon.sh b/bitnami/mastodon/4/debian-11/rootfs/opt/bitnami/scripts/libmastodon.sh index 3b79ea72d78c..ac05bbfe0f04 100644 --- a/bitnami/mastodon/4/debian-11/rootfs/opt/bitnami/scripts/libmastodon.sh +++ b/bitnami/mastodon/4/debian-11/rootfs/opt/bitnami/scripts/libmastodon.sh @@ -108,8 +108,8 @@ mastodon_validate() { check_true_false "MASTODON_S3_ENABLED" if is_boolean_yes "$MASTODON_S3_ENABLED"; then - check_empty_value "MASTODON_S3_HOST" - check_resolved_hostname "$MASTODON_S3_HOST" + check_empty_value "MASTODON_S3_HOSTNAME" + check_resolved_hostname "$MASTODON_S3_HOSTNAME" check_valid_port "MASTODON_S3_PORT_NUMBER" check_empty_value "MASTODON_S3_ALIAS" check_empty_value "MASTODON_S3_ENDPOINT" @@ -283,7 +283,7 @@ mastodon_wait_for_postgresql_connection() { debug "$res" echo "$res" | grep -q '1 row' } - if ! retry_while "check_postgresql_connection" "$MASTODON_STARTUP_ATTEMPTS"; then + if ! retry_while "debug_execute check_postgresql_connection" "$MASTODON_STARTUP_ATTEMPTS"; then error "Could not connect to the database" return 1 fi @@ -302,7 +302,7 @@ mastodon_wait_for_elasticsearch_connection() { local -r connection_string="${1:?missing connection string}" info "Waiting for Elasticsearch to be ready at $connection_string" check_elasticsearch_connection() { - local curl_args=("-k" "$connection_string") + local curl_args=("-k" "$connection_string" "--max-time" "5") if ! is_empty_value "${MASTODON_ELASTICSEARCH_PASSWORD:-}"; then curl_args+=("-u" "$MASTODON_ELASTICSEARCH_USER:$MASTODON_ELASTICSEARCH_PASSWORD") fi @@ -310,7 +310,7 @@ mastodon_wait_for_elasticsearch_connection() { debug "$res" echo "$res" | grep -q 'You Know' } - if ! retry_while "check_elasticsearch_connection" "$MASTODON_STARTUP_ATTEMPTS"; then + if ! retry_while "debug_execute check_elasticsearch_connection" "$MASTODON_STARTUP_ATTEMPTS"; then error "Could not connect to the database" return 1 fi @@ -325,16 +325,11 @@ mastodon_wait_for_elasticsearch_connection() { # Returns: None ######################### mastodon_wait_for_s3_connection() { - local -r connection_string="${1:?missing connection string}" - info "Waiting for S3 to be ready at $connection_string" - check_s3_connection() { - local -r curl_args=("-k" "$connection_string") - local -r res=$(curl "${curl_args[@]}" 2>&1) - debug "$res" - echo "$res" | grep -q 'NoSuchBucket' - } - if ! retry_while "check_s3_connection" "$MASTODON_STARTUP_ATTEMPTS"; then - error "Could not connect to the database" + local -r host="${1:?missing host}" + local -r port="${2:?missing port}" + info "Waiting for S3 to be ready at ${MASTODON_S3_PROTOCOL}://${host}:${port}" + if ! retry_while "debug_execute wait-for-port --host ${host} ${port}" "$MASTODON_STARTUP_ATTEMPTS"; then + error "Could not connect to S3" return 1 fi info "S3 instance is ready" @@ -357,7 +352,7 @@ mastodon_wait_for_redis_connection() { debug "$res" echo "$res" | grep -q 'PONG' } - if ! retry_while "check_redis_connection" "$MASTODON_STARTUP_ATTEMPTS"; then + if ! retry_while "debug_execute check_redis_connection" "$MASTODON_STARTUP_ATTEMPTS"; then error "Could not connect to Redis" return 1 fi @@ -378,12 +373,12 @@ mastodon_wait_for_web_connection() { check_web_connection() { # We use the /health endpoint to check if the web server is ready # https://github.com/mastodon/mastodon/blob/main/config/initializers/1_hosts.rb#L34 - local -r curl_args=("${connection_string}/health") + local -r curl_args=("${connection_string}/health" "--max-time" "5") local -r res=$(curl "${curl_args[@]}" 2>&1) debug "$res" echo "$res" | grep -q 'OK' } - if ! retry_while "check_web_connection" "$MASTODON_STARTUP_ATTEMPTS"; then + if ! retry_while "debug_execute check_web_connection" "$MASTODON_STARTUP_ATTEMPTS"; then error "Could not connect to the Web server" return 1 fi @@ -416,7 +411,7 @@ mastodon_initialize() { # https://github.com/mastodon/mastodon/blob/main/chart/templates/deployment-web.yaml#L89 if is_boolean_yes "$MASTODON_S3_ENABLED"; then info "Waiting for S3 connection" - mastodon_wait_for_s3_connection "$MASTODON_S3_ENDPOINT" + mastodon_wait_for_s3_connection "$MASTODON_S3_HOSTNAME" "$MASTODON_S3_PORT_NUMBER" fi local -r psql_connection_string="postgresql://${MASTODON_DATABASE_USERNAME}:${MASTODON_DATABASE_PASSWORD}@${MASTODON_DATABASE_HOST}:${MASTODON_DATABASE_PORT_NUMBER}/${MASTODON_DATABASE_NAME}"