Compare commits

...

19 Commits

Author SHA1 Message Date
nicolas.dorier
ae039af062
bump 2021-10-01 15:56:06 +09:00
nicolas.dorier
70df9863db
Revert "bump"
This reverts commit 73fb019d8a.
2021-10-01 15:55:37 +09:00
nicolas.dorier
73fb019d8a
bump 2021-10-01 15:51:17 +09:00
nicolas.dorier
79da64788b
bump 2021-10-01 15:46:10 +09:00
nicolas.dorier
5c0aff8ddd
bump 2021-10-01 15:28:30 +09:00
nicolas.dorier
5909e260df
bump 2021-10-01 15:19:53 +09:00
nicolas.dorier
2105370d3f
bump 2021-10-01 14:56:47 +09:00
nicolas.dorier
0cf4191fd9
bump 2021-10-01 14:36:07 +09:00
nicolas.dorier
5239b79cad
bump 2021-10-01 14:32:36 +09:00
nicolas.dorier
b6db64afdf
Add ob-watcher 2021-10-01 14:22:36 +09:00
nicolas.dorier
8be6c53b76
bump 2021-10-01 14:21:34 +09:00
nicolas.dorier
741b2b8b54
bump 2021-10-01 14:14:13 +09:00
nicolas.dorier
5f308df53e
bump 2021-10-01 14:12:36 +09:00
nicolas.dorier
d4fc1305e6
bump 2021-10-01 14:03:43 +09:00
nicolas.dorier
b68f61adc3
bump 2021-10-01 13:52:51 +09:00
nicolas.dorier
e0d58a45b4
bump 2021-10-01 13:51:19 +09:00
nicolas.dorier
a47e8a6d73
bump 2021-10-01 13:40:37 +09:00
nicolas.dorier
af03ef9a8b
bump 2021-10-01 13:36:27 +09:00
nicolas.dorier
c4f5c56487
bump 2021-10-01 13:26:55 +09:00
12 changed files with 70 additions and 85 deletions

View File

@ -6,7 +6,10 @@ cd ..
cd scripts
# First we restore the default cfg as created by wallet-tool.py generate
cp "$DEFAULT_CONFIG" "$CONFIG"
if ! [ -f "$CONFIG" ]; then
cp "$DEFAULT_CONFIG" "$CONFIG"
fi
# For every env variable JM_FOO=BAR, replace the default configuration value of 'foo' by 'bar'
while IFS='=' read -r -d '' n v; do
n="${n,,}" # lowercase
@ -23,30 +26,4 @@ if [[ "${READY_FILE}" ]]; then
echo "The chain is fully synched"
fi
if ! [ -f "${ENV_FILE}" ]; then
echo "You need to initialize the wallet.
jm.sh wallet-tool-generate
jm.sh set-wallet <wallet_name> <Password>"
exec sleep infinity
fi
export $(cat "$ENV_FILE" | xargs)
: "${JM_YIELD_GENERATOR:=yield-generator-basic.py}"
echo "Using wallet ${WALLET_NAME} with $JM_YIELD_GENERATOR"
LOCKFILE="/root/.joinmarket/wallets/.${WALLET_NAME}.lock"
rm -f /root/.joinmarket/wallets/.${WALLET_NAME}.lock
while true; do
if [ -f "/tmp/stop" ]; then
echo "/tmp/stop is present, waiting it to get removed to start again..."
touch /tmp/stopped
elif [ -f "$LOCKFILE" ]; then
echo "$LOCKFILE is present, waiting it to get removed to start again..."
touch /tmp/stopped
else
rm -f /tmp/stopped
echo -n "${WALLET_PASS}" | python "${JM_YIELD_GENERATOR}" --wallet-password-stdin "${WALLET_NAME}" || true
touch /tmp/stopped
fi
sleep 10
done
exec supervisord

View File

@ -1,8 +1,33 @@
#!/bin/bash
set -e
cd ..
pushd . > /dev/null
cd /src
. jmvenv/bin/activate
cd scripts
popd > /dev/null
if [[ "$1" == "unlockwallet" ]]; then
shift 1
if ! [ -f "${ENV_FILE}" ]; then
echo "You need to initialize the wallet.
jm.sh wallet-tool-generate
jm.sh set-wallet <wallet_name> <Password>"
exit 1
fi
export $(cat "$ENV_FILE" | xargs)
if [[ "$1" == "nopass" ]]; then
shift 1
COMMAND="$1"
shift 1
$COMMAND "${WALLET_NAME}" "$@"
else
COMMAND="$1"
shift 1
echo -n "${WALLET_PASS}" | $COMMAND --wallet-password-stdin "${WALLET_NAME}" "$@"
fi
else
exec "$@"
fi
exec "$@"

