fix web api/ui installs (#3567)

* add export build parameter

* Install WebAPI with build_sdcard.sh defaults

* change use of build_sdcard

* make webui work with DEFAULTS

* use web data

* update docs
This commit is contained in:
/rootzoll 2022-12-22 00:38:44 +01:00 committed by GitHub
parent 7c1d4c3b10
commit a382f2b803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 113 additions and 49 deletions

View File

@ -28,7 +28,8 @@ Work notes for the process of producing a new SD card image release:
* In terminal `ssh pi@[IP-OF-RASPIBLITZ]`
* Password is `raspberry`
* Run the following command BUT REPLACE `[BRANCH]` with the branch-string of your latest version
* `wget --no-cache https://raw.githubusercontent.com/rootzoll/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh -u rootzoll -b [BRANCH]`
* For FATPACK: `wget --no-cache https://raw.githubusercontent.com/rootzoll/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh -u rootzoll -b [BRANCH]`
* For MINIMAL: `wget --no-cache https://raw.githubusercontent.com/rootzoll/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh -u rootzoll -b [BRANCH] -f 0 -d headless`
* Monitor/Check outputs for warnings/errors - install LCD
* Login new with `ssh admin@[IP-OF-RASPIBLITZ]` (pw: raspiblitz) and run `release`
* Disconnect WiFi/LAN on build laptop (hardware switch off) and shutdown
@ -43,11 +44,17 @@ Work notes for the process of producing a new SD card image release:
* Take the SD card from the RaspberryPi and connect with an external SD card reader to the laptop
* Click on `boot` volume once in the file manger
* Connect the NTFS USB stick, open in file manager and delete old files
* if not: review changes in latest pishrink script
* To make a raw image from sd card - first way (terminal):
* Open Terminal and cd into directory of NTFS USB stick under `/media/amnesia`
* Run `df` to check on the SD card device name (`boot` - ignore last partition number)
* `dd if=/dev/[sdcarddevice] of=./raspiblitz.img`
* To make a raw image from sd card - second way (UI with progress):
* Search "Laufwerke" or "Drives" on Tails Apps
* Create image named `raspiblitz.img` to USB storage
* Open Terminal and cd into directory of NTFS USB stick under `/media/amnesia`
* `shasum -a 256 ./pishrink.sh` should be `e46e1e1e3c6e3555f9fff5435e2305e99b98aaa8dc28db1814cf861fbb472a69`
* if not: review changes in latest pishrink script
* Run `df` to check on the SD card device name (`boot` - ignore last partition number)
* `dd if=/dev/[sdcarddevice] of=./raspiblitz.img`
* `chmod +x ./pishrink.sh | sudo ./pishrink.sh ./raspiblitz.img`
* `gzip -c ./raspiblitz.img > ./raspiblitz-vX.X-YEAR-MONTH-DAY.img.gz`
* Then run `shasum -a 256 *.gz > sha256.txt`

View File

@ -253,36 +253,39 @@ In the end your RaspiBlitz should look like this:
## Downloading the Software
| Method | Install the image | Build the sd card |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Philosophy | Trust | Sovereignty |
| Difficulty level | Easy | Medium |
| Pros | Make Blitz accessible to everyone | You don't need to trust us, build from your own forked repository |
| Instructions | [Download 1.9.0rc1 image]() and [Flash the sd card](README.md#write-the-sd-card-image-to-your-sd-card) | [Build your own sd card image](#build-the-sd-card-image) |
| Verify what? | [Signature file]() and [verify the Sig](FAQ.md#how-to-verify-the-sd-card-image-after-download) OR SHA-256 (below) | All of the code, don't trust, verify |
You now have the hardware ready for your RaspiBlitz - whats missing is the software to run. This is normally done by downloading an image file and then writing it (flashing it) to the sd card. This is a bigger file (multiple GigaBytes) so make sure to have the available storage space on your laptop.
If downloading the maintainer SD card image:
- GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA
- SHA-256:
Which verification method should I used: Hash or Signature?
- Signed file prove to you that the SD card image was actually built by the lead developer of the RaspiBlitz project. (Safest)
- Hash function checks file integrity. (Secure)
<!---
The maintainer sd card image can also be downloaded via torrent:
- [assets/raspiblitz-v1.8.0-2022-07-28.img.gz.torrent](https://github.com/rootzoll/raspiblitz/raw/dev/home.admin/assets/raspiblitz-v1.8.0-2022-07-28.img.gz.torrent)
--->
If you are a very advanded user who is able to read/verify code or you like to run a self-modified/forked version of RaspiBlitz you can also build the sd card image yourself - see the [Build your own sd card image](#build-the-sd-card-image) section for this. Everybody else can choose from two ready-made sd card images below.
Useful info:
- [What's new in Version 1.9.0 of RaspiBlitz?](CHANGES.md#whats-new-in-version-190-of-raspiblitz)
- [How to update my RaspiBlitz?](README.md#updating-raspiblitz-to-new-version)
- [How to migrate to RaspiBlitz from Umbrel/myNode/Citadel](#make-a-raspiblitz-out-of-your-umbrel-citadel-or-mynode)
- [How to verify the SD card image after download?](FAQ.md#how-to-verify-the-sd-card-image-after-download)
### Download FATPACK Image (Beginners - WebUI)
This is the sd card image you should choose if your at the beginning of your RaspiBlitz journey or you are a casual node runner wanna download the next update - with WebUI & fast installing bonus apps. Its totally fine :)
- FATPACK SD CARD IMAGE: n/a <!--[raspiblitz-fat-v1.9.0rc1-2022-12-21.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.9.0rc1-2022-12-21.img.gz)-->
- SHA-256: n/a
- Signature-File: n/a <!--[raspiblitz-fat-v1.9.0rc1-2022-12-21.img.gz.sig](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.9.0rc1-2022-12-21.img.gz.sig)-->
- Torrent: n/a <!--[raspiblitz-fat-v1.9.0-2022-12-21.img.gz.torrent](https://github.com/rootzoll/raspiblitz/raw/dev/home.admin/assets/raspiblitz-fat-v1.9.0-2022-12-21.img.gz.torrent)-->
- GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA
[How to verify the SD card image after download?](FAQ.md#how-to-verify-the-sd-card-image-after-download)
### Download MINIMAL Image (Experienced Users - SSH)
This is the sd card image for RaspiBlitz users that are already more experienced and want to use just a limited set of features of the RaspiBlitz. This image has just the bare minimum of features pre-installed - LCD & HDMI output is off by default. Setup, Update or Recovery needs to be done thru SSH login - API & WebUI are later available but are not preinstalled/activated by default. The RaspiBlitz will download & compile just the tools that are in your ´raspiblitz.conf´ - this will take longer but as a tradeoff this RaspiBlitz then just runs with a reduced set of dependencies and so a minimalized attack vector and better performance. Its for the serious & experineced node runners.
- MINIMAL SD CARD IMAGE: n/a <!--[raspiblitz-min-v1.9.0rc1-2022-12-21.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-minimal-v1.9.0rc1-2022-12-21.img.gz)-->
- SHA-256: n/a
- Signature-File: n/a <!--[raspiblitz-min-v1.9.0rc1-2022-12-21.img.gz.sig](https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.9.0rc1-2022-12-21.img.gz.sig)-->
- Torrent: n/a <!--[raspiblitz-min-v1.9.0-2022-12-21.img.gz.torrent](https://github.com/rootzoll/raspiblitz/raw/dev/home.admin/assets/raspiblitz-min-v1.9.0-2022-12-21.img.gz.torrent)-->
- GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA
[How to verify the SD card image after download?](FAQ.md#how-to-verify-the-sd-card-image-after-download)
## Write the SD-Card image to your SD Card
@ -676,7 +679,7 @@ It will enable 4 touch buttons on the left hand side of the screen.
- Invoice - creates an Invoice-QR code that can be used for payments
- Off - Shutdown or Restart the RaspiBlitz
Please mind that the touchscreen is still experimental and with recent changes is missing certain UI fixes. This might take still until v1.8.1 release where the touchscreen is planned for a refactor/rewrite.
Please mind that the touchscreen is still experimental and with recent changes is missing certain UI fixes. This might take still until a later version where the touchscreen is planned for a refactor/rewrite.
##### LCD Rotate
@ -1280,10 +1283,6 @@ Another kind of migration is when you already run a full node with the Umbrel, C
You basically have all the hardware needed and just need to change software.
You don't need the [LCD from the shopping list](#amazon-shopping-list-buy-parts--build-it-yourself) - RaspiBlitz can also run without an LCD.
_NOTE: This migration is still experimental.
You will still use the terminal to setup & manage your RaspiBlitz.
If that is too technical for you please wait for the RaspiBlitz v1.8, which will introduce a WebUI for your browser that will make the migration to RaspiBlitz more familiar to your old node user experience._
Before you start migration:
- if you have on-chain funds on your old node - make sure to have the backup seed words
@ -1449,7 +1448,7 @@ But if you want to build that image yourself - here is a quick guide:
Now you are ready to start the SD card build script (check the code to see if the installation and config are OK for you).
Copy the following command into your terminal and execute:
`wget https://raw.githubusercontent.com/rootzoll/raspiblitz/v1.8/build_sdcard.sh && sudo bash build_sdcard.sh`
`wget https://raw.githubusercontent.com/rootzoll/raspiblitz/v1.9/build_sdcard.sh && sudo bash build_sdcard.sh`
As you can see from the URL, you can find the build script in this Git repo under `build_sdcard.sh`.

View File

@ -10,7 +10,7 @@
##########################################################################
defaultRepo="rootzoll"
defaultBranch="v1.8"
defaultBranch="v1.9"
defaultAPIuser="fusion44"
defaultAPIrepo="blitz_api"
@ -28,6 +28,7 @@ usage(){
printf %s"${me} [--option <argument>]
Options:
-EXPORT just print build parameters & exit'
-h, --help this help info
-i, --interaction [0|1] interaction before proceeding with exection (default: 1)
-f, --fatpack [0|1] fatpack mode (default: 1)
@ -47,6 +48,21 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
usage
fi
if [ "$1" = "-EXPORT" ] || [ "$1" = "EXPORT" ]; then
cd /home/admin/raspiblitz 2>/dev/null
activeBranch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ "${activeBranch}" == "" ]; then
activeBranch="${defaultBranch}"
fi
echo "githubUser='${defaultRepo}'"
echo "githubBranch='${activeBranch}'"
echo "defaultAPIuser='${defaultAPIuser}'"
echo "defaultAPIrepo='${defaultAPIrepo}'"
echo "defaultWEBUIuser='${defaultWEBUIuser}'"
echo "defaultWEBUIrepo='${defaultWEBUIrepo}'"
exit 0
fi
## default user message
error_msg(){ printf %s"${red}${me}: ${1}${nocolor}\n"; exit 1; }

View File

@ -906,6 +906,12 @@ if [ "${displayType}" != "" ]; then
/home/admin/config.scripts/blitz.conf.sh set displayType ${displayType}
fi
# correct blitzapi config value
blitzApiRunning=$(ls /etc/systemd/system/blitzapi.service 2>/dev/null | grep -c "blitzapi.service")
if [ "${blitzapi}" == "" ] && [ ${blitzApiRunning} -eq 1 ]; then
/home/admin/config.scripts/blitz.conf.sh set blitzapi "on"
fi
# make sure users have latest credentials (if lnd is on)
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
echo "running LND users credentials update" >> $logFile

View File

@ -360,8 +360,8 @@ blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
if [ "${blitzapi}" == "on" ] && [ $blitzApiInstalled -eq 0 ]; then
echo "Provisioning BlitzAPI - run config script" >> ${logFile}
/home/admin/_cache.sh set message "Setup BlitzAPI (takes time)"
/home/admin/config.scripts/blitz.web.api.sh on >> ${logFile} 2>&1
/home/admin/config.scripts/blitz.web.ui.sh on >> ${logFile} 2>&1
/home/admin/config.scripts/blitz.web.api.sh on DEFAULT >> ${logFile} 2>&1
/home/admin/config.scripts/blitz.web.ui.sh on DEFAULT >> ${logFile} 2>&1
else
echo "Provisioning BlitzAPI - keep default" >> ${logFile}
fi

View File

@ -1,3 +1,3 @@
# RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1')
codeVersion="1.9.0rc2"
codeVersion="1.9.0rc1"
# keep last line with comment

View File

@ -12,7 +12,8 @@ FALLACK_BRANCH="dev"
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then
echo "Manage RaspiBlitz Web API"
echo "blitz.web.api.sh on [?GITHUBUSER] [?REPO] [?BRANCH] [?COMMITORTAG]"
echo "blitz.web.api.sh on [GITHUBUSER] [REPO] [BRANCH] [?COMMITORTAG]"
echo "blitz.web.api.sh on DEFAULT"
echo "blitz.web.api.sh update-config"
echo "blitz.web.api.sh update-code [?BRANCH]"
echo "blitz.web.api.sh off"
@ -141,23 +142,40 @@ fi
###################
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# get parameters
GITHUB_USER=$2
if [ "$2" == "DEFAULT" ]; then
echo "# getting default user/repo from build_sdcard.sh"
sudo cp /home/admin/raspiblitz/build_sdcard.sh /home/admin/build_sdcard.sh
sudo chmod +x /home/admin/build_sdcard.sh 2>/dev/null
source <(sudo /home/admin/build_sdcard.sh -EXPORT)
GITHUB_USER="${defaultAPIuser}"
GITHUB_REPO="${defaultAPIrepo}"
GITHUB_BRANCH="${githubBranch}"
GITHUB_COMMITORTAG=""
else
# get parameters
GITHUB_USER=$2
GITHUB_REPO=$3
GITHUB_BRANCH=$4
GITHUB_COMMITORTAG=$5
fi
# check & output info
echo "# GITHUB_USER(${GITHUB_USER})"
if [ "${GITHUB_USER}" == "" ]; then
echo "# FAIL: No GITHUB_USER provided"
exit 1
fi
GITHUB_REPO=$3
echo "GITHUB_REPO(${GITHUB_REPO})"
if [ "${GITHUB_REPO}" == "" ]; then
echo "# FAIL: No GITHUB_REPO provided"
exit 1
fi
GITHUB_BRANCH=$4
echo "GITHUB_BRANCH(${GITHUB_BRANCH})"
if [ "${GITHUB_BRANCH}" == "" ]; then
echo "# FAIL: No GITHUB_BRANCH provided"
exit 1
fi
GITHUB_COMMITORTAG=$5
echo "GITHUB_COMMITORTAG(${GITHUB_COMMITORTAG})"
if [ "${GITHUB_COMMITORTAG}" == "" ]; then
echo "# INFO: No GITHUB_COMMITORTAG provided .. will use latest code on branch"
fi

View File

@ -9,7 +9,8 @@ FALLACK_BRANCH="master"
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then
echo "Manage RaspiBlitz WebUI"
echo "blitz.web.ui.sh on [?GITHUBUSER] [?REPO] [?BRANCH] [?COMMITORTAG]"
echo "blitz.web.ui.sh on [GITHUBUSER] [REPO] [BRANCH] [?COMMITORTAG]"
echo "blitz.web.ui.sh on DEFAULT"
echo "blitz.web.ui.sh update"
echo "blitz.web.ui.sh off"
exit 0
@ -26,23 +27,40 @@ fi
###################
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# get parameters
GITHUB_USER=$2
if [ "$2" == "DEFAULT" ]; then
echo "# getting default user/repo from build_sdcard.sh"
sudo cp /home/admin/raspiblitz/build_sdcard.sh /home/admin/build_sdcard.sh
sudo chmod +x /home/admin/build_sdcard.sh 2>/dev/null
source <(sudo /home/admin/build_sdcard.sh -EXPORT)
GITHUB_USER="${defaultWEBUIuser}"
GITHUB_REPO="${defaultWEBUIrepo}"
GITHUB_BRANCH="${githubBranch}"
GITHUB_COMMITORTAG=""
else
# get parameters
GITHUB_USER=$2
GITHUB_REPO=$3
GITHUB_BRANCH=$4
GITHUB_COMMITORTAG=$5
fi
# check & output info
echo "# GITHUB_USER(${GITHUB_USER})"
if [ "${GITHUB_USER}" == "" ]; then
echo "# FAIL: No GITHUB_USER provided"
exit 1
fi
GITHUB_REPO=$3
echo "GITHUB_REPO(${GITHUB_REPO})"
if [ "${GITHUB_REPO}" == "" ]; then
echo "# FAIL: No GITHUB_REPO provided"
exit 1
fi
GITHUB_BRANCH=$4
echo "GITHUB_BRANCH(${GITHUB_BRANCH})"
if [ "${GITHUB_BRANCH}" == "" ]; then
echo "# FAIL: No GITHUB_BRANCH provided"
exit 1
fi
GITHUB_COMMITORTAG=$5
echo "GITHUB_COMMITORTAG(${GITHUB_COMMITORTAG})"
if [ "${GITHUB_COMMITORTAG}" == "" ]; then
echo "# INFO: No GITHUB_COMMITORTAG provided .. will use latest code on branch"
fi