Browse Source

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

framadate
Valentin Lab 6 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/* # rm -rf /var/lib/apt/lists/*
# RUN docker-php-ext-install pgsql pdo_pgsql # 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 ## XXXvlab: could load these in 'entrypoint.sh' to be more dynamic
RUN a2enmod headers proxy_http rewrite ssl proxy_wstunnel http2 proxy_connect 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 ## Can remove this when SSL certificate are all valid ones
RUN apt-get update && apt-get install -y --force-yes ssl-cert RUN apt-get update && apt-get install -y --force-yes ssl-cert
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ] ENTRYPOINT [ "/entrypoint.sh" ]

18
apache/lib/common

@ -422,8 +422,8 @@ export -f apache_vhost_statement
apache_code_dir() { apache_code_dir() {
local cfg="$1" www_data_gid local_path 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 return 1
} }
domain=$(get_domain "$cfg") || return 1 domain=$(get_domain "$cfg") || return 1
@ -432,7 +432,7 @@ apache_code_dir() {
host_path="$DATASTORE/$BASE_SERVICE_NAME${local_path}" host_path="$DATASTORE/$BASE_SERVICE_NAME${local_path}"
mkdir -p "$host_path" || return 1 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'." info "Set permission for read and traversal on '$host_path'."
init-config-add " init-config-add "
@ -458,11 +458,11 @@ apache_data_dirs() {
done done
done <<< "$data_dirs" 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 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=() dirs=()
for d in "${data[@]}"; do for d in "${data[@]}"; do
@ -470,8 +470,8 @@ apache_data_dirs() {
done done
mkdir -p "${dirs[@]}" 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 " init-config-add "
$SERVICE_NAME: $SERVICE_NAME:
@ -754,7 +754,7 @@ EOF
} }
__vhost_publish_dir_statement() { __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}" local_path="/var/www/${dest}"
cat <<EOF cat <<EOF

1
apache/metadata.yml

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

Loading…
Cancel
Save