create admin user automatically
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fb2bf698ca
commit
d5e258ff01
|
@ -3,6 +3,8 @@ FROM ubuntu:bionic
|
|||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
ENV DEFAULT_ADMIN_PASSWORD hunter2
|
||||
|
||||
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu
|
||||
|
||||
RUN echo "deb $UBUNTU_MIRROR bionic main universe restricted multiverse" > /etc/apt/sources.list.new && \
|
||||
|
|
|
@ -23,6 +23,13 @@ on 20.04 but its build file doesn't work with modern `scons`, sadly.
|
|||
|
||||
# Docker Image Information
|
||||
|
||||
* env:
|
||||
* `DEFAULT_ADMIN_PASSWORD`: set to the admin password you want for the
|
||||
`admin` user. default: `hunter2`. Note that passwords are stored
|
||||
unhashed in plaintext on disk (take it up with the duck, I just
|
||||
packaged it)
|
||||
* no-op if `/config/users.txt` already exists, which it will after
|
||||
first run.
|
||||
* state/config volume: `/config`
|
||||
* logs to stdout like a good docker
|
||||
|
||||
|
|
|
@ -15,5 +15,9 @@ if [[ ! -d /config/certs ]]; then
|
|||
bash /usr/local/src/adchpp/linux/generate_certs.sh
|
||||
fi
|
||||
|
||||
if [[ ! -e /config/users.txt ]]; then
|
||||
echo "[{\"password\":\"$DEFAULT_ADMIN_PASSWORD\",\"nick\":\"admin\",\"level\":10,\"regby\":\"admin\",\"regtime\":1322835912}]" > /config/users.txt
|
||||
fi
|
||||
|
||||
cd /config
|
||||
exec /usr/local/bin/adchppd -c /config
|
||||
|
|
Loading…
Reference in New Issue