#3127 improve webui install

This commit is contained in:
rootzoll 2022-05-18 16:34:45 +02:00
parent 138131e68c
commit d58b3f4a9a
4 changed files with 38 additions and 2 deletions

View File

@ -777,10 +777,11 @@ if ${fatpack}; then
sudo chown admin:admin /home/admin/fallback.nodes
echo "* Adding Raspiblitz API ..."
sudo /home/admin/config.scripts/blitz.web.api.sh on
sudo /home/admin/config.scripts/blitz.web.api.sh on || exit 1
echo "* Adding Raspiblitz WebUI ..."
sudo /home/admin/config.scripts/blitz.web.ui.sh on
sudo /home/admin/config.scripts/blitz.web.ui.sh on || exit 1
# set build code as new default
sudo rm -r /home/admin/assets/nginx/www_public
sudo cp -a /root/blitz_web/build/* /home/admin/assets/nginx/www_public

View File

@ -49,9 +49,21 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
cd /root
# git clone https://github.com/fusion44/blitz_api.git /root/blitz_api
git clone https://github.com/${DEFAULT_GITHUB_USER}/${DEFAULT_GITHUB_REPO}.git /root/blitz_api
if [ "$?" != "0"]; then
echo "error='git clone failed'"
exit 1
fi
cd blitz_api
git checkout ${DEFAULT_GITHUB_BRANCH}
if [ "$?" != "0"]; then
echo "error='git checkout failed'"
exit 1
fi
pip install -r requirements.txt
if [ "$?" != "0"]; then
echo "error='pip install failed'"
exit 1
fi
chown -R admin:admin /root/blitz_api
chmod a+x /root
chmod -R a+x /root/blitz_api

View File

@ -140,6 +140,9 @@ elif [ "$1" = "https-on" ]; then
echo "# exists /mnt/hdd/app-data/nginx/tls.cert"
fi
# make sure nginx process has permissions
sudo chmod 744 /mnt/hdd/lnd/tls.key
# restart NGINX
sudo systemctl restart nginx

View File

@ -43,16 +43,36 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
cd /root
# git clone https://github.com/cstenglein/raspiblitz-web.git /home/admin/blitz_web
git clone https://github.com/${DEFAULT_GITHUB_USER}/${DEFAULT_GITHUB_REPO}.git /root/blitz_web
if [ "$?" != "0"]; then
echo "error='git clone failed'"
exit 1
fi
cd blitz_web
git checkout ${DEFAULT_GITHUB_BRANCH}
if [ "$?" != "0"]; then
echo "error='git checkout failed'"
exit 1
fi
echo "# Compile WebUI"
/home/admin/config.scripts/bonus.nodejs.sh on
source <(/home/admin/config.scripts/bonus.nodejs.sh info)
npm install --global yarn
if [ "$?" != "0"]; then
echo "error='install yarn failed'"
exit 1
fi
${NODEPATH}/yarn config set --home enableTelemetry 0
${NODEPATH}/yarn install
if [ "$?" != "0"]; then
echo "error='yarn install failed'"
exit 1
fi
${NODEPATH}/yarn build
if [ "$?" != "0"]; then
echo "error='yarn build failed'"
exit 1
fi
rm -r /var/www/public/* 2>/dev/null
cp -r /root/blitz_web/build/* /var/www/public