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