From cd57cd5e3fe6916c18908c5ddd4c72745c0b7870 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 14 Aug 2019 03:10:02 +0200 Subject: Move user.passwd to /tmp --- 2.4/conf/conf-available/dav.conf | 2 +- 2.4/docker-entrypoint.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/2.4/conf/conf-available/dav.conf b/2.4/conf/conf-available/dav.conf index caacd03..f88260d 100644 --- a/2.4/conf/conf-available/dav.conf +++ b/2.4/conf/conf-available/dav.conf @@ -6,7 +6,7 @@ Alias / "/var/lib/dav/data/" AuthType Basic AuthName "WebDAV" - AuthUserFile "/user.passwd" + AuthUserFile "/tmp/user.passwd" Require valid-user diff --git a/2.4/docker-entrypoint.sh b/2.4/docker-entrypoint.sh index 3ee4575..3f21549 100755 --- a/2.4/docker-entrypoint.sh +++ b/2.4/docker-entrypoint.sh @@ -49,16 +49,16 @@ if [ "x$AUTH_TYPE" != "x" ]; then fi # Add password hash, unless "user.passwd" already exists (ie, bind mounted). -if [ ! -e "/user.passwd" ]; then - touch "/user.passwd" +if [ ! -e "/tmp/user.passwd" ]; then + touch "/tmp/user.passwd" # Only generate a password hash if both username and password given. if [ "x$USERNAME" != "x" ] && [ "x$PASSWORD" != "x" ]; then if [ "$AUTH_TYPE" = "Digest" ]; then # Can't run `htdigest` non-interactively, so use other tools. HASH="`printf '%s' "$USERNAME:$REALM:$PASSWORD" | md5sum | awk '{print $1}'`" - printf '%s\n' "$USERNAME:$REALM:$HASH" > /user.passwd + printf '%s\n' "$USERNAME:$REALM:$HASH" > /tmp/user.passwd else - htpasswd -B -b -c "/user.passwd" $USERNAME $PASSWORD + htpasswd -B -b -c "/tmp/user.passwd" $USERNAME $PASSWORD fi fi fi -- cgit v1.2.1