1
0
mirror of https://git.koehlerweb.org/frodovdr/guac-install synced 2025-05-17 05:13:14 +02:00

Compare commits

..

No commits in common. "80c99871da24b608633bca44616477c622f39041" and "4e88c3731e6b40221f73966ff728cb5c8cf7638f" have entirely different histories.

3 changed files with 30 additions and 86 deletions

View File

@ -1,6 +1,6 @@
# guac-install # guac-install
I've maintained this script for quite a few years now with the help of the other contributors and it seems to be getting more and more fragmented as libraries and system OSes diverge in their package management. I plan to continue maintaining the install script, but, I do highly suggest that more people try to use the containerized (docker) version. As it should work on basically any 64bit OS with Docker support. (That means it doesn't work on 32bit ARM/Rasp Pi) I've maintained this script for quite a few years now with the help of the other contributors and it seems to be getting more and more fragmented as libraries and system OSes diverge in their package management. I plan to continue mantaining the install script, but, I do highly suggest that more people try to use the containerized (docker) version. As it should work on basically any 64bit OS with Docker support. (That mean it doesn't work on 32bit ARM/Rasp Pi)
## NOTE: The fixes below are not to be used UNLESS you're having issues, don't run these for no reason, use the distro maintainers version unless there's a reason not to. ## NOTE: The fixes below are not to be used UNLESS you're having issues, don't run these for no reason, use the distro maintainers version unless there's a reason not to.
@ -20,7 +20,7 @@ sudo apt -y -t buster-backports install freerdp2-dev libpulse-dev
Script for installing Guacamole 1.3.0 on Ubuntu 16.04 or newer (with MySQL, or remote MySQL). It should also work on pure [Debian](https://www.debian.org/), [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), [Linux Mint](https://linuxmint.com/) (18/LMDE 4 or newer) or [Kali Linux](https://www.kali.org/). 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. Script for installing Guacamole 1.3.0 on Ubuntu 16.04 or newer (with MySQL, or remote MySQL). It should also work on pure [Debian](https://www.debian.org/), [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), [Linux Mint](https://linuxmint.com/) (18/LMDE 4 or newer) or [Kali Linux](https://www.kali.org/). 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. Be sure to save these! 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 `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. 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.

View File

@ -6,22 +6,6 @@ if ! [ $(id -u) = 0 ]; then echo "Please run this script as sudo or root"; exit
# Version number of Guacamole to install # Version number of Guacamole to install
GUACVERSION="1.3.0" GUACVERSION="1.3.0"
# Initialize variable values
installTOTP=""
# This is where we'll store persistent data for guacamole
INSTALLFOLDER="/opt/guacamole"
# This is where we'll store persistent data for mysql
MYSQLDATAFOLDER="/opt/mysql"
# Make folders!
mkdir -p ${INSTALLFOLDER}/install_files
mkdir ${INSTALLFOLDER}/extensions
mkdir ${MYSQLDATAFOLDER}
cd ${INSTALLFOLDER}/install_files
# Get script arguments for non-interactive mode # Get script arguments for non-interactive mode
while [ "$1" != "" ]; do while [ "$1" != "" ]; do
case $1 in case $1 in
@ -33,8 +17,6 @@ while [ "$1" != "" ]; do
shift shift
guacpwd="$1" guacpwd="$1"
;; ;;
-t | --totp )
installTOTP=true
esac esac
shift shift
done done
@ -69,52 +51,30 @@ else
echo echo
fi fi
if [[ -z "${installTOTP}" ]]; then # Install Stuff
# Prompt the user if they would like to install TOTP MFA, default of no apt-get update
echo -e -n "${CYAN}MFA: Would you like to install TOTP? (y/N): ${NC}"
read PROMPT # Install mysql-client and wget if they don't already have it
if [[ ${PROMPT} =~ ^[Yy]$ ]]; then apt-get -y install default-mysql-client wget
installTOTP=true if [ $? -ne 0 ]; then
else echo "Failed to install apt prerequisites: default-mysql-client wget"
installTOTP=false echo "Try manually isntalling these prerequisites and try again"
fi exit
fi fi
# Update apt and install wget if it's missing # Try to install docker from the official repo
apt-get update apt-get -y install docker-ce docker-ce-cli containerd.io
apt-get -y install wget if [ $? -ne 0 ]; then
echo "Failed to install docker via official apt repo"
# Check if mysql client already installed echo "Trying to install docker from https://get.docker.com"
if [ -x "$(command -v mysql)" ]; then wget -O get-docker.sh https://get.docker.com
echo "mysql detected!" chmod +x ./get-docker.sh
else ./get-docker.sh
# Install mysql-client
apt-get -y install default-mysql-client
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to install apt prerequisites: default-mysql-client" echo "Failed to install docker from https://get.docker.com"
echo "Try manually isntalling this prerequisites and try again"
exit exit
fi fi
fi rm ./get-docker.sh
# Check if docker already installed
if [ -x "$(command -v docker)" ]; then
echo "docker detected!"
else
echo "Installing docker"
# Try to install docker from the official repo
apt-get -y install docker-ce docker-ce-cli containerd.io
if [ $? -ne 0 ]; then
echo "Failed to install docker via official apt repo"
echo "Trying to install docker from https://get.docker.com"
wget -O get-docker.sh https://get.docker.com
chmod +x ./get-docker.sh
./get-docker.sh
if [ $? -ne 0 ]; then
echo "Failed to install docker from https://get.docker.com"
exit
fi
fi
fi fi
# Set SERVER to be the preferred download server from the Apache CDN # Set SERVER to be the preferred download server from the Apache CDN
@ -130,24 +90,8 @@ fi
tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz
# Download and install TOTP
if [ "${installTOTP}" = true ]; then
wget -q --show-progress -O guacamole-auth-totp-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to download guacamole-auth-totp-${GUACVERSION}.tar.gz" 1>&2
echo -e "${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz"
exit 1
else
echo -e "${GREEN}Downloaded guacamole-auth-totp-${GUACVERSION}.tar.gz${NC}"
tar -xzf guacamole-auth-totp-${GUACVERSION}.tar.gz
echo -e "${BLUE}Moving guacamole-auth-totp-${GUACVERSION}.jar (${INSTALLFOLDER}/extensions/)...${NC}"
cp -f guacamole-auth-totp-${GUACVERSION}/guacamole-auth-totp-${GUACVERSION}.jar ${INSTALLFOLDER}/extensions/
echo
fi
fi
# Start MySQL # Start MySQL
docker run --restart=always --detach --name=mysql -v ${MYSQLDATAFOLDER}:/var/lib/mysql --env="MYSQL_ROOT_PASSWORD=$mysqlrootpassword" --publish 3306:3306 healthcheck/mysql --default-authentication-plugin=mysql_native_password docker run --restart=always --detach --name=mysql --env="MYSQL_ROOT_PASSWORD=$mysqlrootpassword" --publish 3306:3306 healthcheck/mysql --default-authentication-plugin=mysql_native_password
# Wait for the MySQL Health Check equal "healthy" # Wait for the MySQL Health Check equal "healthy"
echo "Waiting for MySQL to be healthy" echo "Waiting for MySQL to be healthy"
@ -168,9 +112,13 @@ echo $SQLCODE | mysql -h 127.0.0.1 -P 3306 -u root -p$mysqlrootpassword
cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword -h 127.0.0.1 -P 3306 guacamole_db cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword -h 127.0.0.1 -P 3306 guacamole_db
docker run --restart=always --name guacd --detach guacamole/guacd:${GUACVERSION} docker run --restart=always --name guacd --detach guacamole/guacd
docker run --restart=always --name guacamole --detach --link mysql:mysql --link guacd:guacd -v ${INSTALLFOLDER}:/etc/guacamole -e MYSQL_HOSTNAME=127.0.0.1 -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=guacamole_user -e MYSQL_PASSWORD=$guacdbuserpassword -e GUACAMOLE_HOME=/etc/guacamole -p 8080:8080 guacamole/guacamole:${GUACVERSION} docker run --restart=always --name guacamole --detach --link mysql:mysql --link guacd:guacd -e MYSQL_HOSTNAME=127.0.0.1 -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=guacamole_user -e MYSQL_PASSWORD=$guacdbuserpassword -p 8080:8080 guacamole/guacamole
# Cleanup
echo -e "${BLUE}Cleanup install files...${NC}"
rm -rf guacamole-auth-jdbc-${GUACVERSION}*
echo
# Done # Done
echo
echo -e "Installation Complete\n- Visit: http://localhost:8080/guacamole/\n- Default login (username/password): guacadmin/guacadmin\n***Be sure to change the password***." echo -e "Installation Complete\n- Visit: http://localhost:8080/guacamole/\n- Default login (username/password): guacadmin/guacadmin\n***Be sure to change the password***."

View File

@ -235,7 +235,7 @@ if [[ "${NAME}" == "Ubuntu" ]] || [[ "${NAME}" == "Linux Mint" ]]; then
fi fi
elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]] || [[ "${NAME}" == "LMDE" ]]; then elif [[ "${NAME}" == *"Debian"* ]] || [[ "${NAME}" == *"Raspbian GNU/Linux"* ]] || [[ "${NAME}" == *"Kali GNU/Linux"* ]] || [[ "${NAME}" == "LMDE" ]]; then
JPEGTURBO="libjpeg62-turbo-dev" JPEGTURBO="libjpeg62-turbo-dev"
if [[ "${PRETTY_NAME}" == *"bullseye"* ]] || [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]] || [[ "${NAME}" == "LMDE" ]]; then if [[ "${PRETTY_NAME}" == *"stretch"* ]] || [[ "${PRETTY_NAME}" == *"buster"* ]] || [[ "${PRETTY_NAME}" == *"Kali GNU/Linux Rolling"* ]] || [[ "${NAME}" == "LMDE" ]]; then
LIBPNG="libpng-dev" LIBPNG="libpng-dev"
else else
LIBPNG="libpng12-dev" LIBPNG="libpng12-dev"
@ -404,10 +404,6 @@ rm -rf /etc/guacamole/extensions/
mkdir -p /etc/guacamole/lib/ mkdir -p /etc/guacamole/lib/
mkdir -p /etc/guacamole/extensions/ mkdir -p /etc/guacamole/extensions/
# Fix for #196
mkdir -p /usr/sbin/.config/freerdp
chown daemon:daemon /usr/sbin/.config/freerdp
# Install guacd (Guacamole-server) # Install guacd (Guacamole-server)
cd guacamole-server-${GUACVERSION}/ cd guacamole-server-${GUACVERSION}/