diff --git a/build_sdcard.sh b/build_sdcard.sh index 5b41001ff..b15c2d73f 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -292,7 +292,7 @@ if [ "${baseImage}" = "armbian" ]; then fi # dependencies for minimal images -sudo apt install -y python3-venv python3-dev python3-wheel +sudo apt install -y python3-venv python3-dev python3-wheel python3-jinja2 # rsync is needed to copy from HDD sudo apt install -y rsync @@ -592,9 +592,10 @@ echo "*** Python DEFAULT libs & depenedencies ***" sudo apt-get -y install dialog bc python3-dialog # libs (for global python scripts) -sudo pip3 install -I grpcio==1.29.0 -sudo pip3 install -I googleapis-common-protos==1.51.0 -sudo pip3 install -I toml==0.10.1 +sudo -H python3 -m pip install grpcio==1.29.0 +sudo -H python3 -m pip install googleapis-common-protos==1.51.0 +sudo -H python3 -m pip install toml==0.10.1 +sudo -H python3 -m pip install j2cli==0.3.10 echo "" echo "*** RASPIBLITZ EXTRAS ***" @@ -685,7 +686,7 @@ echo "*** HARDENING ***" # based on https://stadicus.github.io/RaspiBolt/raspibolt_21_security.html # fail2ban (no config required) -sudo apt-get install -y --no-install-recommends python3-systemd fail2ban +sudo apt-get install -y --no-install-recommends python3-systemd fail2ban if [ "${baseImage}" = "raspbian" ]; then echo "" diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index af2eb6481..8b83ef604 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -407,12 +407,14 @@ if [ "${EUID}" = "$(id -u pi)" ]; then EOF # use Jinja2 and apply json data to template to produce static html file - res=$(/usr/local/bin/j2 /var/www/blitzweb/info/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html) - if ! [ $? -eq 0 ]; then - echo "an error occured.. maybe JSON syntax is wrong..!" - echo "${res}" + templateExists=$(sudo ls /var/cache/raspiblitz/info.html 2>/dev/null | grep -c 'info.html') + if [ ${templateExists} -gt 0 ]; then + res=$(/usr/local/bin/j2 /var/www/blitzweb/info/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html) + if ! [ $? -eq 0 ]; then + echo "an error occured.. maybe JSON syntax is wrong..!" + echo "${res}" + fi fi + fi - - -# EOF +# EOF \ No newline at end of file diff --git a/home.admin/config.scripts/blitz.web.sh b/home.admin/config.scripts/blitz.web.sh index 2a06bc0e8..d15bc8a92 100755 --- a/home.admin/config.scripts/blitz.web.sh +++ b/home.admin/config.scripts/blitz.web.sh @@ -178,7 +178,6 @@ elif [ "$1" = "1" ] || [ "$1" = "on" ]; then sudo apt-get install python3-jinja2 >/dev/null sudo -H python3 -m pip install j2cli - # create nginx app-data dir and use LND cert by default sudo mkdir /mnt/hdd/app-data/nginx/ 2>/dev/null sudo ln -sf /mnt/hdd/lnd/tls.cert /mnt/hdd/app-data/nginx/tls.cert