1
0

initial commit

This commit is contained in:
2025-06-05 11:01:19 +03:00
commit 48f13f97a3
297 changed files with 7136 additions and 0 deletions

40
image-entry.d/70-merge-dirs.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/sh
set -ef
. /run/ngx/iep/00-common.envsh
## hack: override "cache", "lib" and "log" from /angie (and possibly from /etc/angie)
fake_dir=$(mktemp -d)
for n in ${persist_dirs} ; do touch "${fake_dir}/$n" ; done
install -d "${target_root}"
overlaydirs --merge "${target_root}" /etc/angie.dist /etc/angie /angie "${fake_dir}"
## fixup after merge
for n in ${persist_dirs} ; do rm -f "${target_root}/$n" ; done
rm -rf "${fake_dir}"
if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then
src0=/etc/angie.dist/static
dst="${target_root}/static"
rm -rf "${dst}"
for r in /angie /etc/angie ; do
src="$r/static"
[ -d "${src}" ] || continue
if [ -h "${src}" ] ; then
log_always "${src} is a symbolic link, skipping!"
continue
fi
install -d "${dst}"
overlaydirs --merge "${dst}" ${src0} "${src}"
done
[ -d "${dst}" ] || {
log_always "static directory is almost empty!"
install -d "${dst}"
overlaydirs --merge "${dst}" ${src0}
}
fi
exit 0