Setup json API

This commit is contained in:
Lee Miller 2022-03-23 18:24:29 +02:00 committed by Lee Miller
parent 3c3f6aa5c7
commit 8a9899c9df
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63

View File

@ -18,7 +18,7 @@ WORKDIR ${HOME}
ADD . ${HOME} ADD . ${HOME}
# Install # Install
RUN pip2 install . RUN pip2 install jsonrpclib .
# Cleanup # Cleanup
RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /var/lib/apt/lists/*
@ -35,6 +35,9 @@ RUN pybitmessage -t
# Setup environment # Setup environment
RUN APIPASS=$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo) \ RUN APIPASS=$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo) \
&& echo "\napiusername: api\napipassword: $APIPASS" \ && echo "\napiusername: api\napipassword: $APIPASS" \
&& echo "apienabled = true\napiinterface = 0.0.0.0\napiusername = api\napipassword = $APIPASS" >> keys.dat && sed -ie "s|\(apiinterface = \).*|\10\.0\.0\.0|g" keys.dat \
&& sed -ie "s|\(apivariant = \).*|\1json|g" keys.dat \
&& sed -ie "s|\(apiusername = \).*|\1api|g" keys.dat \
&& sed -ie "s|\(apipassword = \).*|\1$APIPASS|g" keys.dat
CMD ["pybitmessage", "-d"] CMD ["pybitmessage", "-d"]