touchprint/stage2/04-octoprint/01-run.sh
Logan Gartner a3fff10d3f
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
2020-08-16 16:15:54 -06:00

21 lines
640 B
Bash
Executable file

#!/bin/bash -e
install -m 644 files/octoprint.service ${ROOTFS_DIR}/etc/systemd/system/octoprint.service
install -m 644 files/nginx.conf ${ROOTFS_DIR}/etc/nginx/nginx.conf
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/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
chown -R octoprint:octoprint /srv/octoprint
fi
# Enable the reverse proxy
systemctl enable nginx
EOF