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 diff --git a/docker-start.sh b/docker-start.sh index 2901fc314..854940126 100755 --- a/docker-start.sh +++ b/docker-start.sh @@ -13,7 +13,12 @@ echo -e "droppy:x:${GID}:droppy\n" >> /etc/group mkdir -p /config mkdir -p /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