From 8a9899c9df608c86d78d1705ccd749e702f6d9bb Mon Sep 17 00:00:00 2001 From: "lee.miller" Date: Wed, 23 Mar 2022 18:24:29 +0200 Subject: [PATCH] Setup json API --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f97a3082..89ab8cf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ WORKDIR ${HOME} ADD . ${HOME} # Install -RUN pip2 install . +RUN pip2 install jsonrpclib . # Cleanup RUN rm -rf /var/lib/apt/lists/* @@ -35,6 +35,9 @@ RUN pybitmessage -t # Setup environment RUN 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 + && 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"]