mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-17 12:34:29 +05:00
fix: nginx port stuff on all interface installers
This commit is contained in:
@@ -319,18 +319,12 @@ dwc2_reverse_proxy_dialog(){
|
|||||||
dwc2_port_check(){
|
dwc2_port_check(){
|
||||||
if [ "$DWC2_ENABLED" = "false" ]; then
|
if [ "$DWC2_ENABLED" = "false" ]; then
|
||||||
if [ "$SITE_ENABLED" = "true" ]; then
|
if [ "$SITE_ENABLED" = "true" ]; then
|
||||||
echo "Detected other enabled Interfaces:"
|
status_msg "Detected other enabled interfaces:"
|
||||||
[ "$OCTOPRINT_ENABLED" = "true" ] && echo " ${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}"
|
[ "$OCTOPRINT_ENABLED" = "true" ] && echo " ${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}"
|
||||||
[ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}"
|
[ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}"
|
||||||
[ "$FLUIDD_ENABLED" = "true" ] && echo " ${cyan}● Fluidd - Port:$FLUIDD_PORT${default}"
|
[ "$FLUIDD_ENABLED" = "true" ] && echo " ${cyan}● Fluidd - Port:$FLUIDD_PORT${default}"
|
||||||
if [ "$MAINSAIL_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ] || [ "$FLUIDD_PORT" = "80" ]; then
|
if [ "$MAINSAIL_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ] || [ "$FLUIDD_PORT" = "80" ]; then
|
||||||
PORT_80_BLOCKED="true"
|
PORT_80_BLOCKED="true"
|
||||||
fi
|
|
||||||
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
|
||||||
[ "$OCTOPRINT_PORT" = "80" ] && echo "${cyan}OctoPrint${default} already listens on Port 80!"
|
|
||||||
[ "$MAINSAIL_PORT" = "80" ] && echo "${cyan}Mainsail${default} already listens on Port 80!"
|
|
||||||
[ "$FLUIDD_PORT" = "80" ] && echo "${cyan}Fluidd${default} already listens on Port 80!"
|
|
||||||
echo "You need to choose a different Port for DWC2 than the above!"
|
|
||||||
select_dwc2_port
|
select_dwc2_port
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -344,9 +338,26 @@ dwc2_port_check(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
select_dwc2_port(){
|
select_dwc2_port(){
|
||||||
|
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
||||||
|
echo
|
||||||
|
top_border
|
||||||
|
echo -e "| ${red}!!!WARNING!!!${default} |"
|
||||||
|
echo -e "| ${red}You need to choose a different port for DWC2!${default} |"
|
||||||
|
echo -e "| ${red}The following web interface is listening at port 80:${default} |"
|
||||||
|
blank_line
|
||||||
|
[ "$OCTOPRINT_PORT" = "80" ] && echo "| ● OctoPrint |"
|
||||||
|
[ "$MAINSAIL_PORT" = "80" ] && echo "| ● Mainsail |"
|
||||||
|
[ "$FLUIDD_PORT" = "80" ] && echo "| ● Fluidd |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Make sure you don't choose a port which was already |"
|
||||||
|
echo -e "| assigned to one of the other web interfaces! |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |"
|
||||||
|
echo -e "| input. So make sure to choose a valid port! |"
|
||||||
|
bottom_border
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
||||||
if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ]; then
|
if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then
|
||||||
echo "Setting port $NEW_PORT for DWC2!"
|
echo "Setting port $NEW_PORT for DWC2!"
|
||||||
SET_LISTEN_PORT=$NEW_PORT
|
SET_LISTEN_PORT=$NEW_PORT
|
||||||
break
|
break
|
||||||
@@ -354,4 +365,5 @@ select_dwc2_port(){
|
|||||||
echo "That port is already taken! Select a different one!"
|
echo "That port is already taken! Select a different one!"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
@@ -14,18 +14,12 @@ install_fluidd(){
|
|||||||
fluidd_port_check(){
|
fluidd_port_check(){
|
||||||
if [ "$FLUIDD_ENABLED" = "false" ]; then
|
if [ "$FLUIDD_ENABLED" = "false" ]; then
|
||||||
if [ "$SITE_ENABLED" = "true" ]; then
|
if [ "$SITE_ENABLED" = "true" ]; then
|
||||||
echo "Detected other enabled Interfaces:"
|
status_msg "Detected other enabled interfaces:"
|
||||||
|
[ "$OCTOPRINT_ENABLED" = "true" ] && echo " ${cyan}● OctoPrint - Port: $OCTOPRINT_PORT${default}"
|
||||||
[ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port: $MAINSAIL_PORT${default}"
|
[ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port: $MAINSAIL_PORT${default}"
|
||||||
[ "$DWC2_ENABLED" = "true" ] && echo " ${cyan}● DWC2 - Port: $DWC2_PORT${default}"
|
[ "$DWC2_ENABLED" = "true" ] && echo " ${cyan}● DWC2 - Port: $DWC2_PORT${default}"
|
||||||
[ "$OCTOPRINT_ENABLED" = "true" ] && echo "${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}"
|
|
||||||
if [ "$MAINSAIL_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ]; then
|
if [ "$MAINSAIL_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ]; then
|
||||||
PORT_80_BLOCKED="true"
|
PORT_80_BLOCKED="true"
|
||||||
fi
|
|
||||||
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
|
||||||
[ "$MAINSAIL_PORT" = "80" ] && echo "${cyan}Mainsail${default} already listens on Port 80!"
|
|
||||||
[ "$DWC2_PORT" = "80" ] && echo "${cyan}DWC2${default} already listens on Port 80!"
|
|
||||||
[ "$OCTOPRINT_PORT" = "80" ] && echo "${cyan}OctoPrint${default} already listens on Port 80!"
|
|
||||||
echo "You need to choose a different Port for Fluidd than the above!"
|
|
||||||
select_fluidd_port
|
select_fluidd_port
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -39,16 +33,34 @@ fluidd_port_check(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
select_fluidd_port(){
|
select_fluidd_port(){
|
||||||
|
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
||||||
|
echo
|
||||||
|
top_border
|
||||||
|
echo -e "| ${red}!!!WARNING!!!${default} |"
|
||||||
|
echo -e "| ${red}You need to choose a different port for Fluidd!${default} |"
|
||||||
|
echo -e "| ${red}The following web interface is listening at port 80:${default} |"
|
||||||
|
blank_line
|
||||||
|
[ "$OCTOPRINT_PORT" = "80" ] && echo "| ● OctoPrint |"
|
||||||
|
[ "$MAINSAIL_PORT" = "80" ] && echo "| ● Mainsail |"
|
||||||
|
[ "$DWC2_PORT" = "80" ] && echo "| ● DWC2 |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Make sure you don't choose a port which was already |"
|
||||||
|
echo -e "| assigned to one of the other web interfaces! |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |"
|
||||||
|
echo -e "| input. So make sure to choose a valid port! |"
|
||||||
|
bottom_border
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
||||||
if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then
|
if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then
|
||||||
echo "Setting port $NEW_PORT for Mainsail!"
|
echo "Setting port $NEW_PORT for Fluidd!"
|
||||||
SET_LISTEN_PORT=$NEW_PORT
|
SET_LISTEN_PORT=$NEW_PORT
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "That port is already taken! Select a different one!"
|
echo "That port is already taken! Select a different one!"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_fluidd_ver(){
|
get_fluidd_ver(){
|
||||||
|
|||||||
@@ -14,18 +14,12 @@ install_mainsail(){
|
|||||||
mainsail_port_check(){
|
mainsail_port_check(){
|
||||||
if [ "$MAINSAIL_ENABLED" = "false" ]; then
|
if [ "$MAINSAIL_ENABLED" = "false" ]; then
|
||||||
if [ "$SITE_ENABLED" = "true" ]; then
|
if [ "$SITE_ENABLED" = "true" ]; then
|
||||||
echo "Detected other enabled Interfaces:"
|
status_msg "Detected other enabled interfaces:"
|
||||||
[ "$FLUIDD_ENABLED" = "true" ] && echo "${cyan}● Fluidd - Port:$FLUIDD_PORT${default}"
|
[ "$OCTOPRINT_ENABLED" = "true" ] && echo -e " ${cyan}● OctoPrint - Port: $OCTOPRINT_PORT${default}"
|
||||||
[ "$DWC2_ENABLED" = "true" ] && echo "${cyan}● DWC2 - Port:$DWC2_PORT${default}"
|
[ "$FLUIDD_ENABLED" = "true" ] && echo -e " ${cyan}● Fluidd - Port: $FLUIDD_PORT${default}"
|
||||||
[ "$OCTOPRINT_ENABLED" = "true" ] && echo "${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}"
|
[ "$DWC2_ENABLED" = "true" ] && echo -e " ${cyan}● DWC2 - Port: $DWC2_PORT${default}"
|
||||||
if [ "$FLUIDD_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ]; then
|
if [ "$FLUIDD_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ]; then
|
||||||
PORT_80_BLOCKED="true"
|
PORT_80_BLOCKED="true"
|
||||||
fi
|
|
||||||
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
|
||||||
[ "$FLUIDD_PORT" = "80" ] && echo "${cyan}Fluidd${default} already listens on Port 80!"
|
|
||||||
[ "$DWC2_PORT" = "80" ] && echo "${cyan}DWC2${default} already listens on Port 80!"
|
|
||||||
[ "$OCTOPRINT_PORT" = "80" ] && echo "${cyan}OctoPrint${default} already listens on Port 80!"
|
|
||||||
echo "You need to choose a different Port for Mainsail than the above!"
|
|
||||||
select_mainsail_port
|
select_mainsail_port
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -39,6 +33,23 @@ mainsail_port_check(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
select_mainsail_port(){
|
select_mainsail_port(){
|
||||||
|
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
||||||
|
echo
|
||||||
|
top_border
|
||||||
|
echo -e "| ${red}!!!WARNING!!!${default} |"
|
||||||
|
echo -e "| ${red}You need to choose a different port for Mainsail!${default} |"
|
||||||
|
echo -e "| ${red}The following web interface is listening at port 80:${default} |"
|
||||||
|
blank_line
|
||||||
|
[ "$OCTOPRINT_PORT" = "80" ] && echo "| ● OctoPrint |"
|
||||||
|
[ "$FLUIDD_PORT" = "80" ] && echo "| ● Fluidd |"
|
||||||
|
[ "$DWC2_PORT" = "80" ] && echo "| ● DWC2 |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Make sure you don't choose a port which was already |"
|
||||||
|
echo -e "| assigned to one of the other web interfaces! |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |"
|
||||||
|
echo -e "| input. So make sure to choose a valid port! |"
|
||||||
|
bottom_border
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
||||||
if [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then
|
if [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then
|
||||||
@@ -49,6 +60,7 @@ select_mainsail_port(){
|
|||||||
echo "That port is already taken! Select a different one!"
|
echo "That port is already taken! Select a different one!"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_mainsail_ver(){
|
get_mainsail_ver(){
|
||||||
|
|||||||
@@ -142,18 +142,12 @@ octoprint_reverse_proxy_dialog(){
|
|||||||
octoprint_port_check(){
|
octoprint_port_check(){
|
||||||
if [ "$OCTOPRINT_ENABLED" = "false" ]; then
|
if [ "$OCTOPRINT_ENABLED" = "false" ]; then
|
||||||
if [ "$SITE_ENABLED" = "true" ]; then
|
if [ "$SITE_ENABLED" = "true" ]; then
|
||||||
echo "Detected other enabled Interfaces:"
|
status_msg "Detected other enabled interfaces:"
|
||||||
[ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}"
|
[ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}"
|
||||||
[ "$FLUIDD_ENABLED" = "true" ] && echo " ${cyan}● Fluidd - Port:$FLUIDD_PORT${default}"
|
[ "$FLUIDD_ENABLED" = "true" ] && echo " ${cyan}● Fluidd - Port:$FLUIDD_PORT${default}"
|
||||||
[ "$DWC2_ENABLED" = "true" ] && echo " ${cyan}● DWC2 - Port:$DWC2_PORT${default}"
|
[ "$DWC2_ENABLED" = "true" ] && echo " ${cyan}● DWC2 - Port:$DWC2_PORT${default}"
|
||||||
if [ "$MAINSAIL_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$FLUIDD_PORT" = "80" ]; then
|
if [ "$MAINSAIL_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$FLUIDD_PORT" = "80" ]; then
|
||||||
PORT_80_BLOCKED="true"
|
PORT_80_BLOCKED="true"
|
||||||
fi
|
|
||||||
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
|
||||||
[ "$MAINSAIL_PORT" = "80" ] && echo "${cyan}Mainsail${default} already listens on Port 80!"
|
|
||||||
[ "$FLUIDD_PORT" = "80" ] && echo "${cyan}Fluidd${default} already listens on Port 80!"
|
|
||||||
[ "$DWC2_PORT" = "80" ] && echo "${cyan}DWC2${default} already listens on Port 80!"
|
|
||||||
echo "You need to choose a different Port for OctoPrint than the above!"
|
|
||||||
select_octoprint_port
|
select_octoprint_port
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -167,9 +161,26 @@ octoprint_port_check(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
select_octoprint_port(){
|
select_octoprint_port(){
|
||||||
|
if [ "$PORT_80_BLOCKED" = "true" ]; then
|
||||||
|
echo
|
||||||
|
top_border
|
||||||
|
echo -e "| ${red}!!!WARNING!!!${default} |"
|
||||||
|
echo -e "| ${red}You need to choose a different port for OctoPrint!${default} |"
|
||||||
|
echo -e "| ${red}The following web interface is listening at port 80:${default} |"
|
||||||
|
blank_line
|
||||||
|
[ "$MAINSAIL_PORT" = "80" ] && echo "| ● Mainsail |"
|
||||||
|
[ "$FLUIDD_PORT" = "80" ] && echo "| ● Fluidd |"
|
||||||
|
[ "$DWC2_PORT" = "80" ] && echo "| ● DWC2 |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Make sure you don't choose a port which was already |"
|
||||||
|
echo -e "| assigned to one of the other web interfaces! |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |"
|
||||||
|
echo -e "| input. So make sure to choose a valid port! |"
|
||||||
|
bottom_border
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
read -p "${cyan}Please enter a new Port:${default} " NEW_PORT
|
||||||
if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ]; then
|
if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ]; then
|
||||||
echo "Setting port $NEW_PORT for OctoPrint!"
|
echo "Setting port $NEW_PORT for OctoPrint!"
|
||||||
SET_LISTEN_PORT=$NEW_PORT
|
SET_LISTEN_PORT=$NEW_PORT
|
||||||
break
|
break
|
||||||
@@ -177,6 +188,7 @@ select_octoprint_port(){
|
|||||||
echo "That port is already taken! Select a different one!"
|
echo "That port is already taken! Select a different one!"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
create_config_yaml(){
|
create_config_yaml(){
|
||||||
|
|||||||
Reference in New Issue
Block a user