deterministic address fix
All checks were successful
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 2m1s
All checks were successful
Build docker image and push to registry.bitdeals.org / main-build-job (push) Successful in 2m1s
This commit is contained in:
@@ -1,26 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
export BITMESSAGE_API_USER=${BITMESSAGE_API_USER:-bitmessage_api_user}
|
||||
export BITMESSAGE_API_PASSWORD=${BITMESSAGE_API_PASSWORD:-bitmessage_api_password}
|
||||
export BITMESSAGE_SEED_ADDRESSES=${BITMESSAGE_SEED_ADDRESSES:-1}
|
||||
export BITMESSAGE_API_PORT=${BITMESSAGE_API_PORT:-8442}
|
||||
export BITMESSAGE_TTL=${BITMESSAGE_TTL:-172800}
|
||||
export BITMESSAGE_STOPRESENDINGAFTERXDAYS=${BITMESSAGE_STOPRESENDINGAFTERXDAYS:-30}
|
||||
export BITMESSAGE_APIVARIANT=${BITMESSAGE_APIVARIANT:-legacy}
|
||||
export BITMESSAGE_API_USER="${BITMESSAGE_API_USER:-bitmessage_api_user}"
|
||||
export BITMESSAGE_API_PASSWORD="${BITMESSAGE_API_PASSWORD:-bitmessage_api_password}"
|
||||
export BITMESSAGE_SEED_ADDRESSES="${BITMESSAGE_SEED_ADDRESSES:-0}"
|
||||
export BITMESSAGE_API_PORT="${BITMESSAGE_API_PORT:-8442}"
|
||||
export BITMESSAGE_TTL="${BITMESSAGE_TTL:-172800}"
|
||||
export BITMESSAGE_STOPRESENDINGAFTERXDAYS="${BITMESSAGE_STOPRESENDINGAFTERXDAYS:-30}"
|
||||
export BITMESSAGE_APIVARIANT="${BITMESSAGE_APIVARIANT:-legacy}"
|
||||
|
||||
SEED_FILE="address_seed.txt"
|
||||
test -e "$SEED_FILE" || gosu bitmessage touch "$SEED_FILE"
|
||||
|
||||
# Save seed to file, or use saved seed
|
||||
if [ -n "$BITMESSAGE_SEED_PHRASE" ]
|
||||
if [ -z "$BITMESSAGE_SEED_PHRASE" ]
|
||||
then
|
||||
export BITMESSAGE_SEED_PHRASE
|
||||
grep -q "$BITMESSAGE_SEED_PHRASE" "$SEED_FILE" \
|
||||
|| echo "$BITMESSAGE_SEED_PHRASE" >> "$SEED_FILE"
|
||||
else
|
||||
OLD_SEED="$(tail -n1 $SEED_FILE)"
|
||||
NEW_SEED="$(cat /dev/random | tr -dc "a-z" | head -c32)"
|
||||
export BITMESSAGE_SEED_PHRASE="${OLD_SEED:-$NEW_SEED}"
|
||||
BITMESSAGE_SEED_PHRASE="$(cat /dev/random | tr -dc "a-z" | head -c32)"
|
||||
export BITMESSAGE_SEED_PHRASE
|
||||
fi
|
||||
|
||||
# this command must be run as root (for bind mounts to container)
|
||||
@@ -39,7 +30,7 @@ gosu bitmessage sed -i -e "s|\(apiinterface = \).*|\10\.0\.0\.0|g" \
|
||||
-e "s|\(udp = \).*|\1False|g" keys.dat
|
||||
|
||||
# generate address from seed
|
||||
for i in {1..4}
|
||||
test "$BITMESSAGE_SEED_ADDRESSES" -gt 0 && for i in {1..4}
|
||||
do
|
||||
sleep 15
|
||||
gosu bitmessage /usr/bin/python /usr/local/bin/seed_addr_gen.py
|
||||
|
||||
Reference in New Issue
Block a user