#!/bin/sh set -ef . /run/ngx/iep/00-common.envsh user_install -d "${volume_root}/lock" for n in ${persist_dirs} ; do [ -n "$n" ] || continue s="/angie/$n" d="${volume_root}/$n" while : ; do [ -d "$s" ] || break if [ -h "$s" ] ; then log_always "$s is a symbolic link, skipping!" break fi ln_s "$s" "$d" ## NB: we're NOT using "chmod -R" due to heavy and (potentially) unnecessary i/o [ "${IEP_ROOT}" = 0 ] || chown "${NGX_USER}:${NGX_GROUP}" "$s" || : break ; done [ -d "$d" ] || user_install -d "$d" done ## provide same symlinks as upstream (both Angie and nginx) docker images do d="${volume_root}/log" [ -e "$d/access.log" ] || ln -s /dev/stdout "$d/access.log" [ -e "$d/error.log" ] || ln -s /dev/stderr "$d/error.log" d="${volume_root}/cache" for n in ${NGX_HTTP_CACHES:-} ; do [ -n "$n" ] || continue [ -d "$d/$n" ] || user_install -d "$d/$n" done if list_have_item "${NGX_HTTP_CONFLOAD}" acme ; then d="${volume_root}/lib/acme" [ -d "$d" ] || user_install -d "$d" fi if list_have_item "${NGX_HTTP_MODULES}" modsecurity ; then d="${target_root}/lib/modsecurity" [ -d "$d" ] || user_install -d "$d" d="${target_root}/log" for n in modsecurity modsecurity/concurrent ; do [ -n "$n" ] || continue [ -d "$d/$n" ] || user_install -d "$d/$n" done fi exit 0