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
|
- Wayland using labwc/waybox
|
||||||
- Python 3
|
- Python 3
|
||||||
- Detect if frontend did not load correctly (probably not easy)
|
- Detect if frontend did not load correctly (probably not easy)
|
||||||
|
- HTTP/Port 80 redirect
|
||||||
|
|
||||||
|
|
|
@ -5,3 +5,4 @@ python-virtualenv
|
||||||
git
|
git
|
||||||
libyaml-dev
|
libyaml-dev
|
||||||
nginx
|
nginx
|
||||||
|
ffmpeg
|
||||||
|
|
|
@ -7,12 +7,10 @@ echo -e "listen 443;" > ${ROOTFS_DIR}/etc/nginx/listen.conf
|
||||||
|
|
||||||
on_chroot << EOF
|
on_chroot << EOF
|
||||||
# If OctoPrint already exists, skip this (for debugging)
|
# If OctoPrint already exists, skip this (for debugging)
|
||||||
if [[ ! -f /srv/octoprint/venv/bin/octoprint ]]; then
|
if [[ ! -f /srv/octoprint/bin/octoprint ]]; then
|
||||||
if [[ ! -d /srv/octoprint ]]; then mkdir -p /srv/octoprint; fi
|
cd /srv/ || exit 1
|
||||||
cd /srv/octoprint || exit 1
|
virtualenv octoprint || exit 1
|
||||||
# https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspbian/2337/
|
source octoprint/bin/activate || exit 1
|
||||||
virtualenv venv || exit 1
|
|
||||||
source venv/bin/activate || exit 1
|
|
||||||
pip install pip --upgrade
|
pip install pip --upgrade
|
||||||
pip install octoprint || exit 1
|
pip install octoprint || exit 1
|
||||||
# Fix permissions
|
# Fix permissions
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
ssl on;
|
ssl on;
|
||||||
ssl_certificate /etc/ssl/certs/nginx-octoprint.crt;
|
ssl_certificate /etc/ssl/certs/nginx-octoprint.crt;
|
||||||
ssl_certificate_key /etc/ssl/private/nginx-octoprint.key;
|
ssl_certificate_key /etc/ssl/private/nginx-octoprint.key;
|
||||||
|
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
|
|
@ -6,7 +6,7 @@ Wants=nginx.service
|
||||||
Type=simple
|
Type=simple
|
||||||
User=octoprint
|
User=octoprint
|
||||||
Group=octoprint
|
Group=octoprint
|
||||||
ExecStart=/srv/octoprint/venv/bin/octoprint --host localhost --port 5000
|
ExecStart=/srv/octoprint/bin/octoprint --host localhost --port 5000
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -16,6 +16,10 @@ if ! which mjpg_streamer; then
|
||||||
cd /
|
cd /
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -rf /tmp/mjpg-streamer
|
rm -rf /tmp/mjpg-streamer
|
||||||
|
# Create needed folder
|
||||||
|
mkdir -p /var/www/mjpg
|
||||||
|
# Permissions
|
||||||
|
chown octoprint:octoprint /var/www/mjpg
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/bash
|
#!/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 () {
|
install_package () {
|
||||||
echo "==========Installing $1==========" >>/home/pi/install.log
|
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
|
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
|
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
|
nmtui
|
||||||
|
|
||||||
|
# Configure the timezone
|
||||||
|
dpkg-reconfigure tzdata
|
||||||
|
|
||||||
# Enable/disable OctoPrint, GUI, MJPG and SSH
|
# Enable/disable OctoPrint, GUI, MJPG and SSH
|
||||||
service_select
|
service_select
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue