From 2092949655753ef1b93fbc9ce20e4836db5164f7 Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Sat, 27 Apr 2019 17:22:12 -0400 Subject: [PATCH] Updates lbrycrd config file in testnet and regtest modes. --- lbrycrd/Dockerfile-linux-x86_64-production | 2 ++ lbrycrd/stuff/start.sh | 41 +++++++++++----------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lbrycrd/Dockerfile-linux-x86_64-production b/lbrycrd/Dockerfile-linux-x86_64-production index 2a745a1..851c6fe 100644 --- a/lbrycrd/Dockerfile-linux-x86_64-production +++ b/lbrycrd/Dockerfile-linux-x86_64-production @@ -20,6 +20,8 @@ FROM ubuntu:18.04 as app COPY --from=prep /lbrycrdd /lbrycrd-cli /lbrycrd-tx /start /healthcheck /fix-permissions /advance /usr/bin/ RUN addgroup --gid 1000 lbrycrd && \ adduser lbrycrd --uid 1000 --gid 1000 --gecos GECOS --shell /bin/bash --disabled-password --home /data && \ + mkdir /etc/lbry && \ + chown lbrycrd /etc/lbry && \ chmod a+s /usr/bin/fix-permissions VOLUME ["/data"] WORKDIR /data diff --git a/lbrycrd/stuff/start.sh b/lbrycrd/stuff/start.sh index 9d1852b..158b160 100755 --- a/lbrycrd/stuff/start.sh +++ b/lbrycrd/stuff/start.sh @@ -9,7 +9,6 @@ function set_config() { else echo "Creating a fresh config file from environment variables." ## Set config params - mkdir -p `dirname $CONFIG_PATH` echo "rpcuser=$RPC_USER" > $CONFIG_PATH echo "rpcpassword=$RPC_PASSWORD" >> $CONFIG_PATH echo "rpcallowip=$RPC_ALLOW_IP" >> $CONFIG_PATH @@ -48,35 +47,35 @@ case $RUN_MODE in ## Set config params ## TODO: Make this more automagic in the future. mkdir -p `dirname $CONFIG_PATH` - echo "rpcuser=lbry" > /data/.lbrycrd/lbrycrd.conf - echo "rpcpassword=lbry" >> /data/.lbrycrd/lbrycrd.conf - echo "rpcport=11337" >> /data/.lbrycrd/lbrycrd.conf - echo "rpcbind=0.0.0.0" >> /data/.lbrycrd/lbrycrd.conf - echo "rpcallowip=0.0.0.0/0" >> /data/.lbrycrd/lbrycrd.conf - echo "regtest=1" >> /data/.lbrycrd/lbrycrd.conf - echo "txindex=1" >> /data/.lbrycrd/lbrycrd.conf - echo "server=1" >> /data/.lbrycrd/lbrycrd.conf - echo "printtoconsole=1" >> /data/.lbrycrd/lbrycrd.conf + echo "rpcuser=lbry" > $CONFIG_PATH + echo "rpcpassword=lbry" >> $CONFIG_PATH + echo "rpcport=11337" >> $CONFIG_PATH + echo "rpcbind=0.0.0.0" >> $CONFIG_PATH + echo "rpcallowip=0.0.0.0/0" >> $CONFIG_PATH + echo "regtest=1" >> $CONFIG_PATH + echo "txindex=1" >> $CONFIG_PATH + echo "server=1" >> $CONFIG_PATH + echo "printtoconsole=1" >> $CONFIG_PATH #nohup advance &>/dev/null & - lbrycrdd -conf=/data/.lbrycrd/lbrycrd.conf $1 + lbrycrdd -conf=$CONFIG_PATH $1 ;; testnet ) ## Set config params ## TODO: Make this more automagic in the future. mkdir -p `dirname $CONFIG_PATH` - echo "rpcuser=lbry" > /data/.lbrycrd/lbrycrd.conf - echo "rpcpassword=lbry" >> /data/.lbrycrd/lbrycrd.conf - echo "rpcport=11337" >> /data/.lbrycrd/lbrycrd.conf - echo "rpcbind=0.0.0.0" >> /data/.lbrycrd/lbrycrd.conf - echo "rpcallowip=0.0.0.0/0" >> /data/.lbrycrd/lbrycrd.conf - echo "testnet=1" >> /data/.lbrycrd/lbrycrd.conf - echo "txindex=1" >> /data/.lbrycrd/lbrycrd.conf - echo "server=1" >> /data/.lbrycrd/lbrycrd.conf - echo "printtoconsole=1" >> /data/.lbrycrd/lbrycrd.conf + echo "rpcuser=lbry" > $CONFIG_PATH + echo "rpcpassword=lbry" >> $CONFIG_PATH + echo "rpcport=11337" >> $CONFIG_PATH + echo "rpcbind=0.0.0.0" >> $CONFIG_PATH + echo "rpcallowip=0.0.0.0/0" >> $CONFIG_PATH + echo "testnet=1" >> $CONFIG_PATH + echo "txindex=1" >> $CONFIG_PATH + echo "server=1" >> $CONFIG_PATH + echo "printtoconsole=1" >> $CONFIG_PATH #nohup advance &>/dev/null & - lbrycrdd -conf=/data/.lbrycrd/lbrycrd.conf $1 + lbrycrdd -conf=$CONFIG_PATH $1 ;; * ) echo "Error, you must define a RUN_MODE environment variable."