Create user "bitmessage" to setup and run bitmessaged

This commit is contained in:
Dmitri Bogomolov 2019-02-06 17:19:09 +02:00
parent 84300afaf1
commit 2d702e9647
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -29,14 +29,19 @@ RUN python2 setup.py sdist \
&& py2dsc-deb dist/pybitmessage-${VER}.tar.gz \
&& dpkg -i deb_dist/python-pybitmessage_${VER}-1_amd64.deb
# Create a user
RUN useradd bitmessage && chown -R bitmessage ${HOME}
USER bitmessage
# Generate default config
RUN src/bitmessagemain.py -t && mv keys.dat ..
RUN src/bitmessagemain.py -t && mv keys.dat /tmp
# Clean HOME
RUN rm -rf ${HOME}
RUN rm -rf ${HOME}/*
# Setup environment
RUN mv ../keys.dat . \
RUN mv /tmp/keys.dat . \
&& APIPASS=$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo) \
&& echo "\napiusername: api\napipassword: $APIPASS" \
&& echo "apienabled = true\napiinterface = 0.0.0.0\napiusername = api\napipassword = $APIPASS" >> keys.dat