diff --git a/bitnami/moodle/4.1/debian-11/Dockerfile b/bitnami/moodle/4.1/debian-11/Dockerfile index 8fdff803923e..b944b4a81903 100644 --- a/bitnami/moodle/4.1/debian-11/Dockerfile +++ b/bitnami/moodle/4.1/debian-11/Dockerfile @@ -7,17 +7,17 @@ ARG EXTRA_LOCALES ARG TARGETARCH ARG WITH_ALL_LOCALES="no" -LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2023-07-15T12:26:35Z" \ +LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \ + org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ + org.opencontainers.image.created="2023-07-19T20:37:01Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="4.1.4-debian-11-r11" \ + org.opencontainers.image.ref.name="4.1.4-debian-11-r25" \ org.opencontainers.image.title="moodle" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="4.1.4" -ENV HOME="/" \ - OS_ARCH="${TARGETARCH:-amd64}" \ +ENV OS_ARCH="${TARGETARCH:-amd64}" \ OS_FLAVOUR="debian-11" \ OS_NAME="linux" @@ -47,7 +47,6 @@ RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \ RUN apt-get autoremove --purge -y curl && \ apt-get update && apt-get upgrade -y && \ apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives -RUN chmod g+rwX /opt/bitnami RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8 RUN sed -i -e '/pam_loginuid.so/ s/^#*/#/' /etc/pam.d/cron RUN update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX && \ @@ -73,6 +72,5 @@ ENV APACHE_HTTPS_PORT_NUMBER="" \ EXPOSE 8080 8443 -USER root ENTRYPOINT [ "/opt/bitnami/scripts/moodle/entrypoint.sh" ] CMD [ "/opt/bitnami/scripts/moodle/run.sh" ] diff --git a/bitnami/moodle/4.1/debian-11/prebuildfs/opt/bitnami/scripts/libvalidations.sh b/bitnami/moodle/4.1/debian-11/prebuildfs/opt/bitnami/scripts/libvalidations.sh index 3c6a4109c2c5..54987abca42a 100644 --- a/bitnami/moodle/4.1/debian-11/prebuildfs/opt/bitnami/scripts/libvalidations.sh +++ b/bitnami/moodle/4.1/debian-11/prebuildfs/opt/bitnami/scripts/libvalidations.sh @@ -187,6 +187,25 @@ validate_port() { fi } +######################## +# Validate if the provided argument is a valid IPv6 address +# Arguments: +# $1 - IP to validate +# Returns: +# Boolean +######################### +validate_ipv6() { + local ip="${1:?ip is missing}" + local stat=1 + local full_address_regex='^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$' + local short_address_regex='^((([0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}){0,6}::(([0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}){0,6})$' + + if [[ $ip =~ $full_address_regex || $ip =~ $short_address_regex || $ip == "::" ]]; then + stat=0 + fi + return "$stat" +} + ######################## # Validate if the provided argument is a valid IPv4 address # Arguments: @@ -204,7 +223,26 @@ validate_ipv4() { && ${ip_array[2]} -le 255 && ${ip_array[3]} -le 255 ]] stat=$? fi - return $stat + return "$stat" +} + +######################## +# Validate if the provided argument is a valid IPv4 or IPv6 address +# Arguments: +# $1 - IP to validate +# Returns: +# Boolean +######################### +validate_ip() { + local ip="${1:?ip is missing}" + local stat=1 + + if validate_ipv4 "$ip"; then + stat=0 + else + stat=$(validate_ipv6 "$ip") + fi + return "$stat" } ########################