Skip to content

Commit

Permalink
Update install.sh (#1701)
Browse files Browse the repository at this point in the history
* Update install.sh

Enable CORS by default

* Update install.sh

Moved CORS before OctoDash install.

* Update install.sh

Changed to if statement to verify if it is enabled first, if not, then enable it.

* Update install.sh

Changed to use installer script variables

* Update install.sh

Updated as requested.

* Update install.sh

Added red text color to CORS message.

* Update scripts/install.sh

Co-authored-by: Timon G. <unchartedbull@gmail.com>

* Update scripts/install.sh

Co-authored-by: Timon G. <unchartedbull@gmail.com>

* Update install.sh

Added color and attempted bold. It turns from red, to pink..

Co-authored-by: Timon G. <unchartedbull@gmail.com>
  • Loading branch information
Will-wastelander and UnchartedBull authored May 5, 2021
1 parent acc2f5a commit c59cd18
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,20 @@ if [ $DIRECTORY != "-" ]; then
fi;
fi;

if "$DIRECTORY"/bin/octoprint config get --yaml "api.allowCrossOrigin" | grep -q 'false'; then
yes_no=( 'yes' 'no' )

list_input "Should I enable CORS ? FYI, this is required by OctoDash v3 and OctoPrint 1.6.0, and may have security implications" yes_no cors

echo $cors
if [ $cors == 'yes' ]; then
echo "Enabling CORS ..."
"$DIRECTORY"/bin/octoprint config set --bool "api.allowCrossOrigin" true
else
echo "${red}CORS has ${bold}NOT${normal} been enabled. OctoDash most likely won't work if CORS is disabled. You can always enable it in the API settings in OctoPrint"
fi
fi;

echo "Installing OctoDash "${version[7]}, $arch" ..."
cd ~
wget -O octodash.deb $releaseURL -q --show-progress
Expand Down

0 comments on commit c59cd18

Please sign in to comment.