Docker improvements

- Modify onionr.sh to parse env and supply args to run-onionr-node.py
- Run onionr by default rather than bash
- Run as unprivileged user by default instead of root
- Use /app for all code
- Specify python 3.7 (3.8 fails to build cffi)
- Use apt-get rather than apt (apt's CLI is not stable)
- Slight reformatting and consolidation
This commit is contained in:
Duncan X Simpson 2020-12-14 23:20:27 -07:00 committed by Kevin Froman
parent 416e43e7bb
commit b1ef248ee9
2 changed files with 37 additions and 18 deletions

View file

@ -2,5 +2,22 @@
ORIG_ONIONR_RUN_DIR=`pwd`
export ORIG_ONIONR_RUN_DIR
cd "$(dirname "$0")"
cd src
./__init__.py "$@"
[[ -n "$USE_TOR" ]] || USE_TOR=1
[[ -n "$PORT" ]] || PORT=8080
[[ -n "$KEEP_LOG" ]] || KEEP_LOG=0
[[ -n "$STORE_PLAINTEXT" ]] || STORE_PLAINTEXT=1
PRIVKEY_OPT=""
[[ -f "privkey.key" ]] && PRIVKEY_OPT="--private-key privkey.key"
python run-onionr-node.py \
--open-ui 0 \
--onboarding 0 \
--bind-address 0.0.0.0 \
--port $PORT \
--use-tor $USE_TOR \
--keep-log-on-exit $KEEP_LOG \
--store-plaintext $STORE_PLAINTEXT \
$PRIVKEY_OPT \
"$@"