From fa72e88b9e2a797f37bb7c54ab101e4c5c6f75c2 Mon Sep 17 00:00:00 2001 From: Gareth Dunstone Date: Fri, 6 Mar 2020 13:06:42 +1000 Subject: [PATCH 1/3] added DROPPY_ADMIN_USER DROPPY_ADMIN_PASSWORD environment variables to docker-start.sh --- docker-start.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-start.sh b/docker-start.sh index 2901fc314..446612562 100755 --- a/docker-start.sh +++ b/docker-start.sh @@ -16,4 +16,9 @@ mkdir -p /files chown -R droppy:droppy /config chown droppy:droppy /files + +if [[ -n "$DROPPY_ADMIN_USER" && -n "$DROPPY_ADMIN_PASSWORD" ]]; then + droppy add "$DROPPY_ADMIN_USER" "$DROPPY_ADMIN_PASSWORD" true +fi + exec /bin/su -p -s "/bin/sh" -c "exec /usr/bin/droppy start --color -f /files -c /config" droppy From 3844a89f111aeea338d474fc228c0b6c5bdf434c Mon Sep 17 00:00:00 2001 From: Gareth Dunstone Date: Fri, 6 Mar 2020 13:15:48 +1000 Subject: [PATCH 2/3] updated readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5e2d7d7c9..5fbad4a25 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ $ docker run --name droppy -p 127.0.0.1:8989:8989 silverwind/droppy This method uses automatic volumes for `/config` and `/files` which can be overridden through `-v /srv/droppy/config:/config` and `-v /srv/droppy/files:/files`. If you're using existing files, it's advisable to use `-e UID=1000 -e GID=1000` to get new files written with correct ownership. +You can also set the default privileged username and password using `-e DROPPY_ADMIN_USER=admin -e DROPPY_ADMIN_PASSWORD=[your admin password]`. + To update a docker installation, run ```sh From 75af8b9b54c41867fa0851d356cd3b6e141b50c4 Mon Sep 17 00:00:00 2001 From: Gareth Dunstone Date: Fri, 6 Mar 2020 13:44:52 +1000 Subject: [PATCH 3/3] fixing issue when providing UID and GID, where db isnt owned by droppy --- docker-start.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-start.sh b/docker-start.sh index 446612562..854940126 100755 --- a/docker-start.sh +++ b/docker-start.sh @@ -13,12 +13,12 @@ echo -e "droppy:x:${GID}:droppy\n" >> /etc/group mkdir -p /config mkdir -p /files -chown -R droppy:droppy /config -chown droppy:droppy /files - - if [[ -n "$DROPPY_ADMIN_USER" && -n "$DROPPY_ADMIN_PASSWORD" ]]; then droppy add "$DROPPY_ADMIN_USER" "$DROPPY_ADMIN_PASSWORD" true fi +chown -R droppy:droppy /config +chown droppy:droppy /files + + exec /bin/su -p -s "/bin/sh" -c "exec /usr/bin/droppy start --color -f /files -c /config" droppy