mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-03-01 00:59:23 +01:00
LNbits update to v0.12.4 (#4491)
* lnbits install script formatting * lnbits update to 0.12.4
This commit is contained in:
parent
45dbdb3b82
commit
4932495daa
3 changed files with 164 additions and 152 deletions
|
@ -20,6 +20,11 @@ server {
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:5000;
|
proxy_pass http://127.0.0.1:5000;
|
||||||
|
|
||||||
|
# needed for websocket connections
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,11 @@ server {
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://127.0.0.1:5001;
|
proxy_pass https://127.0.0.1:5001;
|
||||||
|
|
||||||
|
# needed for websocket connections
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# https://github.com/lnbits/lnbits
|
# https://github.com/lnbits/lnbits
|
||||||
|
|
||||||
# https://github.com/lnbits/lnbits/releases
|
# https://github.com/lnbits/lnbits/releases
|
||||||
tag="0.11.3"
|
tag="0.12.4"
|
||||||
VERSION="${tag}"
|
VERSION="${tag}"
|
||||||
|
|
||||||
# command info
|
# command info
|
||||||
|
@ -303,7 +303,7 @@ Consider adding a IP2TOR Bridge under OPTIONS."
|
||||||
|
|
||||||
counter=0
|
counter=0
|
||||||
cd $backup_target
|
cd $backup_target
|
||||||
for f in `find *.* -maxdepth 1 -type f`; do
|
for f in $(find *.* -maxdepth 1 -type f); do
|
||||||
[[ -f "$f" ]] || continue
|
[[ -f "$f" ]] || continue
|
||||||
counter=$(($counter + 1))
|
counter=$(($counter + 1))
|
||||||
OPTIONS_RESTORE+=($counter "$f")
|
OPTIONS_RESTORE+=($counter "$f")
|
||||||
|
@ -358,6 +358,7 @@ This can fail for unknown circumstances. Revert of this process is possible afte
|
||||||
*)
|
*)
|
||||||
clear
|
clear
|
||||||
exit 0
|
exit 0
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -381,7 +382,7 @@ if [ "$1" = "status" ]; then
|
||||||
|
|
||||||
# auth method is to call with a certain useer id
|
# auth method is to call with a certain useer id
|
||||||
#admin_userid=$(sudo cat /home/lnbits/lnbits/.super_user)
|
#admin_userid=$(sudo cat /home/lnbits/lnbits/.super_user)
|
||||||
admin_userid=$(sudo cat /mnt/hdd/app-data/LNBits/data/.super_user);
|
admin_userid=$(sudo cat /mnt/hdd/app-data/LNBits/data/.super_user)
|
||||||
echo "authMethod='/wallet?usr=${admin_userid}'"
|
echo "authMethod='/wallet?usr=${admin_userid}'"
|
||||||
|
|
||||||
# check funding source
|
# check funding source
|
||||||
|
@ -587,21 +588,22 @@ if [ "$1" = "sync" ] || [ "$1" = "repo" ]; then
|
||||||
# pull latest code
|
# pull latest code
|
||||||
sudo -u lnbits git pull
|
sudo -u lnbits git pull
|
||||||
|
|
||||||
# check if poetry in installed, if not install it
|
echo "# check if poetry in installed, if not install it"
|
||||||
if ! sudo -u lnbits which poetry; then
|
if ! sudo -u lnbits which poetry; then
|
||||||
echo "# install poetry"
|
echo "# install poetry"
|
||||||
sudo pip3 install --upgrade pip
|
sudo pip3 install --upgrade pip
|
||||||
sudo pip3 install poetry
|
sudo pip3 install poetry
|
||||||
fi
|
fi
|
||||||
# do install like this
|
|
||||||
|
echo "# install"
|
||||||
sudo -u lnbits poetry install
|
sudo -u lnbits poetry install
|
||||||
|
|
||||||
# make sure default virtaulenv is used
|
echo "# make sure the default virtualenv is used"
|
||||||
sudo apt-get remove -y python3-virtualenv 2>/dev/null
|
sudo apt-get remove -y python3-virtualenv 2>/dev/null
|
||||||
sudo pip uninstall -y virtualenv 2>/dev/null
|
sudo pip uninstall -y virtualenv 2>/dev/null
|
||||||
sudo apt-get install -y python3-virtualenv
|
sudo apt-get install -y python3-virtualenv
|
||||||
|
|
||||||
# restart lnbits service
|
echo "# restart lnbits service"
|
||||||
sudo systemctl restart lnbits
|
sudo systemctl restart lnbits
|
||||||
echo "# server is restarting ... maybe takes some seconds until available"
|
echo "# server is restarting ... maybe takes some seconds until available"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -619,12 +621,6 @@ if [ "$1" = "install" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# *** INSTALL LNBITS ${VERSION} ***"
|
|
||||||
|
|
||||||
# add lnbits user
|
|
||||||
echo "*** Add the 'lnbits' user ***"
|
|
||||||
sudo adduser --system --group --home /home/lnbits lnbits
|
|
||||||
|
|
||||||
# get optional github parameter
|
# get optional github parameter
|
||||||
githubUser="lnbits"
|
githubUser="lnbits"
|
||||||
if [ "$2" != "" ]; then
|
if [ "$2" != "" ]; then
|
||||||
|
@ -634,6 +630,13 @@ if [ "$1" = "install" ]; then
|
||||||
tag="$3"
|
tag="$3"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "# *** INSTALL LNBITS ***"
|
||||||
|
echo "# githubUser=$githubUser tag=$tag"
|
||||||
|
|
||||||
|
# add lnbits user
|
||||||
|
echo "*** Add the 'lnbits' user ***"
|
||||||
|
sudo adduser --system --group --home /home/lnbits lnbits
|
||||||
|
|
||||||
# install from GitHub
|
# install from GitHub
|
||||||
echo "# get the github code user(${githubUser}) branch(${tag})"
|
echo "# get the github code user(${githubUser}) branch(${tag})"
|
||||||
sudo rm -r /home/lnbits/lnbits 2>/dev/null
|
sudo rm -r /home/lnbits/lnbits 2>/dev/null
|
||||||
|
@ -652,7 +655,8 @@ if [ "$1" = "install" ]; then
|
||||||
sudo pip3 install --upgrade pip
|
sudo pip3 install --upgrade pip
|
||||||
sudo pip3 install poetry
|
sudo pip3 install poetry
|
||||||
fi
|
fi
|
||||||
# do install like this
|
|
||||||
|
echo "# install"
|
||||||
sudo -u lnbits poetry install
|
sudo -u lnbits poetry install
|
||||||
|
|
||||||
# make sure default virtaulenv is used
|
# make sure default virtaulenv is used
|
||||||
|
@ -681,7 +685,6 @@ if [ "$1" = "uninstall" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# on
|
# on
|
||||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
|
|
||||||
|
@ -1069,7 +1072,7 @@ if [ "$1" = "backup" ]; then
|
||||||
else
|
else
|
||||||
# sqlite backup
|
# sqlite backup
|
||||||
backup_target="/mnt/hdd/app-data/backup/lnbits_sqlite"
|
backup_target="/mnt/hdd/app-data/backup/lnbits_sqlite"
|
||||||
backup_file="lnbits_sqlite_`date +%d`-`date +%m`-`date +%Y`_`date +%H`-`date +%M`_fs.tar"
|
backup_file="lnbits_sqlite_$(date +%d)-$(date +%m)-$(date +%Y)_$(date +%H)-$(date +%M)_fs.tar"
|
||||||
if [ ! -d $backup_target ]; then
|
if [ ! -d $backup_target ]; then
|
||||||
sudo mkdir -p $backup_target 1>&2
|
sudo mkdir -p $backup_target 1>&2
|
||||||
fi
|
fi
|
||||||
|
@ -1191,9 +1194,8 @@ if [ "$1" = "migrate" ]; then
|
||||||
# execStartPre is not enough, wait for lnbits is finally running
|
# execStartPre is not enough, wait for lnbits is finally running
|
||||||
count=0
|
count=0
|
||||||
count_max=30
|
count_max=30
|
||||||
while ! nc -zv 127.0.0.1 5000 2>/dev/null;
|
while ! nc -zv 127.0.0.1 5000 2>/dev/null; do
|
||||||
do
|
count=$(expr $count + 1)
|
||||||
count=`expr $count + 1`
|
|
||||||
echo "wait for LNBIts to start (${count}s/${count_max}s)"
|
echo "wait for LNBIts to start (${count}s/${count_max}s)"
|
||||||
sleep 1
|
sleep 1
|
||||||
if [ $count = $count_max ]; then
|
if [ $count = $count_max ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue