diff --git a/README.md b/README.md index 8a3ee18..814fae6 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@ # guac-install -Script for installing Guacamole 1.1.0 on Ubuntu 16.04 or newer (optionally with MySQL by default). It should also work on pure Debian 7, 8, and 9. **It seems Debian 10 is not working right now** +Script for installing Guacamole 1.1.0 on Ubuntu 16.04 or newer (with MySQL, or remote MySQL). It should also work on pure Debian or Raspbian. I have tested this with Debian 10.3.0 (Buster). **If other versions don't work please open an issue.** It is likely due to a required library having a different name. Run script, enter MySQL Root Password and Guacamole User password. Guacamole User is used to connect to the Guacamole Database. -The script attempts to install tomcat8 if the available version is 8.5.x or newer, if tomcat8 is only 8.0.x it will fall back to tomcat7. If you want to manually specify a tomcat version there's a commented out line you can modify. Have at it. +The script attempts to install tomcat9 by default. It will fall back on tomcat8 **if the available version is 8.5.x or newer**, otherwise it will fall back to tomcat7. If you want to manually specify a tomcat version there's a commented out line you can modify. Have at it. If you're looking to also have NGINX / Let's Encrypt / HTTPS click [HERE](https://github.com/bigredthelogger/guacamole) ## MFA/2FA -By default the script will not install MFA support (QR code for Google/Microsoft Authenticator, Duo Mobile, etc. or Duo Push), if you do want MFA support you need to specify the `-t` or `--totp` or for Duo `-d` or `--duo` flags on the command line. Or modify the script variables `installTOTP=true` or `installDuo=true`. +By default the script will not install MFA support (QR code for Google/Microsoft Authenticator, Duo Mobile, etc. or Duo Push), if you do want MFA support you need to specify the `-t` or `--totp` or for Duo `-d` or `--duo` flags on the command line. Or modify the script variables `installTOTP=true` or `installDuo=true`. **Do not install both** ## How to Run: @@ -44,7 +44,6 @@ The default credentials are guacadmin as both username and password. Please chan # guac-upgrade Script for upgrading currently installed Guacamole instance (previously installed via this script/guide). This will also now update the TOTP or Duo extensions if used. - If looks for the tomcat folder in /etc/ (E.G. `/etc/tomcat7` or `/etc/tomcat8`) hopefully that works to identify the correct tomcat version/path :smile: I'm open to suggestions/pull requests for a cleaner method. ## All Switches diff --git a/guac-install.sh b/guac-install.sh index 556bbdb..2a7be36 100644 --- a/guac-install.sh +++ b/guac-install.sh @@ -24,17 +24,15 @@ LOG="/tmp/guacamole_${GUACVERSION}_build.log" # Initialize variable values installTOTP="" installDuo="" - installMySQL="" mysqlHost="" mysqlPort="" mysqlRootPwd="" - guacDb="" guacUser="" guacPwd="" - PROMPT="" +MYSQL="" # Get script arguments for non-interactive mode while [ "$1" != "" ]; do @@ -97,6 +95,7 @@ if [[ -z $installTOTP ]] && [[ -z $installDuo ]]; then read PROMPT if [[ $PROMPT =~ ^[Yy]$ ]]; then installTOTP=true + installDuo=false else installTOTP=false fi @@ -108,6 +107,7 @@ if [[ -z $installDuo ]] && [[ -z $installTOTP ]]; then read PROMPT if [[ $PROMPT =~ ^[Yy]$ ]]; then installDuo=true + installTOTP=false else installDuo=false fi @@ -197,6 +197,11 @@ if [[ "${NAME}" == "Ubuntu" ]]; then else LIBPNG="libpng-dev" fi + if [ "$installMySQL" = true ]; then + MYSQL="mysql-server mysql-client mysql-common mysql-utilities" + else + MYSQL="mysql-client" + fi elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]]; then JPEGTURBO="libjpeg62-turbo-dev" if [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]]; then @@ -204,6 +209,11 @@ elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]]; else LIBPNG="libpng12-dev" fi + if [ "$installMySQL" = true ]; then + MYSQL="default-mysql-server default-mysql-client mysql-common" + else + MYSQL="default-mysql-client" + fi else echo "Unsupported Distro - Ubuntu, Debian, or Raspbian Only" exit 1 @@ -232,15 +242,6 @@ else TOMCAT="tomcat7" fi -MYSQL="" -if [ "$installMySQL" = true ]; then - if [ -z $(command -v mysql) ]; then - MYSQL="mysql-server mysql-client mysql-common mysql-utilities" - fi -else - MYSQL="mysql-client" -fi - # Uncomment to manually force a tomcat version #TOMCAT="" @@ -271,6 +272,8 @@ if [ $? -ne 0 ]; then echo -e "${RED}Failed to download guacamole-server-${GUACVERSION}.tar.gz" echo -e "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz${NC}" exit 1 +else + tar -xzf guacamole-server-${GUACVERSION}.tar.gz fi echo -e "${GREEN}Downloaded guacamole-server-${GUACVERSION}.tar.gz${NC}" @@ -289,6 +292,8 @@ if [ $? -ne 0 ]; then echo -e "${RED}Failed to download guacamole-auth-jdbc-${GUACVERSION}.tar.gz" echo -e "${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz" exit 1 +else + tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz fi echo -e "${GREEN}Downloaded guacamole-auth-jdbc-${GUACVERSION}.tar.gz${NC}" @@ -301,9 +306,10 @@ if [ "$installTOTP" = true ]; then echo -e "${RED}Failed to download guacamole-auth-totp-${GUACVERSION}.tar.gz" echo -e "${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz" exit 1 + else + tar -xzf guacamole-auth-totp-${GUACVERSION}.tar.gz fi echo -e "${GREEN}Downloaded guacamole-auth-totp-${GUACVERSION}.tar.gz${NC}" - tar -xzf guacamole-auth-totp-${GUACVERSION}.tar.gz fi # Duo @@ -313,9 +319,10 @@ if [ "$installDuo" = true ]; then echo -e "${RED}Failed to download guacamole-auth-duo-${GUACVERSION}.tar.gz" echo -e "${SERVER}/binary/guacamole-auth-duo-${GUACVERSION}.tar.gz" exit 1 + else + tar -xzf guacamole-auth-duo-${GUACVERSION}.tar.gz fi echo -e "${GREEN}Downloaded guacamole-auth-duo-${GUACVERSION}.tar.gz${NC}" - tar -xzf guacamole-auth-duo-${GUACVERSION}.tar.gz fi # Deal with Missing MySQL Connector/J @@ -326,17 +333,14 @@ if [[ -z $JAVALIB ]]; then echo -e "${RED}Failed to download mysql-connector-java-${MCJVER}.tar.gz" echo -e "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MCJVER}.tar.gz${NC}" exit 1 + else + tar -xzf mysql-connector-java-${MCJVER}.tar.gz fi echo -e "${GREEN}Downloaded mysql-connector-java-${MCJVER}.tar.gz${NC}" - tar -xzf mysql-connector-java-${MCJVER}.tar.gz fi echo -e "${GREEN}Downloading complete.${NC}" -# Extract Guacamole files -tar -xzf guacamole-server-${GUACVERSION}.tar.gz -tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz - # Make directories mkdir -p /etc/guacamole/lib mkdir -p /etc/guacamole/extensions