mirror of
https://github.com/restic/rest-server.git
synced 2025-12-06 17:15:45 -08:00
Fix Docker configuration for authentication
This commit is contained in:
committed by
Michael Eischer
parent
a44c025cd3
commit
cec241e5e1
@@ -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
|
||||
|
||||
|
||||
6
changelog/unreleased/issue-119
Normal file
6
changelog/unreleased/issue-119
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user