|
@ -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 |
|
|