Browse Source

new: [apache] repaired ``publish-dir`` relation.

framadate
Valentin Lab 5 years ago
parent
commit
a55c69b67c
  1. 8
      apache/build/Dockerfile
  2. 18
      apache/lib/common
  3. 1
      apache/metadata.yml

8
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" ]

18
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 <<EOF

1
apache/metadata.yml

@ -18,6 +18,7 @@ config-resources:
provides:
web-proxy:
tech-dep: "reversed"
publish-dir:
uses:
log-rotate:
#constraint: required | recommended | optional

Loading…
Cancel
Save