MJPG, OctoPrint build, first-time and Nginx improvements
First-time will now ask you to configure your timezone MJPG Streamer now has -w because that was needed according to the internet OctoPrint build now no longer makes useless folder Nginx now has HSTS header to save some typing FFmpeg is now installed
This commit is contained in:
parent
4550badacd
commit
a3fff10d3f
8 changed files with 20 additions and 11 deletions
2
TODO.md
2
TODO.md
|
@ -13,3 +13,5 @@
|
|||
- Wayland using labwc/waybox
|
||||
- Python 3
|
||||
- Detect if frontend did not load correctly (probably not easy)
|
||||
- HTTP/Port 80 redirect
|
||||
|
||||
|
|
|
@ -5,3 +5,4 @@ python-virtualenv
|
|||
git
|
||||
libyaml-dev
|
||||
nginx
|
||||
ffmpeg
|
||||
|
|
|
@ -7,12 +7,10 @@ echo -e "listen 443;" > ${ROOTFS_DIR}/etc/nginx/listen.conf
|
|||
|
||||
on_chroot << EOF
|
||||
# If OctoPrint already exists, skip this (for debugging)
|
||||
if [[ ! -f /srv/octoprint/venv/bin/octoprint ]]; then
|
||||
if [[ ! -d /srv/octoprint ]]; then mkdir -p /srv/octoprint; fi
|
||||
cd /srv/octoprint || exit 1
|
||||
# https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspbian/2337/
|
||||
virtualenv venv || exit 1
|
||||
source venv/bin/activate || exit 1
|
||||
if [[ ! -f /srv/octoprint/bin/octoprint ]]; then
|
||||
cd /srv/ || exit 1
|
||||
virtualenv octoprint || exit 1
|
||||
source octoprint/bin/activate || exit 1
|
||||
pip install pip --upgrade
|
||||
pip install octoprint || exit 1
|
||||
# Fix permissions
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
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";
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
|
|
|
@ -6,7 +6,7 @@ Wants=nginx.service
|
|||
Type=simple
|
||||
User=octoprint
|
||||
Group=octoprint
|
||||
ExecStart=/srv/octoprint/venv/bin/octoprint --host localhost --port 5000
|
||||
ExecStart=/srv/octoprint/bin/octoprint --host localhost --port 5000
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -16,6 +16,10 @@ if ! which mjpg_streamer; then
|
|||
cd /
|
||||
# Cleanup
|
||||
rm -rf /tmp/mjpg-streamer
|
||||
# Create needed folder
|
||||
mkdir -p /var/www/mjpg
|
||||
# Permissions
|
||||
chown octoprint:octoprint /var/www/mjpg
|
||||
fi
|
||||
EOF
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/bash
|
||||
/usr/local/bin/mjpg_streamer -i input_uvc.so -o "output_http.so --port 8080"
|
||||
/usr/local/bin/mjpg_streamer -i input_uvc.so -o "output_http.so --port 8080 -w /var/www/mjpg"
|
||||
|
|
|
@ -12,7 +12,7 @@ source /usr/local/lib/octo-lib.sh
|
|||
|
||||
install_package () {
|
||||
echo "==========Installing $1==========" >>/home/pi/install.log
|
||||
source /srv/octoprint/venv/bin/activate || return 1
|
||||
source /srv/octoprint/bin/activate || return 1
|
||||
pip install $1 2>&1 >>/home/pi/install.log || return 1
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,9 @@ change_password
|
|||
dialog --title "Network Configuration" --nocancel --msgbox "Setup will now open nmtui, a program to help configure your ethernet/wireless interfaces. Hit Quit when you are done." 10 50
|
||||
nmtui
|
||||
|
||||
# Configure the timezone
|
||||
dpkg-reconfigure tzdata
|
||||
|
||||
# Enable/disable OctoPrint, GUI, MJPG and SSH
|
||||
service_select
|
||||
|
||||
|
|
Loading…
Reference in a new issue