From a55c69b67cc02a5c1fd189506c4f27a25b3a1b55 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 16 May 2019 15:19:43 +0200 Subject: [PATCH] new: [apache] repaired ``publish-dir`` relation. --- apache/build/Dockerfile | 8 ++++++++ apache/lib/common | 18 +++++++++--------- apache/metadata.yml | 1 + 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/apache/build/Dockerfile b/apache/build/Dockerfile index b7f078b..d14a661 100644 --- a/apache/build/Dockerfile +++ b/apache/build/Dockerfile @@ -18,6 +18,13 @@ FROM docker.0k.io/php:7.3-apache # rm -rf /var/lib/apt/lists/* # RUN docker-php-ext-install pgsql pdo_pgsql +## Framadate +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y libicu-dev libpq-dev libxml2-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + docker-php-ext-install mbstring intl xml pdo_pgsql + ## XXXvlab: could load these in 'entrypoint.sh' to be more dynamic RUN a2enmod headers proxy_http rewrite ssl proxy_wstunnel http2 proxy_connect @@ -25,6 +32,7 @@ RUN a2enmod headers proxy_http rewrite ssl proxy_wstunnel http2 proxy_connect ## Can remove this when SSL certificate are all valid ones RUN apt-get update && apt-get install -y --force-yes ssl-cert + COPY entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/apache/lib/common b/apache/lib/common index 7a70f2e..c67c4e6 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -422,8 +422,8 @@ export -f apache_vhost_statement apache_code_dir() { local cfg="$1" www_data_gid local_path - www_data_gid=$(cached_cmd_on_base_image apache 'id -g www-data') || { - debug "Failed to query for www-data gid in ${DARKYELLOW}apache${NORMAL} base image." + www_data_gid=$(cached_cmd_on_base_image "$TARGET_SERVICE_NAME" 'id -g www-data') || { + debug "Failed to query for www-data gid in ${DARKYELLOW}$TARGET_SERVICE_NAME${NORMAL} base image." return 1 } domain=$(get_domain "$cfg") || return 1 @@ -432,7 +432,7 @@ apache_code_dir() { host_path="$DATASTORE/$BASE_SERVICE_NAME${local_path}" mkdir -p "$host_path" || return 1 - setfacl -R -m g:"$www_data_gid":rx "$host_path" + setfacl -R -m g:"$www_data_gid":rx "$host_path" || return 1 info "Set permission for read and traversal on '$host_path'." init-config-add " @@ -458,11 +458,11 @@ apache_data_dirs() { done done <<< "$data_dirs" - www_data_gid=$(cached_cmd_on_base_image apache 'id -g www-data') || { - debug "Failed to query for www-data gid in ${DARKYELLOW}apache${NORMAL} base image." + www_data_gid=$(cached_cmd_on_base_image "$TARGET_SERVICE_NAME" 'id -g www-data') || { + debug "Failed to query for www-data gid in ${DARKYELLOW}$TARGET_SERVICE_NAME${NORMAL} base image." return 1 } - info "www-data gid from ${DARKYELLOW}apache${NORMAL} is '$www_data_gid'" + info "www-data gid from ${DARKYELLOW}$TARGET_SERVICE_NAME${NORMAL} is '$www_data_gid'" dirs=() for d in "${data[@]}"; do @@ -470,8 +470,8 @@ apache_data_dirs() { done mkdir -p "${dirs[@]}" - setfacl -R -m g:"$www_data_gid":rwx "${dirs[@]}" - setfacl -R -d -m g:"$www_data_gid":rwx "${dirs[@]}" + setfacl -R -m g:"$www_data_gid":rwx "${dirs[@]}" || return 1 + setfacl -R -d -m g:"$www_data_gid":rwx "${dirs[@]}" || return 1 init-config-add " $SERVICE_NAME: @@ -754,7 +754,7 @@ EOF } __vhost_publish_dir_statement() { - local protocol="$1" cfg="$2" dest="$3" dest + local protocol="$1" cfg="$2" dest="$3" location local_path="/var/www/${dest}" cat <