From 914d6572b72f77f91a847f1fca0a255971982895 Mon Sep 17 00:00:00 2001 From: xplizit <18211823+xpliz@users.noreply.github.com> Date: Sun, 2 May 2021 13:03:54 +0200 Subject: [PATCH] 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` --- docker/docker-entrypoint.d/100-setup-error-pages.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/docker-entrypoint.d/100-setup-error-pages.sh b/docker/docker-entrypoint.d/100-setup-error-pages.sh index 3d28a26..3f696a5 100755 --- a/docker/docker-entrypoint.d/100-setup-error-pages.sh +++ b/docker/docker-entrypoint.d/100-setup-error-pages.sh @@ -1,6 +1,11 @@ #!/usr/bin/env sh set -e +# on `docker restart` next directory keep existing: +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: -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;