From cec241e5e1ae2c3cf2913b82efa3b8b846083ca0 Mon Sep 17 00:00:00 2001 From: Lewis Juggins Date: Tue, 6 Oct 2020 18:54:29 +0100 Subject: [PATCH 1/2] Fix Docker configuration for authentication --- Dockerfile | 6 ++++-- changelog/unreleased/issue-119 | 6 ++++++ docker/entrypoint.sh | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/issue-119 diff --git a/Dockerfile b/Dockerfile index 2debe41..ecec78a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,10 @@ RUN go build -o rest-server ./cmd/rest-server FROM alpine -ENV DATA_DIRECTORY /data -ENV PASSWORD_FILE /data/.htpasswd +ENV DATA_DIRECTORY="/data" +ENV PASSWORD_FILE="/data/.htpasswd" +ENV DISABLE_AUTHENTICATION="" +ENV OPTIONS="" RUN apk add --no-cache --update apache2-utils diff --git a/changelog/unreleased/issue-119 b/changelog/unreleased/issue-119 new file mode 100644 index 0000000..c024014 --- /dev/null +++ b/changelog/unreleased/issue-119 @@ -0,0 +1,6 @@ +Security: Fix Docker configuration for DISABLE_AUTHENTICATION + +A regression was introduced which caused the DISABLE_AUTHENTICATION environment variable to stop working in Docker configurations, this was due to a new flag being introduced to disable authentication --no-auth. + +https://github.com/restic/rest-server/issues/119 +https://github.com/restic/rest-server/pull/124 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 300e488..583a838 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,7 +2,9 @@ set -e -if [ -z "$DISABLE_AUTHENTICATION" ]; then +if [ -n "$DISABLE_AUTHENTICATION" ]; then + OPTIONS="--no-auth $OPTIONS" +else if [ ! -f "$PASSWORD_FILE" ]; then touch "$PASSWORD_FILE" fi From 766f1e0c0064ea40c630834dee904c63ba48f395 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 15 May 2021 18:31:01 +0200 Subject: [PATCH 2/2] Revert dockerfile changes and cleanup changelog --- Dockerfile | 6 ++---- changelog/unreleased/issue-119 | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecec78a..2debe41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,8 @@ RUN go build -o rest-server ./cmd/rest-server FROM alpine -ENV DATA_DIRECTORY="/data" -ENV PASSWORD_FILE="/data/.htpasswd" -ENV DISABLE_AUTHENTICATION="" -ENV OPTIONS="" +ENV DATA_DIRECTORY /data +ENV PASSWORD_FILE /data/.htpasswd RUN apk add --no-cache --update apache2-utils diff --git a/changelog/unreleased/issue-119 b/changelog/unreleased/issue-119 index c024014..8d9710a 100644 --- a/changelog/unreleased/issue-119 +++ b/changelog/unreleased/issue-119 @@ -1,6 +1,8 @@ -Security: Fix Docker configuration for DISABLE_AUTHENTICATION +Bugfix: Fix Docker configuration for DISABLE_AUTHENTICATION -A regression was introduced which caused the DISABLE_AUTHENTICATION environment variable to stop working in Docker configurations, this was due to a new flag being introduced to disable authentication --no-auth. +A regression was introduced which caused the DISABLE_AUTHENTICATION environment +variable to stop working in Docker configurations. This has been fix by +automatically setting the option `--no-auth` to disable authentication. https://github.com/restic/rest-server/issues/119 https://github.com/restic/rest-server/pull/124