This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-16/packages/docker/launcher.sh
lee.miller 3b060d84b9
Make a separate script launcher.sh for the entry point, it allows
- passing args to the pybitmessage
  - setting API username and password through env
2022-04-20 21:34:38 +03:00

17 lines
489 B
Bash
Executable File

#!/bin/sh
# Setup the environment for docker container
APIUSER=${USER:-api}
APIPASS=${PASSWORD:-$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo)}
echo "\napiusername: $APIUSER\napipassword: $APIPASS"
sed -i -e "s|\(apiinterface = \).*|\10\.0\.0\.0|g" \
-e "s|\(apivariant = \).*|\1json|g" \
-e "s|\(apiusername = \).*|\1$APIUSER|g" \
-e "s|\(apipassword = \).*|\1$APIPASS|g" \
-e "s|apinotifypath = .*||g" ${BITMESSAGE_HOME}/keys.dat
# Run
exec pybitmessage "$@"