diff --git a/TODO.md b/TODO.md index 869f03c..c67ef01 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ ## First time/Octo-Config - Add network configuration (replace nmtui) - Add hostname configuration (replace nmtui) -- Timezone selection ## Misc - More security @@ -13,4 +12,4 @@ - Python 3 - Detect if frontend did not load correctly (probably not easy) - HTTP/Port 80 redirect - +- https://github.com/blueimp/mjpeg-server diff --git a/stage1/01-sys-tweaks/files/.browser.sh b/stage1/01-sys-tweaks/files/.browser.sh index c8db565..01dd8fe 100644 --- a/stage1/01-sys-tweaks/files/.browser.sh +++ b/stage1/01-sys-tweaks/files/.browser.sh @@ -13,11 +13,16 @@ fi # Override the automatically detected address if the user wants to if [[ -f ~/.overrideurl.sh ]]; then source ~/.overrideurl.sh; fi -# Wait until OctoPrint comes up +# Wait until Nginx/override comes up while ! curl "$ADDRESS" 2>&1 >/dev/null; do sleep 1 done +# Wait until OctoPrint comes up if it is enabled +while [[ -f /etc/systemd/system/multi-user.target.wants/octoprint.service ]] && ! curl "localhost:5000"; do + sleep 1 +done + ###### ## Opens browser # -t | Disables strict TLS check diff --git a/stage2/04-octoprint/files/nginx.conf b/stage2/04-octoprint/files/nginx.conf index f220cd9..86b9878 100644 --- a/stage2/04-octoprint/files/nginx.conf +++ b/stage2/04-octoprint/files/nginx.conf @@ -28,7 +28,8 @@ ssl on; ssl_certificate /etc/ssl/certs/nginx-octoprint.crt; ssl_certificate_key /etc/ssl/private/nginx-octoprint.key; - add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; + add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; + error_page 497 https://$host$request_uri; server_name localhost; location / { diff --git a/stage2/06-utils/files/octo-lib.sh b/stage2/06-utils/files/octo-lib.sh index 9e547bb..46d2be6 100644 --- a/stage2/06-utils/files/octo-lib.sh +++ b/stage2/06-utils/files/octo-lib.sh @@ -51,8 +51,10 @@ service_select () { if [[ $ENABLE_MJPG == true ]]; then systemctl enable mjpg-streamer + raspi-config nonint do_camera 0 # Counter intuitively enables the camera else systemctl disable mjpg-streamer + raspi-config nonint do_camera 1 # Disables the camera fi if [[ $ENABLE_GUI == true ]]; then diff --git a/stage2/EXPORT_IMAGE b/stage2/EXPORT_IMAGE index 79ec11a..84edbb4 100644 --- a/stage2/EXPORT_IMAGE +++ b/stage2/EXPORT_IMAGE @@ -1,4 +1,4 @@ -IMG_SUFFIX="" +IMG_SUFFIX="-nogui" if [ "${USE_QEMU}" = "1" ]; then export IMG_SUFFIX="${IMG_SUFFIX}-qemu" fi diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS deleted file mode 100644 index 24bef6a..0000000 --- a/stage2/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Octoprint" -NOOBS_DESCRIPTION="A fork of Raspbian with Octoprint" diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 4dc9984..554c735 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -18,3 +18,4 @@ obconf arandr openbox nodm +xinput-calibrator diff --git a/stage3/EXPORT_NOOBS b/stage3/EXPORT_NOOBS deleted file mode 100644 index e6d0c4d..0000000 --- a/stage3/EXPORT_NOOBS +++ /dev/null @@ -1,2 +0,0 @@ -NOOBS_NAME="Octoprint Kiosk" -NOOBS_DESCRIPTION="A fork of Raspbian that includes OctoPrint and a nice frontend"