diff --git a/bitnami/apache/2.4/debian-10/Dockerfile b/bitnami/apache/2.4/debian-10/Dockerfile index 818c2620a299..84437b5d50ae 100644 --- a/bitnami/apache/2.4/debian-10/Dockerfile +++ b/bitnami/apache/2.4/debian-10/Dockerfile @@ -22,7 +22,7 @@ ENV APACHE_ENABLE_CUSTOM_PORTS="no" \ APACHE_HTTPS_PORT_NUMBER="" \ APACHE_HTTP_PORT_NUMBER="" \ BITNAMI_APP_NAME="apache" \ - BITNAMI_IMAGE_VERSION="2.4.46-debian-10-r3" \ + BITNAMI_IMAGE_VERSION="2.4.46-debian-10-r4" \ PATH="/opt/bitnami/common/bin:/opt/bitnami/apache/bin:$PATH" EXPOSE 8080 8443 diff --git a/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libservice.sh b/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libservice.sh index 0fa91f65fc4f..55e1dfc4ab28 100644 --- a/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libservice.sh +++ b/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libservice.sh @@ -6,6 +6,7 @@ # Load Generic Libraries . /opt/bitnami/scripts/libvalidations.sh +. /opt/bitnami/scripts/liblog.sh # Functions @@ -175,23 +176,42 @@ EOF ######################## # Generate a logrotate configuration file # Arguments: -# $1 - Log path -# $2 - Period -# $3 - Number of rotations to store -# $4 - Extra options (Optional) +# $1 - Service name +# $2 - Log files pattern +# Flags: +# --period - Period +# --rotations - Number of rotations to store +# --extra - Extra options (Optional) # Returns: # None ######################### generate_logrotate_conf() { local service_name="${1:?service name is missing}" local log_path="${2:?log path is missing}" - local period="${3:-weekly}" - local rotations="${4:-150}" - local extra_options="${5:-}" + local period="weekly" + local rotations="150" + local extra="" local logrotate_conf_dir="/etc/logrotate.d" + local var_name + # Parse optional CLI flags + shift 2 + while [[ "$#" -gt 0 ]]; do + case "$1" in + --period|--rotations|--extra) + var_name="$(echo "$1" | sed -e "s/^--//" -e "s/-/_/g")" + shift + declare "$var_name"="${1:?"$var_name" is missing}" + ;; + *) + echo "Invalid command line flag ${1}" >&2 + return 1 + ;; + esac + shift + done mkdir -p "$logrotate_conf_dir" - cat >"${logrotate_conf_dir}/${service_name}" <"${logrotate_conf_dir}/${service_name}" ${log_path} { ${period} rotate ${rotations} @@ -199,7 +219,7 @@ ${log_path} { compress copytruncate missingok - ${extra_options} +$(indent "$extra" 2) } EOF } diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache-env.sh b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache-env.sh index f60b89139a7f..3ed4bbad5d61 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache-env.sh +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache-env.sh @@ -20,8 +20,8 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" apache_env_vars=( APACHE_HTTP_PORT_NUMBER APACHE_HTTPS_PORT_NUMBER + APACHE_HTTP_PORT APACHE_HTTPS_PORT - WEB_SERVER_HTTPS_PORT ) for env_var in "${apache_env_vars[@]}"; do file_env_var="${env_var}_FILE" @@ -59,10 +59,10 @@ export APACHE_DEFAULT_HTTP_PORT_NUMBER="8080" # only used at build time export WEB_SERVER_DEFAULT_HTTP_PORT_NUMBER="$APACHE_DEFAULT_HTTP_PORT_NUMBER" export APACHE_DEFAULT_HTTPS_PORT_NUMBER="8443" # only used at build time export WEB_SERVER_DEFAULT_HTTPS_PORT_NUMBER="$APACHE_DEFAULT_HTTPS_PORT_NUMBER" +APACHE_HTTP_PORT_NUMBER="${APACHE_HTTP_PORT_NUMBER:-"${APACHE_HTTP_PORT:-}"}" export APACHE_HTTP_PORT_NUMBER="${APACHE_HTTP_PORT_NUMBER:-}" export WEB_SERVER_HTTP_PORT_NUMBER="$APACHE_HTTP_PORT_NUMBER" APACHE_HTTPS_PORT_NUMBER="${APACHE_HTTPS_PORT_NUMBER:-"${APACHE_HTTPS_PORT:-}"}" -APACHE_HTTPS_PORT_NUMBER="${APACHE_HTTPS_PORT_NUMBER:-"${WEB_SERVER_HTTPS_PORT:-}"}" export APACHE_HTTPS_PORT_NUMBER="${APACHE_HTTPS_PORT_NUMBER:-}" export WEB_SERVER_HTTPS_PORT_NUMBER="$APACHE_HTTPS_PORT_NUMBER" diff --git a/bitnami/apache/README.md b/bitnami/apache/README.md index 0037f9f5f955..9e243142fc86 100644 --- a/bitnami/apache/README.md +++ b/bitnami/apache/README.md @@ -43,7 +43,7 @@ Non-root container images add an extra layer of security and are generally recom Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). -* [`2.4-debian-10`, `2.4.46-debian-10-r3`, `2.4`, `2.4.46`, `latest` (2.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-apache/blob/2.4.46-debian-10-r3/2.4/debian-10/Dockerfile) +* [`2.4`, `2.4-debian-10`, `2.4.46`, `2.4.46-debian-10-r4`, `latest` (2.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-apache/blob/2.4.46-debian-10-r4/2.4/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/apache GitHub repo](https://github.com/bitnami/bitnami-docker-apache).