in your browser to see the Web App.
While the `webapp` container does not require a reload while working on
it (hot-reload is enabled), you will have to restart your `jukebox`
diff --git a/documentation/developers/status.md b/documentation/developers/status.md
index 48c2b6c3b..0a40f8125 100644
--- a/documentation/developers/status.md
+++ b/documentation/developers/status.md
@@ -6,7 +6,7 @@ There are a few things that are specifically not integrated yet: playing streams
In the following is the currently implemented feature list in more detail. It also shows some of the shortcomings. However, the list is _not complete in terms of planned features_, but probably _reflects more of where work is currently being put into_.
-**For new contributors:** If you want to port a feature from version 2.X or implement a new feature, contact us. Open an issue or join us in the chat room. You may pick topics marked as open below, but also any other topic missing in the list below. As mentioned, that list is not complete in terms of open features. Check the [Contribution guide](https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/future3/main/CONTRIBUTING.md).
+**For new contributors:** If you want to port a feature from version 2.X or implement a new feature, contact us. Open an issue or join us in the chat room. You may pick topics marked as open below, but also any other topic missing in the list below. As mentioned, that list is not complete in terms of open features. Check the [Contribution guide](../../CONTRIBUTING.md).
Topics marked _in progress_ are already in the process of implementation by community members.
diff --git a/documentation/developers/webapp.md b/documentation/developers/webapp.md
new file mode 100644
index 000000000..2e8504337
--- /dev/null
+++ b/documentation/developers/webapp.md
@@ -0,0 +1,149 @@
+# Web App
+
+The Web App sources are located in `src/webapp`. A pre-build bundle of the Web App is deployed when installing from an official release branch. If you install from a feature branch or a fork repository, the Web App needs to be built locally. This requires Node to be installed and is part of the installation process.
+
+## Install node manually
+
+If you installed from an official release branch, Node might not be installed. To install Node for local development, follow the [official setup](https://deb.nodesource.com/).
+
+``` bash
+NODE_MAJOR=20
+sudo apt-get -y update && sudo apt-get -y install ca-certificates curl gnupg
+sudo mkdir -p /etc/apt/keyrings
+curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
+sudo apt-get -y update && sudo apt-get -y install nodejs
+```
+
+## Develop the Web App
+
+The Web App is a React application based on [Create React App](https://create-react-app.dev/). To start a development server, run the following command:
+
+```
+cd ~/RPi-Jukebox-RFID/src/webapp
+npm install # Just the first time or when dependencies change
+npm start
+```
+
+## Build the Web App
+
+To build your Web App after its source code has changed (e.g. through a local change or through a pull from the repository), it needs to be rebuilt manually.
+Use the provided script to rebuild whenever required. The artifacts can be found in the folder `build`.
+
+```bash
+cd ~/RPi-Jukebox-RFID/src/webapp; \
+./run_rebuild.sh -u
+```
+
+After a successfull build you might need to restart the web server.
+
+```
+sudo systemctl restart nginx.service
+```
+
+## Known Issues while building
+
+### JavaScript heap out of memory
+
+While (re-) building the Web App, you get the following output:
+
+``` {.bash emphasize-lines="12"}
+> webapp@0.1.0 build
+> react-scripts build
+
+Creating an optimized production build...
+
+[...]
+
+<--- JS stacktrace --->
+
+FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
+```
+
+#### Reason
+
+Not enough memory for Node
+
+#### Solution
+
+Use the [provided script](#build-the-web-app) to rebuild the Web App. It sets the needed node options and also checks and adjusts the swap size if there is not enough memory available.
+
+If you need to run the commands manually, make sure to have enough memory available (min. 512 MB). The following commands might help.
+
+Set the swapsize to 512 MB (and deactivate swapfactor). Adapt accordingly if you have a SD Card with small capacity.
+```bash
+sudo dphys-swapfile swapoff
+sudo sed -i "s|.*CONF_SWAPSIZE=.*|CONF_SWAPSIZE=512|g" /etc/dphys-swapfile
+sudo sed -i "s|^\s*CONF_SWAPFACTOR=|#CONF_SWAPFACTOR=|g" /etc/dphys-swapfile
+sudo dphys-swapfile setup
+sudo dphys-swapfile swapon
+```
+
+Set Node's maximum amount of memory. Memory must be available.
+``` bash
+export NODE_OPTIONS=--max-old-space-size=512
+npm run build
+```
+
+### Process exited too early // kill -9
+
+``` {.bash emphasize-lines="8,9"}
+> webapp@0.1.0 build
+> react-scripts build
+
+[...]
+
+The build failed because the process exited too early.
+This probably means the system ran out of memory or someone called 'kill -9' on the process.
+```
+
+#### Reason
+
+Node tried to allocate more memory than available on the system.
+
+#### Solution
+
+See [JavaScript heap out of memory](#javascript-heap-out-of-memory)
+
+
+### Client network socket disconnected
+
+``` {.bash emphasize-lines="8,9"}
+[...]
+
+npm ERR! code ECONNRESET
+npm ERR! network Client network socket disconnected before secure TLS connection was established
+npm ERR! network This is a problem related to network connectivity.
+npm ERR! network In most cases you are behind a proxy or have bad network settings.
+npm ERR! network
+npm ERR! network If you are behind a proxy, please make sure that the
+npm ERR! network 'proxy' config is set properly. See: 'npm help config'
+```
+
+#### Reason
+
+The network connection is too slow or has issues.
+This tends to happen on `armv6l` devices where building takes significantly more time due to limited resources.
+
+#### Solution
+
+Try to use an ethernet connection. A reboot and/or running the script multiple times might also help ([Build produces EOF errors](#build-produces-eof-errors) might occur).
+
+If the error still persists, try to raise the timeout for npm package resolution.
+
+1. Open the npm config file in an editor
+1. Increase the `fetch-retry-*` values by '30000' (30 seconds) and save
+1. Retry the build
+
+### Build produces EOF errors
+
+#### Reason
+
+A previous run failed during installation and left a package corrupted.
+
+#### Solution
+
+Remove the mode packages and rerun again the script.
+``` {.bash emphasize-lines="8,9"}
+rm -rf node_modules
+```
diff --git a/installation/includes/00_constants.sh b/installation/includes/00_constants.sh
index 380e1de2e..89299989c 100644
--- a/installation/includes/00_constants.sh
+++ b/installation/includes/00_constants.sh
@@ -16,4 +16,7 @@ GIT_BRANCH_DEVELOP=${GIT_BRANCH_DEVELOP:-future3/develop}
# This message will be displayed at the end of the installation process
# Functions wanting to have something important printed at the end should APPEND to this variable
+# example:
+# local tmp_fin_message="A Message"
+# FIN_MESSAGE="${FIN_MESSAGE:+$FIN_MESSAGE\n}${tmp_fin_message}"
FIN_MESSAGE=""
diff --git a/installation/includes/01_default_config.sh b/installation/includes/01_default_config.sh
index fa1bafb61..ec7b67b66 100644
--- a/installation/includes/01_default_config.sh
+++ b/installation/includes/01_default_config.sh
@@ -26,8 +26,6 @@ GIT_USE_SSH=${GIT_USE_SSH:-"true"}
# For non-production builds, the Wep App must be build locally
# Valid values
# - release-only: download in release branch only
-# - true: force download even in non-release branch,
+# - true: force download even in non-release branch
# - false: never download
ENABLE_WEBAPP_PROD_DOWNLOAD=${ENABLE_WEBAPP_PROD_DOWNLOAD:-"release-only"}
-# Install Node during setup for Web App building. This is only needed for development builds
-ENABLE_INSTALL_NODE=${ENABLE_INSTALL_NODE:-"false"}
diff --git a/installation/includes/02_helpers.sh b/installation/includes/02_helpers.sh
index 239a18ccf..e9ca7640e 100644
--- a/installation/includes/02_helpers.sh
+++ b/installation/includes/02_helpers.sh
@@ -2,6 +2,17 @@
### Helpers
+show_slow_hardware_message() {
+ if [[ $(uname -m) == "armv6l" ]]; then
+ print_c "--------------------------------------------------------------------
+| Your hardware is a little slower so this will take a while. |
+| Go watch a movie but don't let your computer go to sleep for the |
+| SSH connection to remain intact. |
+--------------------------------------------------------------------
+"
+ fi
+}
+
# $1->start, $2->end
calc_runtime_and_print() {
runtime=$(($2-$1))
diff --git a/installation/includes/03_welcome.sh b/installation/includes/03_welcome.sh
index 5b3ee84be..62c4910c8 100644
--- a/installation/includes/03_welcome.sh
+++ b/installation/includes/03_welcome.sh
@@ -16,16 +16,16 @@ You are turning your Raspberry Pi into a Phoniebox.
Good choice!
Depending on your hardware, this installation might last
-around 60 minutes (usually it's faster). It updates OS
-packages, installs Phoniebox dependencies and registers
-settings. Be patient and don't let your computer go to
-sleep. It might disconnect your SSH connection causing
-the interruption of the installation process.
+around 60 minutes (usually it's faster, 20-30 min). It
+updates OS packages, installs Phoniebox dependencies and
+applies settings. Be patient and don't let your computer
+go to sleep. It might disconnect your SSH connection
+causing the interruption of the installation process.
Consider starting the installation in a terminal
multiplexer like 'screen' or 'tmux' to avoid this.
-By the way, you can follow the installation details here
-in a separate SSH session:
+To follow the installation closely, use this command
+in another terminal.
cd; tail -f ${INSTALLATION_LOGFILE}
Let's set up your Phoniebox.
diff --git a/installation/includes/05_finish.sh b/installation/includes/05_finish.sh
index 22ba6ae80..c48fc31d2 100644
--- a/installation/includes/05_finish.sh
+++ b/installation/includes/05_finish.sh
@@ -11,7 +11,7 @@ ${FIN_MESSAGE}
In order to start, you need to reboot your Raspberry Pi.
Your SSH connection will disconnect.
-After the reboot, you can access the WebApp in your browser at
+After the reboot, you can access the Web App in your browser at
http://${local_hostname}.local or http://${CURRENT_IP_ADDRESS}
Don't forget to upload files.
"
diff --git a/installation/routines/customize_options.sh b/installation/routines/customize_options.sh
index 7409a6e07..3e94b07dc 100644
--- a/installation/routines/customize_options.sh
+++ b/installation/routines/customize_options.sh
@@ -189,12 +189,12 @@ Do you want to install Samba? [Y/n]"
_option_webapp() {
# ENABLE_WEBAPP
clear_c
- print_c "------------------------ WEBAPP -------------------------
+ print_c "------------------------ WEB APP ------------------------
This is only required if you want to use
a graphical interface to manage your Phoniebox!
-Would you like to install the web application? [Y/n]"
+Would you like to install the Web App? [Y/n]"
read -r response
case "$response" in
[nN][oO]|[nN])
@@ -213,7 +213,7 @@ _option_kiosk_mode() {
print_c "----------------------- KIOSK MODE ----------------------
If you have a screen attached to your RPi,
-this will launch the web application right after boot.
+this will launch the Web App right after boot.
It will only install the necessary xserver dependencies
and not the entire RPi desktop environment.
@@ -282,48 +282,38 @@ Disable Pi's on-chip audio (headphone / jack output)? [y/N]"
_option_webapp_devel_build() {
# Let's detect if we are on the official release branch
- if [[ "$GIT_BRANCH" != "${GIT_BRANCH_RELEASE}" || "$GIT_USER" != "$GIT_UPSTREAM_USER" || "$CI_RUNNING" == "true" ]]; then
- ENABLE_INSTALL_NODE=true
+ if [[ "$GIT_BRANCH" != "${GIT_BRANCH_RELEASE}" && "$GIT_BRANCH" != "${GIT_BRANCH_DEVELOP}" ]] || [[ "$GIT_USER" != "$GIT_UPSTREAM_USER" ]] || [[ "$CI_RUNNING" == "true" ]] ; then
# Unless ENABLE_WEBAPP_PROD_DOWNLOAD is forced to true by user override, do not download a potentially stale build
if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == "release-only" ]]; then
ENABLE_WEBAPP_PROD_DOWNLOAD=false
fi
- if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == false ]]; then
+ if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" != true && "$ENABLE_WEBAPP_PROD_DOWNLOAD" != "release-only" ]]; then
clear_c
- print_c "--------------------- WEBAPP NODE ---------------------
+ print_c "--------------------- WEB APP BUILD ---------------------
-You are installing from an unofficial branch.
-Therefore a prebuilt web app is not available and
-you will have to build it locally.
+You are installing from a non-release branch
+and/or an unofficial repository.
+Therefore a pre-build Web App is not available
+and it needs to be built locally.
This requires Node to be installed.
-You can choose to decline the Node installation and
-the lastest prebuilt version from the main repository
-will be installed. This can lead to incompatibilities.
+If you decline, the lastest pre-build version
+from the official repository will be installed.
+This can lead to incompatibilities.
-Do you want to install Node? [Y/n]"
+Do you want to build the Web App? [Y/n]"
read -r response
case "$response" in
[nN][oO]|[nN])
- ENABLE_INSTALL_NODE=false
- ENABLE_WEBAPP_PROD_DOWNLOAD=true
- ;;
+ ENABLE_WEBAPP_PROD_DOWNLOAD=true
+ ;;
*)
- # This message will be displayed at the end of the installation process
- local tmp_fin_message="ATTENTION: You need to build the web app locally with
- $ cd ~/RPi-Jukebox-RFID/src/webapp && ./run_rebuild.sh -u
- This must be done after reboot, due to memory restrictions.
- Read the documentation regarding local Web App builds!"
- FIN_MESSAGE="${FIN_MESSAGE:+$FIN_MESSAGE\n}${tmp_fin_message}"
- ;;
+ ;;
esac
fi
fi
- log "ENABLE_INSTALL_NODE=${ENABLE_INSTALL_NODE}"
- if [ "$ENABLE_INSTALL_NODE" != true ]; then
- log "ENABLE_WEBAPP_PROD_DOWNLOAD=${ENABLE_WEBAPP_PROD_DOWNLOAD}"
- fi
+ log "ENABLE_WEBAPP_PROD_DOWNLOAD=${ENABLE_WEBAPP_PROD_DOWNLOAD}"
}
_run_customize_options() {
diff --git a/installation/routines/install.sh b/installation/routines/install.sh
index 62d602f17..f1f2a5f80 100644
--- a/installation/routines/install.sh
+++ b/installation/routines/install.sh
@@ -2,6 +2,7 @@ install() {
clear_c
customize_options
clear_c
+ show_slow_hardware_message
set_raspi_config
set_ssh_qos
update_raspi_os
diff --git a/installation/routines/setup_jukebox_core.sh b/installation/routines/setup_jukebox_core.sh
index 1c524abb0..d9c06b937 100644
--- a/installation/routines/setup_jukebox_core.sh
+++ b/installation/routines/setup_jukebox_core.sh
@@ -8,14 +8,6 @@ JUKEBOX_ZMQ_VERSION="4.3.5"
JUKEBOX_PULSE_CONFIG="${HOME_PATH}"/.config/pulse/default.pa
JUKEBOX_SERVICE_NAME="${SYSTEMD_USR_PATH}/jukebox-daemon.service"
-_show_slow_hardware_message() {
- print_c " --------------------------------------------------------------------
- | Your hardware is a little slower so this step will take a while. |
- | Go watch a movie but don't let your computer go to sleep for the |
- | SSH connection to remain intact. |
- --------------------------------------------------------------------"
-}
-
# Functions
_jukebox_core_install_os_dependencies() {
print_lc " Install Jukebox OS dependencies"
@@ -86,11 +78,6 @@ _jukebox_core_build_and_install_pyzmq() {
print_lc " Install pyzmq with libzmq-drafts to support WebSockets"
if ! pip list | grep -F pyzmq >> /dev/null; then
-
- if [[ $(uname -m) == "armv6l" ]]; then
- _show_slow_hardware_message
- fi
-
mkdir -p "${JUKEBOX_ZMQ_TMP_DIR}" || exit_on_error
if [ "$BUILD_LIBZMQ_WITH_DRAFTS_ON_DEVICE" = true ] ; then
_jukebox_core_build_libzmq_with_drafts
diff --git a/installation/routines/setup_jukebox_webapp.sh b/installation/routines/setup_jukebox_webapp.sh
index 2884f18cb..7fcbce7ff 100644
--- a/installation/routines/setup_jukebox_webapp.sh
+++ b/installation/routines/setup_jukebox_webapp.sh
@@ -3,58 +3,87 @@
# Constants
WEBAPP_NGINX_SITE_DEFAULT_CONF="/etc/nginx/sites-available/default"
-# For ARMv7+
+# Node major version used.
+# If changed also update in .github\actions\build-webapp\action.yml
NODE_MAJOR=20
-# For ARMv6
-# To update version, follow these links
-# https://github.com/sdesalas/node-pi-zero
-# https://github.com/nodejs/unofficial-builds/
-NODE_SOURCE_EXPERIMENTAL="https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v16.3.0.sh"
+# Node version for ARMv6 (unofficial builds)
+NODE_ARMv6_VERSION=v20.10.0
-_jukebox_webapp_install_node() {
- sudo apt-get -y update
+OPTIONAL_WEBAPP_BUILD_FAILED=false
- if which node > /dev/null; then
- print_lc " Found existing NodeJS. Hence, updating NodeJS"
- sudo npm cache clean -f
- sudo npm install --silent -g n
- sudo n --quiet latest
- sudo npm update --silent -g
- else
+_jukebox_webapp_install_node() {
print_lc " Install NodeJS"
- # Zero and older versions of Pi with ARMv6 only
- # support experimental NodeJS
- if [[ $(uname -m) == "armv6l" ]]; then
- wget -O - ${NODE_SOURCE_EXPERIMENTAL} | sudo bash
- sudo apt-get -qq -y install nodejs
- sudo npm install --silent -g npm
+ local node_version_installed=$(node -v 2>/dev/null)
+ local arch=$(uname -m)
+ if [[ "$arch" == "armv6l" ]]; then
+ if [ "$node_version_installed" == "$NODE_ARMv6_VERSION" ]; then
+ print_lc " Skipping. NodeJS already installed"
+ else
+ # For ARMv6 unofficial build
+ # https://github.com/nodejs/unofficial-builds/
+ local node_tmp_dir="${HOME_PATH}/node"
+ local node_install_dir=/usr/local/lib/nodejs
+ local node_filename="node-${NODE_ARMv6_VERSION}-linux-${arch}"
+ local node_tar_filename="${node_filename}.tar.gz"
+ node_download_url="https://unofficial-builds.nodejs.org/download/release/${NODE_ARMv6_VERSION}/${node_tar_filename}"
+
+ mkdir -p "${node_tmp_dir}" && cd "${node_tmp_dir}" || exit_on_error
+ download_from_url ${node_download_url} ${node_tar_filename}
+ tar -xzf ${node_tar_filename}
+ rm -rf ${node_tar_filename}
+
+ # see https://github.com/nodejs/help/wiki/Installation
+ # Remove existing symlinks
+ sudo unlink /usr/bin/node 2>/dev/null
+ sudo unlink /usr/bin/npm 2>/dev/null
+ sudo unlink /usr/bin/npx 2>/dev/null
+
+ # Clear existing nodejs and copy new files
+ sudo rm -rf "${node_install_dir}"
+ sudo mv "${node_filename}" "${node_install_dir}"
+
+ sudo ln -s "${node_install_dir}/bin/node" /usr/bin/node
+ sudo ln -s "${node_install_dir}/bin/npm" /usr/bin/npm
+ sudo ln -s "${node_install_dir}/bin/npx" /usr/bin/npx
+
+ cd "${HOME_PATH}" || exit_on_error
+ rm -rf "${node_tmp_dir}"
+ fi
else
- # install NodeJS and npm as recommended in
- # https://github.com/nodesource/distributions
- sudo apt-get install -y ca-certificates curl gnupg
- sudo mkdir -p /etc/apt/keyrings
- curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
- echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
- sudo apt-get update
- sudo apt-get install -y nodejs
+ if [[ "$node_version_installed" == "v${NODE_MAJOR}."* ]]; then
+ print_lc " Skipping. NodeJS already installed"
+ else
+ sudo apt-get -y remove nodejs
+ # install NodeJS as recommended in
+ # https://deb.nodesource.com/
+ sudo apt-get -y update && sudo apt-get -y install ca-certificates curl gnupg
+ sudo mkdir -p /etc/apt/keyrings
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
+ sudo apt-get -y update && sudo apt-get -y install nodejs
+ fi
fi
- fi
}
-# TODO: Avoid building the app locally
-# Instead implement a Github Action that prebuilds on commititung a git tag
_jukebox_webapp_build() {
- print_lc " Building web application"
- cd "${INSTALLATION_PATH}/src/webapp" || exit_on_error
- npm ci --prefer-offline --no-audit --production
- rm -rf build
- # The build wrapper script checks available memory on system and sets Node options accordingly
- ./run_rebuild.sh
+ print_lc " Building Web App"
+ cd "${INSTALLATION_PATH}/src/webapp" || exit_on_error
+ if ! ./run_rebuild.sh -u ; then
+ print_lc " Web App build failed!
+ Follow instructions shown at the end of installation!"
+ OPTIONAL_WEBAPP_BUILD_FAILED=true
+ # This message will be displayed at the end of the installation process
+ local tmp_fin_message="ATTENTION: The build of the Web App failed during installation.
+ Please run the build manually with the following command
+ $ cd ~/RPi-Jukebox-RFID/src/webapp && ./run_rebuild.sh -u
+ Read the documentation regarding local Web App builds!"
+ FIN_MESSAGE="${FIN_MESSAGE:+$FIN_MESSAGE\n}${tmp_fin_message}"
+ fi
}
_jukebox_webapp_download() {
- print_lc " Downloading web application"
+ print_lc " Downloading Web App"
local jukebox_version=$(python "${INSTALLATION_PATH}/src/jukebox/jukebox/version.py")
local git_head_hash=$(git -C "${INSTALLATION_PATH}" rev-parse --verify --quiet HEAD)
local git_head_hash_short=${git_head_hash:0:10}
@@ -67,11 +96,11 @@ _jukebox_webapp_download() {
if validate_url ${download_url_commit} ; then
log " DOWNLOAD_URL ${download_url_commit}"
download_from_url ${download_url_commit} ${tar_filename}
- elif [[ $ENABLE_WEBAPP_PROD_DOWNLOAD == true ]] && validate_url ${download_url_latest} ; then
+ elif [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == true ]] && validate_url ${download_url_latest} ; then
log " DOWNLOAD_URL ${download_url_latest}"
download_from_url ${download_url_latest} ${tar_filename}
else
- exit_on_error "No prebuild webapp bundle found!"
+ exit_on_error "No prebuild Web App bundle found!"
fi
tar -xzf ${tar_filename}
rm -f ${tar_filename}
@@ -80,7 +109,7 @@ _jukebox_webapp_download() {
_jukebox_webapp_register_as_system_service_with_nginx() {
print_lc " Install and configure nginx"
- sudo apt-get -qq -y update
+ sudo apt-get -y update
sudo apt-get -y purge apache2
sudo apt-get -y install nginx
@@ -97,11 +126,22 @@ _jukebox_webapp_register_as_system_service_with_nginx() {
_jukebox_webapp_check() {
print_verify_installation
- if [[ $ENABLE_WEBAPP_PROD_DOWNLOAD == true || $ENABLE_WEBAPP_PROD_DOWNLOAD == release-only ]] ; then
+ if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == true || "$ENABLE_WEBAPP_PROD_DOWNLOAD" == "release-only" ]] ; then
verify_dirs_exists "${INSTALLATION_PATH}/src/webapp/build"
- fi
- if [[ $ENABLE_INSTALL_NODE == true ]] ; then
- verify_apt_packages nodejs
+ else
+ local arch=$(uname -m)
+ if [[ "$arch" == "armv6l" ]]; then
+ local node_version_installed=$(node -v 2>/dev/null)
+ log " Verify 'node' is installed"
+ test ! "${node_version_installed}" == "${NODE_ARMv6_VERSION}" && exit_on_error "ERROR: 'node' not in expected version: '${node_version_installed}' instead of '${NODE_ARMv6_VERSION}'!"
+ log " CHECK"
+ else
+ verify_apt_packages nodejs
+ fi
+
+ if [[ "$OPTIONAL_WEBAPP_BUILD_FAILED" == false ]]; then
+ verify_dirs_exists "${INSTALLATION_PATH}/src/webapp/build"
+ fi
fi
verify_apt_packages nginx
@@ -111,14 +151,11 @@ _jukebox_webapp_check() {
}
_run_setup_jukebox_webapp() {
- if [[ $ENABLE_WEBAPP_PROD_DOWNLOAD == true || $ENABLE_WEBAPP_PROD_DOWNLOAD == release-only ]] ; then
+ if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == true || "$ENABLE_WEBAPP_PROD_DOWNLOAD" == "release-only" ]] ; then
_jukebox_webapp_download
- fi
- if [[ $ENABLE_INSTALL_NODE == true ]] ; then
+ else
_jukebox_webapp_install_node
- # Local Web App build during installation does not work at the moment
- # Needs to be done after reboot! There will be a message at the end of the installation process
- # _jukebox_webapp_build
+ _jukebox_webapp_build
fi
_jukebox_webapp_register_as_system_service_with_nginx
_jukebox_webapp_check
@@ -126,6 +163,6 @@ _run_setup_jukebox_webapp() {
setup_jukebox_webapp() {
if [ "$ENABLE_WEBAPP" == true ] ; then
- run_with_log_frame _run_setup_jukebox_webapp "Install web application"
+ run_with_log_frame _run_setup_jukebox_webapp "Install Web App"
fi
}
diff --git a/resources/default-settings/gpio.example.yaml b/resources/default-settings/gpio.example.yaml
index f19b83c87..59793210f 100644
--- a/resources/default-settings/gpio.example.yaml
+++ b/resources/default-settings/gpio.example.yaml
@@ -1,6 +1,6 @@
# Provides a few selected examples of GPIO configuration
# Check out the documentation for many more configuration recipes
-# https://rpi-jukebox-rfid.readthedocs.io/en/latest/index.html
+# documentation/builders/gpio.md
pin_factory:
type: rpigpio.RPiGPIOFactory
output_devices:
diff --git a/resources/html/404.html b/resources/html/404.html
index 1a60d2415..a79decc6c 100755
--- a/resources/html/404.html
+++ b/resources/html/404.html
@@ -15,7 +15,7 @@ Ups! Requested file not found.
Why not try again from the top-level of
diff --git a/resources/html/runbuildui.html b/resources/html/runbuildui.html
index 04f92c704..6ade7bb0a 100755
--- a/resources/html/runbuildui.html
+++ b/resources/html/runbuildui.html
@@ -12,11 +12,11 @@
Ups! Looks like your Web UI has not been build!
No reason to panic. Please run through the following steps:
- In case of trouble when building the Web UI, consult the documentation!
+
In case of trouble when building the Web UI, consult the official documentation!