From 79aea988f2e7e242dcbc4edefddb176293b4cda9 Mon Sep 17 00:00:00 2001 From: Josh Bentley Date: Fri, 3 May 2019 10:39:30 +0100 Subject: [PATCH 1/3] add conditional to allow nginxauth to be commented out --- Dockerfile | 3 ++- src/00_init.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed70b45..34637a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ FROM nginx:1.15 LABEL maintainer "fraoustin@gmail.com" ENV SET_CONTAINER_TIMEZONE false -ENV CONTAINER_TIMEZONE "" +ENV CONTAINER_TIMEZONE "" +ENV DISABLE_AUTH true # manage user www-data RUN usermod -u 1000 www-data diff --git a/src/00_init.sh b/src/00_init.sh index c20f486..353ad26 100644 --- a/src/00_init.sh +++ b/src/00_init.sh @@ -1,5 +1,6 @@ #!/bin/bash - -if [ ! -z "$WEBUSER" ]; then +if [ "$DISABLE_AUTH" == true ]; then + sed -i '' '/auth_basic/s/^/#/' /etc/nginx/conf.d/default.conf +elif [ ! -z "$WEBUSER" ]; then addauth $WEBUSER $WEBPASSWORD fi From 4c5061f0805ba7f9500b65f467aaa0fb8bf1e4f6 Mon Sep 17 00:00:00 2001 From: Josh Bentley Date: Fri, 3 May 2019 11:58:59 +0100 Subject: [PATCH 2/3] fix sed systax to work on linux not mac --- src/00_init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/00_init.sh b/src/00_init.sh index 353ad26..68c9e16 100644 --- a/src/00_init.sh +++ b/src/00_init.sh @@ -1,6 +1,6 @@ #!/bin/bash if [ "$DISABLE_AUTH" == true ]; then - sed -i '' '/auth_basic/s/^/#/' /etc/nginx/conf.d/default.conf + sed -i '/auth_basic/s/^/#/' /etc/nginx/conf.d/default.conf elif [ ! -z "$WEBUSER" ]; then addauth $WEBUSER $WEBPASSWORD fi From 60c5697c46689eb73678eb25a53a12a887dd6aae Mon Sep 17 00:00:00 2001 From: Josh Bentley Date: Fri, 3 May 2019 12:04:39 +0100 Subject: [PATCH 3/3] add refrence to README and set safe default to docker file for auth --- Dockerfile | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 34637a7..5fa3454 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ LABEL maintainer "fraoustin@gmail.com" ENV SET_CONTAINER_TIMEZONE false ENV CONTAINER_TIMEZONE "" -ENV DISABLE_AUTH true +ENV DISABLE_AUTH false # manage user www-data RUN usermod -u 1000 www-data diff --git a/README.md b/README.md index 978d5ec..7b9b1c7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ load when start image load file in - SET_CONTAINER_TIMEZONE (false or true) manage time of container - CONTAINER_TIMEZONE timezone of container +- DISABLE_AUTH (false or true) allows you to disable auth on nginx - WEBUSER (default user) - WEBPASSWORD (default pass) - COLOR (default blue) for web ihm (blue, green, grey, greydark, orange, purple, red)