View File

@ -1,8 +1,8 @@
FROM python:3.9.7-slim-bullseye
RUN apt-get update && \
apt-get install -qq --no-install-recommends curl tini sudo procps \
build-essential automake pkg-config libtool libgmp-dev libltdl-dev python3-dev virtualenv python3-pip && \
apt-get install -qq --no-install-recommends curl tini sudo procps vim supervisor \
build-essential automake pkg-config libtool libgmp-dev libltdl-dev python3-dev virtualenv python3-pip supervisor && \
rm -rf /var/lib/apt/lists/*
ENV JM_VERSION 0.9.1
@ -18,10 +18,13 @@ ENV CONFIG ${DATADIR}/joinmarket.cfg
ENV DEFAULT_CONFIG /root/default.cfg
ENV ENV_FILE "${DATADIR}/.env"
RUN . jmvenv/bin/activate && cd /src/scripts && \
pip install matplotlib && \
(python wallet-tool.py generate || true) \
&& cp "${CONFIG}" "${DEFAULT_CONFIG}"
WORKDIR /src/scripts
COPY docker-entrypoint.sh .
COPY *.sh ./
COPY supervisor-conf/*.conf /etc/supervisor/conf.d/
ENV PATH /src/scripts:$PATH
EXPOSE 62601
ENTRYPOINT [ "tini", "-g", "--", "./docker-entrypoint.sh" ]

View File

@ -1,13 +0,0 @@
#!/bin/bash
if ! [ -f "${ENV_FILE}" ]; then
echo "You need to initialize the wallet.
jm.sh wallet-tool generate
jm.sh set-wallet <wallet_name> <Password>"
exit 1
fi
stop.sh
export $(cat "$ENV_FILE" | xargs)
echo -n "${WALLET_PASS}" | python receive-payjoin.py --wallet-password-stdin "${WALLET_NAME}" "$@"
start.sh

View File

@ -1,14 +0,0 @@
#!/bin/bash
if ! [ -f "${ENV_FILE}" ]; then
echo "You need to initialize the wallet.
jm.sh wallet-tool generate
jm.sh set-wallet <wallet_name> <Password>"
exit 1
fi
export $(cat "$ENV_FILE" | xargs)
stop.sh
sendpayment.py "${WALLET_NAME}" "$@"
start.sh

View File

@ -1,3 +0,0 @@
#!/bin/bash
rm -f /tmp/stop

View File

@ -1,7 +0,0 @@
#!/bin/bash
touch /tmp/stop
pkill python
while ! [ -f "/tmp/stopped" ]; do
sleep 1
done

View File

@ -0,0 +1,10 @@
[program:ob-watcher]
directory=/src/scripts/obwatch
command=exec-wrapper.sh python ob-watcher.py --host 0.0.0.0
autostart=false
stdout_logfile=/root/.joinmarket/logs/obwatch_stdout.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
stderr_logfile=/root/.joinmarket/logs/obwatch_stderr.log
stderr_logfile_maxbytes=5MB
stderr_logfile_backups=0

View File

@ -0,0 +1,2 @@
[supervisord]
nodaemon=true

View File

@ -0,0 +1,10 @@
[program:yg-privacyenhanced]
directory=/src/scripts
command=exec-wrapper.sh unlockwallet yg-privacyenhanced.py
autostart=false
stdout_logfile=/root/.joinmarket/logs/yg-privacyenhanced_stdout.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
stderr_logfile=/root/.joinmarket/logs/yg-privacyenhanced_stderr.log
stderr_logfile_maxbytes=5MB
stderr_logfile_backups=0

View File

@ -0,0 +1,10 @@
[program:yield-generator-basic]
directory=/src/scripts
command=exec-wrapper.sh unlockwallet yield-generator-basic.py
autostart=false
stdout_logfile=/root/.joinmarket/logs/yield-generator-basic_stdout.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
stderr_logfile=/root/.joinmarket/logs/yield-generator-basic_stderr.log
stderr_logfile_maxbytes=5MB
stderr_logfile_backups=0

View File

@ -1,15 +0,0 @@
#!/bin/bash
set -e
cd ..
. jmvenv/bin/activate
cd scripts
if ! [ -f "${ENV_FILE}" ]; then
echo "You need to initialize the wallet.
jm.sh wallet-tool generate
jm.sh set-wallet <wallet_name> <Password>"
exit 1
fi
export $(cat "$ENV_FILE" | xargs)
echo -n "${WALLET_PASS}" | python wallet-tool.py --wallet-password-stdin "${WALLET_NAME}" "$@"