2024-07-11 13:37:35 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## NB: NGX_DEBUG is set via image build script
|
|
|
|
|
|
|
|
set -a
|
2024-07-20 16:35:39 +03:00
|
|
|
NGX_STRICT_LOAD=$(gobool_to_int "${NGX_STRICT_LOAD:-1}" 1)
|
|
|
|
NGX_PROCESS_STATIC=$(gobool_to_int "${NGX_PROCESS_STATIC:-0}" 0)
|
2024-07-11 13:37:35 +03:00
|
|
|
|
|
|
|
NGX_HTTP=$(gobool_to_int "${NGX_HTTP:-1}" 1)
|
|
|
|
NGX_MAIL=$(gobool_to_int "${NGX_MAIL:-0}" 0)
|
|
|
|
NGX_STREAM=$(gobool_to_int "${NGX_STREAM:-0}" 0)
|
|
|
|
set +a
|
|
|
|
|
|
|
|
if [ "${NGX_HTTP}${NGX_MAIL}${NGX_STREAM}" = '000' ] ; then
|
|
|
|
log_always '======================================'
|
|
|
|
log_always 'WARNING!'
|
|
|
|
log_always 'Angie is almost completely TURNED OFF'
|
|
|
|
log_always '======================================'
|
|
|
|
fi
|
2024-07-20 16:35:39 +03:00
|
|
|
|
|
|
|
unset default_dirs_merge default_dirs_link
|
2024-07-31 14:04:15 +03:00
|
|
|
default_dirs_merge='autoconf conf mod modules site snip'
|
2024-07-20 16:35:39 +03:00
|
|
|
default_dirs_link=''
|
|
|
|
|
|
|
|
if [ "${NGX_PROCESS_STATIC}" = 1 ] ; then
|
|
|
|
NGX_DIRS_MERGE="${NGX_DIRS_MERGE:-} static"
|
|
|
|
else
|
|
|
|
NGX_DIRS_LINK="${NGX_DIRS_LINK:-} static"
|
|
|
|
fi
|
|
|
|
|
|
|
|
NGX_DIRS_MERGE=$(sort_dedup_list "${default_dirs_merge} ${NGX_DIRS_MERGE:-}")
|
|
|
|
NGX_DIRS_LINK=$(sort_dedup_list "${default_dirs_link} ${NGX_DIRS_LINK:-}")
|
|
|
|
|
|
|
|
unset default_dirs_merge default_dirs_link
|
2024-07-23 21:59:49 +03:00
|
|
|
|
2024-07-26 01:18:59 +03:00
|
|
|
unset i dirs
|
|
|
|
|
|
|
|
dirs=
|
|
|
|
for i in ${NGX_DIRS_MERGE:-} ; do
|
|
|
|
[ -n "$i" ] || continue
|
|
|
|
|
|
|
|
case "$i" in
|
|
|
|
/* | */.* | *./* | *\** | *\?* )
|
|
|
|
log_always "NGX_DIRS_MERGE: dir '$i' is not legal, skipping"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
dirs=$(append_list "${dirs}" "$i")
|
|
|
|
done
|
|
|
|
export NGX_DIRS_MERGE="${dirs}"
|
|
|
|
|
|
|
|
dirs=
|
2024-07-23 21:59:49 +03:00
|
|
|
for i in ${NGX_DIRS_LINK:-} ; do
|
|
|
|
[ -n "$i" ] || continue
|
|
|
|
|
2024-07-26 01:18:59 +03:00
|
|
|
case "$i" in
|
|
|
|
/* | */.* | *./* | *\** | *\?* )
|
|
|
|
log_always "NGX_DIRS_LINK: dir '$i' is not legal, skipping"
|
2024-07-23 21:59:49 +03:00
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2024-07-26 01:18:59 +03:00
|
|
|
if list_have_item "${NGX_DIRS_MERGE}" "$i" ; then
|
|
|
|
log "$i is already specified in NGX_DIRS_MERGE - removing from NGX_DIRS_LINK"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
dirs=$(append_list "${dirs}" "$i")
|
2024-07-23 21:59:49 +03:00
|
|
|
done
|
2024-07-26 01:18:59 +03:00
|
|
|
export NGX_DIRS_LINK="${dirs}"
|
2024-07-23 21:59:49 +03:00
|
|
|
|
2024-07-26 01:18:59 +03:00
|
|
|
unset i dirs
|