plugin menu

This commit is contained in:
paukstelis
2022-06-26 16:17:35 -04:00
parent f3c9b333b7
commit 8b6b498ce2
3 changed files with 50 additions and 20 deletions

View File

@@ -392,8 +392,6 @@ add_camera() {
if [ -z "$CAM" ] && [ -z "$TEMPUSBCAM" ]; then if [ -z "$CAM" ] && [ -z "$TEMPUSBCAM" ]; then
echo echo
echo -e "\033[0;31mNo camera was detected during the detection period.\033[0m" echo -e "\033[0;31mNo camera was detected during the detection period.\033[0m"
echo -e "You can use the Add Camera option to try again after finishing instance installation."
echo
echo echo
return return
fi fi
@@ -559,7 +557,6 @@ prepare () {
echo 'Beginning system preparation' | log echo 'Beginning system preparation' | log
echo 'This only needs to be run once to prepare your system to use octoprint_deploy.' echo 'This only needs to be run once to prepare your system to use octoprint_deploy.'
echo 'Run this setup and then connect to OctoPrint through your browser to setup your admin user.'
PS3='Installation type: ' PS3='Installation type: '
options=("OctoPi" "Ubuntu 18-22, Mint, Debian, Raspberry Pi OS" "Fedora/CentOS" "ArchLinux" "Quit") options=("OctoPi" "Ubuntu 18-22, Mint, Debian, Raspberry Pi OS" "Fedora/CentOS" "ArchLinux" "Quit")
select opt in "${options[@]}" select opt in "${options[@]}"
@@ -601,9 +598,9 @@ prepare () {
if prompt_confirm "Ready to begin?" if prompt_confirm "Ready to begin?"
then then
echo 'instance:generic port:5000' > /etc/octoprint_instances #echo 'instance:generic port:5000' > /etc/octoprint_instances
echo 'Adding camera port records' #echo 'Adding camera port records'
touch /etc/camera_ports #touch /etc/camera_ports
echo 'Adding current user to dialout and video groups.' echo 'Adding current user to dialout and video groups.'
usermod -a -G dialout,video $user usermod -a -G dialout,video $user
@@ -616,6 +613,7 @@ prepare () {
echo "They will be found at /home/$user/.old-octo" echo "They will be found at /home/$user/.old-octo"
echo "If you have generated service files for OctoPrint, please stop and disable them." echo "If you have generated service files for OctoPrint, please stop and disable them."
if prompt_confirm "Continue with installation?"; then if prompt_confirm "Continue with installation?"; then
MOVE=1
echo "Continuing installation." | log echo "Continuing installation." | log
systemctl stop octoprint.service systemctl stop octoprint.service
echo "Moving files to /home/$user/.old-octo" | log echo "Moving files to /home/$user/.old-octo" | log
@@ -629,7 +627,7 @@ prepare () {
if [ $INSTALL -eq 1 ]; then if [ $INSTALL -eq 1 ]; then
OCTOEXEC="sudo -u $user /home/$user/oprint/bin/octoprint" OCTOEXEC="sudo -u $user /home/$user/oprint/bin/octoprint"
echo 'type: octopi' >> /etc/octoprint_deploy OCTOPIP="sudo -u $user /home/$user/oprint/bin/pip"
if prompt_confirm "Would you like to install and use ustreamer instead of mjpg-streamer?"; then if prompt_confirm "Would you like to install and use ustreamer instead of mjpg-streamer?"; then
echo 'streamer: ustreamer' >> /etc/octoprint_deploy echo 'streamer: ustreamer' >> /etc/octoprint_deploy
apt-get -y install libevent-dev libbsd-dev apt-get -y install libevent-dev libbsd-dev
@@ -648,23 +646,30 @@ prepare () {
echo 'Installing needed packages' echo 'Installing needed packages'
apt-get -y install uuid-runtime apt-get -y install uuid-runtime
echo "Adding systemctl and reboot to sudo" echo "Adding systemctl and reboot to sudo"
echo "$user ALL=NOPASSWD: /usr/bin/systemctl" >> /etc/sudoers.d/octoprint_systemctl echo "$user ALL=NOPASSWD: /usr/bin/systemctl" > /etc/sudoers.d/octoprint_systemctl
echo "$user ALL=NOPASSWD: /usr/sbin/reboot" >> /etc/sudoers.d/octoprint_reboot echo "$user ALL=NOPASSWD: /usr/sbin/reboot" > /etc/sudoers.d/octoprint_reboot
echo 'haproxy: true' >> /etc/octoprint_deploy echo 'haproxy: true' >> /etc/octoprint_deploy
echo 'Modifying config.yaml' echo 'Modifying config.yaml'
cp -p $SCRIPTDIR/config.basic /home/pi/.octoprint/config.yaml cp -p $SCRIPTDIR/config.basic /home/pi/.octoprint/config.yaml
firstrun firstrun
echo 'Connect to your octoprint (octopi.local) instance and setup admin user if you have not already' echo 'Connect to your octoprint (octopi.local) instance and setup admin user if you have not already'
echo 'type: octopi' >> /etc/octoprint_deploy
if prompt_confirm "Would you like to install recommended plugins now?"; then
plugin_menu
fi
if prompt_confirm "Would you like to install cloud service plugins now?"; then
plugin_menu_cloud
fi
systemctl restart octoprint.service systemctl restart octoprint.service
fi fi
if [ $INSTALL -gt 1 ]; then if [ $INSTALL -gt 1 ]; then
OCTOEXEC="sudo -u $user /home/$user/OctoPrint/bin/octoprint" OCTOEXEC="sudo -u $user /home/$user/OctoPrint/bin/octoprint"
echo 'type: linux' >> /etc/octoprint_deploy OCTOPIP="suod -u $user /home/$user/OctoPrint/bin/pip"
echo "Adding systemctl and reboot to sudo" echo "Adding systemctl and reboot to sudo"
echo "$user ALL=NOPASSWD: /usr/bin/systemctl" >> /etc/sudoers.d/octoprint_systemctl echo "$user ALL=NOPASSWD: /usr/bin/systemctl" > /etc/sudoers.d/octoprint_systemctl
echo "$user ALL=NOPASSWD: /usr/sbin/reboot" >> /etc/sudoers.d/octoprint_reboot echo "$user ALL=NOPASSWD: /usr/sbin/reboot" > /etc/sudoers.d/octoprint_reboot
echo "This will install necessary packages, download and install OctoPrint and setup a template instance on this machine." echo "This will install necessary packages, download and install OctoPrint and setup a template instance on this machine."
#install packages #install packages
#All DEB based #All DEB based
@@ -684,7 +689,7 @@ prepare () {
fi fi
echo "Enabling ssh server..." echo "Enabling ssh server..."
systemctl enable ssh.service systemctl enable ssh.service
echo "Installing OctoPrint in /home/$user/OctoPrint" echo "Installing OctoPrint virtual environment in /home/$user/OctoPrint"
#make venv #make venv
sudo -u $user python3 -m venv /home/$user/OctoPrint sudo -u $user python3 -m venv /home/$user/OctoPrint
#update pip #update pip
@@ -794,16 +799,31 @@ prepare () {
#Prompt for admin user and firstrun stuff #Prompt for admin user and firstrun stuff
firstrun firstrun
echo 'type: linux' >> /etc/octoprint_deploy
echo 'Starting generic service on port 5000' echo 'Starting generic service on port 5000'
echo -e "\033[0;31mConnect to your template instance and setup the admin user if you have not done so already.\033[0m" echo -e "\033[0;31mConnect to your template instance and setup the admin user if you have not done so already.\033[0m"
systemctl start octoprint_default.service systemctl start octoprint_default.service
systemctl enable octoprint_default.service systemctl enable octoprint_default.service
echo echo
echo echo
#plugins, recommended
plugin_menu
#plugins, cloud
plugin_menu_cloud
#this restart seems necessary in some cases #this restart seems necessary in some cases
systemctl restart octoprint_default.service systemctl restart octoprint_default.service
fi fi
echo 'instance:generic port:5000' > /etc/octoprint_instances
echo 'Adding camera port records'
touch /etc/camera_ports
if [ $MOVE -eq 1 ]; then
echo "You can move your previously uploaded gcode to the template instance now."
echo "If you do this, ALL new instances will have these gcode files."
if prompt_confirm "Move old gcode files to template instance?"; then
mv /home/$user/.old-octo/uploads /home/$user/.octoprint/uploads
fi
fi
fi fi
main_menu main_menu
} }
@@ -929,8 +949,6 @@ create_menu() {
back_up $opt back_up $opt
main_menu main_menu
done done
} }
restart_all() { restart_all() {
@@ -1084,6 +1102,7 @@ main_menu() {
if [ $SUDO_USER ]; then user=$SUDO_USER; fi if [ $SUDO_USER ]; then user=$SUDO_USER; fi
logfile='octoprint_deploy.log' logfile='octoprint_deploy.log'
SCRIPTDIR=$(dirname $(readlink -f $0)) SCRIPTDIR=$(dirname $(readlink -f $0))
source $SCRIPTDIR/plugins.sh
#command line arguments #command line arguments
if [ "$1" == remove ]; then if [ "$1" == remove ]; then

4
plugins_cloud Normal file
View File

@@ -0,0 +1,4 @@
plugin:SimplyPrint Cloud path:https://github.com/SimplyPrint/OctoPrint-SimplyPrint/archive/master.zip
plugin:OctoEverywhere path:https://github.com/QuinnDamerell/OctoPrint-OctoEverywhere/archive/master.zip
plugin:Polar Cloud path:https://github.com/markwal/OctoPrint-PolarCloud/archive/master.zip
plugin:AstroPrint Cloud path:https://github.com/AstroPrint/OctoPrint-AstroPrint/archive/master.zip

7
plugins_list Normal file
View File

@@ -0,0 +1,7 @@
plugin:CancelObject path:https://github.com/paukstelis/OctoPrint-Cancelobject/archive/master.zip
plugin:Bed Visualizer path:https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/master.zip
plugin:Firmware Updater path:https://github.com/OctoPrint/OctoPrint-FirmwareUpdater/archive/master.zip
plugin:Terminal Commands Extended: path:https://github.com/jneilliii/OctoPrint-TerminalCommandsExtended/archive/master.zip
plugin:Active Filters Extended path:https://github.com/jneilliii/OctoPrint-ActiveFiltersExtended/archive/master.zip
plugin:PrintTimeGenius path:https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip
plugin:Themify path:https://github.com/birkbjo/OctoPrint-Themeify/archive/master.zip