Upgrade LNBits to v0.2.0

This commit is contained in:
Taylor Helsper 2021-03-04 22:50:35 -06:00
parent 86cd1cc3e2
commit e64f412fa1
6 changed files with 42 additions and 44 deletions

View File

@ -8,6 +8,10 @@ server {
access_log /var/log/nginx/access_lnbits.log; access_log /var/log/nginx/access_lnbits.log;
error_log /var/log/nginx/error_lnbits.log; error_log /var/log/nginx/error_lnbits.log;
location /static {
root /opt/mynode/lnbits/lnbits;
}
location / { location / {
proxy_pass http://127.0.0.1:5000; proxy_pass http://127.0.0.1:5000;

View File

@ -10,18 +10,20 @@ After=bitcoind.service lnd.service
ExecStartPre=/usr/bin/is_not_shutting_down.sh ExecStartPre=/usr/bin/is_not_shutting_down.sh
ExecStartPre=/usr/bin/wait_on_lnd.sh ExecStartPre=/usr/bin/wait_on_lnd.sh
ExecStartPre=/usr/bin/mynode_pre_lnbits.sh ExecStartPre=/usr/bin/mynode_pre_lnbits.sh
ExecStartPre=/bin/sh -c 'cd /opt/mynode/lnbits && /usr/local/bin/pipenv run flask migrate' #ExecStartPre=/bin/sh -c 'cd /opt/mynode/lnbits && /usr/local/bin/pipenv run flask migrate'
Environment=FLASK_ENV=development
ExecStartPre=/bin/sh -c 'cd /opt/mynode/lnbits && ./lnbits_venv/bin/quart migrate'
#Environment=FLASK_ENV=development
WorkingDirectory=/opt/mynode/lnbits WorkingDirectory=/opt/mynode/lnbits
ExecStart=/bin/sh -c 'cd /opt/mynode/lnbits && /usr/local/bin/pipenv run flask run --host 0.0.0.0' ExecStart=/bin/sh -c 'cd /opt/mynode/lnbits && ./lnbits_venv/bin/hypercorn -k trio --bind 0.0.0.0:5000 "lnbits.app:create_app()"'
User=bitcoin User=bitcoin
Group=bitcoin Group=bitcoin
Type=simple Type=simple
TimeoutSec=240 TimeoutSec=120
Restart=always Restart=always
RestartSec=60 RestartSec=30
StandardOutput=syslog StandardOutput=syslog
StandardError=syslog StandardError=syslog
SyslogIdentifier=lnbits SyslogIdentifier=lnbits

View File

@ -26,6 +26,10 @@ fi
# Create any necessary users # Create any necessary users
useradd -m -s /bin/bash joinmarket || true useradd -m -s /bin/bash joinmarket || true
# Setup bitcoin user folders
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
# User updates and settings # User updates and settings
grep "joinmarket" /etc/sudoers || (echo 'joinmarket ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo) grep "joinmarket" /etc/sudoers || (echo 'joinmarket ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo)
@ -555,8 +559,6 @@ if [ "$CURRENT" != "$RTL_VERSION" ]; then
cd RTL cd RTL
sudo -u bitcoin NG_CLI_ANALYTICS=false npm install --only=production sudo -u bitcoin NG_CLI_ANALYTICS=false npm install --only=production
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $RTL_VERSION > $RTL_VERSION_FILE echo $RTL_VERSION > $RTL_VERSION_FILE
else else
echo "ERROR UPGRADING RTL - GPG FAILED" echo "ERROR UPGRADING RTL - GPG FAILED"
@ -579,8 +581,6 @@ if [ "$CURRENT" != "$BTCRPCEXPLORER_VERSION" ]; then
cd btc-rpc-explorer cd btc-rpc-explorer
sudo -u bitcoin npm install --only=production sudo -u bitcoin npm install --only=production
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_VERSION_FILE echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_VERSION_FILE
fi fi
@ -605,15 +605,12 @@ if [ "$CURRENT" != "$LNBITS_VERSION" ]; then
cp /usr/share/mynode/lnbits.env /opt/mynode/lnbits/.env cp /usr/share/mynode/lnbits.env /opt/mynode/lnbits/.env
chown bitcoin:bitcoin /opt/mynode/lnbits/.env chown bitcoin:bitcoin /opt/mynode/lnbits/.env
# Install with python 3.7 (Only use "pipenv install --python 3.7" once or it will rebuild the venv!) # Install lnbits
sudo -u bitcoin pipenv --python 3.7 install sudo -u bitcoin python3 -m venv lnbits_venv
sudo -u bitcoin pipenv run pip install python-dotenv sudo -u bitcoin ./lnbits_venv/bin/pip install -r requirements.txt
sudo -u bitcoin pipenv run pip install -r requirements.txt sudo -u bitcoin ./lnbits_venv/bin/quart assets
#sudo -u bitcoin pipenv run pip install lnd-grpc # Using REST now (this install takes a LONG time) sudo -u bitcoin ./lnbits_venv/bin/quart migrate
sudo -u bitcoin pipenv run flask migrate || true
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNBITS_VERSION > $LNBITS_VERSION_FILE echo $LNBITS_VERSION > $LNBITS_VERSION_FILE
fi fi
@ -690,8 +687,6 @@ if [ "$CURRENT" != "$LNDCONNECT_VERSION" ]; then
mv lndconnect-* lndconnect mv lndconnect-* lndconnect
install -m 0755 -o root -g root -t /usr/local/bin lndconnect/* install -m 0755 -o root -g root -t /usr/local/bin lndconnect/*
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNDCONNECT_VERSION > $LNDCONNECT_VERSION_FILE echo $LNDCONNECT_VERSION > $LNDCONNECT_VERSION_FILE
fi fi

View File

@ -1,11 +1,17 @@
FLASK_APP=lnbits QUART_APP=lnbits.app:create_app()
FLASK_ENV=production QUART_ENV=development
QUART_DEBUG=true
HOST=0.0.0.0
PORT=5000
QUART_APP=lnbits.app:create_app()
LNBITS_SITE_TITLE=LNbits LNBITS_SITE_TITLE=LNbits
LNBITS_ALLOWED_USERS="all" LNBITS_ALLOWED_USERS=""
LNBITS_DEFAULT_WALLET_NAME="LNbits wallet" LNBITS_DEFAULT_WALLET_NAME="LNbits wallet"
LNBITS_DATA_FOLDER="/mnt/hdd/mynode/lnbits" LNBITS_DATA_FOLDER="/mnt/hdd/mynode/lnbits"
LNBITS_DISABLED_EXTENSIONS="amilk,events" LNBITS_DISABLED_EXTENSIONS="amilk"
LNBITS_FORCE_HTTPS=0 LNBITS_FORCE_HTTPS=0
LNBITS_SERVICE_FEE="0.0" LNBITS_SERVICE_FEE="0.0"

View File

@ -60,7 +60,7 @@ BTCRPCEXPLORER_VERSION="v2.2.0"
BTCRPCEXPLORER_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version BTCRPCEXPLORER_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version
BTCRPCEXPLORER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version_latest BTCRPCEXPLORER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/btcrpcexplorer_version_latest
LNBITS_VERSION=dd2a282158d5774c2a3c85c164a10709c13ef7b4 # Github hash to download LNBITS_VERSION=503c981bc970f4ab894f50198dbd6833cae8f6e0 # Github hash to download
LNBITS_VERSION_FILE=/home/bitcoin/.mynode/lnbits_version LNBITS_VERSION_FILE=/home/bitcoin/.mynode/lnbits_version
LNBITS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lnbits_version_latest LNBITS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lnbits_version_latest

View File

@ -102,6 +102,10 @@ source /tmp/mynode_app_versions.sh
# Create any necessary users # Create any necessary users
useradd -m -s /bin/bash joinmarket || true useradd -m -s /bin/bash joinmarket || true
# Setup bitcoin user folders
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
# Update sources # Update sources
apt-get -y update apt-get -y update
@ -310,8 +314,6 @@ if [ "$CURRENT" != "$BTC_VERSION" ]; then
sudo -u bitcoin ln -s /mnt/hdd/mynode/lnd /home/bitcoin/.lnd sudo -u bitcoin ln -s /mnt/hdd/mynode/lnd /home/bitcoin/.lnd
fi fi
mkdir -p /home/admin/.bitcoin mkdir -p /home/admin/.bitcoin
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $BTC_VERSION > $BTC_VERSION_FILE echo $BTC_VERSION > $BTC_VERSION_FILE
fi fi
cd ~ cd ~
@ -342,8 +344,6 @@ if [ "$CURRENT" != "$LND_VERSION" ]; then
install -m 0755 -o root -g root -t /usr/local/bin lnd/* install -m 0755 -o root -g root -t /usr/local/bin lnd/*
ln -s /bin/ip /usr/bin/ip || true ln -s /bin/ip /usr/bin/ip || true
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LND_VERSION > $LND_VERSION_FILE echo $LND_VERSION > $LND_VERSION_FILE
fi fi
cd ~ cd ~
@ -609,8 +609,6 @@ if [ "$CURRENT" != "$RTL_VERSION" ]; then
cd RTL cd RTL
sudo -u bitcoin NG_CLI_ANALYTICS=false npm install --only=production sudo -u bitcoin NG_CLI_ANALYTICS=false npm install --only=production
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $RTL_VERSION > $RTL_VERSION_FILE echo $RTL_VERSION > $RTL_VERSION_FILE
fi fi
@ -631,8 +629,6 @@ if [ "$CURRENT" != "$BTCRPCEXPLORER_VERSION" ]; then
cd btc-rpc-explorer cd btc-rpc-explorer
sudo -u bitcoin npm install --only=production sudo -u bitcoin npm install --only=production
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_VERSION_FILE echo $BTCRPCEXPLORER_VERSION > $BTCRPCEXPLORER_VERSION_FILE
fi fi
@ -654,18 +650,15 @@ if [ "$CURRENT" != "$LNBITS_VERSION" ]; then
cd lnbits cd lnbits
# Copy over config file # Copy over config file
#cp /usr/share/mynode/lnbits.env /opt/mynode/lnbits/.env cp /usr/share/mynode/lnbits.env /opt/mynode/lnbits/.env
#chown bitcoin:bitcoin /opt/mynode/lnbits/.env chown bitcoin:bitcoin /opt/mynode/lnbits/.env
# Install with python 3.7 (Only use "pipenv install --python 3.7" once or it will rebuild the venv!) # Install lnbits
sudo -u bitcoin pipenv --python 3.7 install sudo -u bitcoin python3 -m venv lnbits_venv
sudo -u bitcoin pipenv run pip install python-dotenv sudo -u bitcoin ./lnbits_venv/bin/pip install -r requirements.txt
sudo -u bitcoin pipenv run pip install -r requirements.txt sudo -u bitcoin ./lnbits_venv/bin/quart assets
#sudo -u bitcoin pipenv run pip install lnd-grpc # Using REST now (this install takes a LONG time) sudo -u bitcoin ./lnbits_venv/bin/quart migrate
sudo -u bitcoin pipenv run flask migrate || true
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNBITS_VERSION > $LNBITS_VERSION_FILE echo $LNBITS_VERSION > $LNBITS_VERSION_FILE
fi fi
@ -742,8 +735,6 @@ if [ "$CURRENT" != "$LNDCONNECT_VERSION" ]; then
mv lndconnect-* lndconnect mv lndconnect-* lndconnect
install -m 0755 -o root -g root -t /usr/local/bin lndconnect/* install -m 0755 -o root -g root -t /usr/local/bin lndconnect/*
mkdir -p /home/bitcoin/.mynode/
chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
echo $LNDCONNECT_VERSION > $LNDCONNECT_VERSION_FILE echo $LNDCONNECT_VERSION > $LNDCONNECT_VERSION_FILE
fi fi