Update 100-setup-error-pages.sh (#12)

Random template generator, also picked up `nginx-error-pages` template, which we don't want. Proposing small patch to exclude from `allowed_templates`
This commit is contained in:
xplizit 2021-05-02 13:03:54 +02:00 committed by GitHub
parent 455bc21d51
commit 914d6572b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,11 @@
#!/usr/bin/env sh
set -e
# on `docker restart` next directory keep existing: <https://github.com/tarampampam/error-pages/issues/3>
if [ -d /opt/html/nginx-error-pages ]; then
rm -Rf /opt/html/nginx-error-pages;
fi;
# allows to use random template
if [ ! -z "$TEMPLATE_NAME" ] && ([ "$TEMPLATE_NAME" = "random" ] || [ "$TEMPLATE_NAME" = "RANDOM" ]); then
# find all templates in directory (only template directories must be located in /opt/html)
@ -27,11 +32,6 @@ fi;
# allows "direct access" to the error pages using URLs like "/500.html"
ln -f -s "/opt/html/$TEMPLATE_NAME/"* /opt/html;
# on `docker restart` next directory keep existing: <https://github.com/tarampampam/error-pages/issues/3>
if [ -d /opt/html/nginx-error-pages ]; then
rm -Rf /opt/html/nginx-error-pages;
fi;
# next directory is required for easy nginx `error_page` usage
mkdir /opt/html/nginx-error-pages;