mirror of
https://github.com/MysticRyuujin/guac-install.git
synced 2023-10-10 13:36:56 +02:00
Patch 0.9.14 + Minor Fixes
Attempts to download and patch `typescript.c` via `cd0e48234a
.patch`
This commit is contained in:
parent
cf620b0616
commit
764dcbd893
@ -13,7 +13,10 @@ RED='\033[0;31m'
|
|||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# Log Location
|
||||||
LOG="/tmp/guacamole_${GUACVERSION}_build.log"
|
LOG="/tmp/guacamole_${GUACVERSION}_build.log"
|
||||||
|
|
||||||
|
# Database Name
|
||||||
DB="guacamole_db"
|
DB="guacamole_db"
|
||||||
|
|
||||||
# Update apt so we can search apt-cache for newest tomcat version supported
|
# Update apt so we can search apt-cache for newest tomcat version supported
|
||||||
@ -91,7 +94,7 @@ then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Unsupported Distro - Ubuntu or Debian Only"
|
echo "Unsupported Distro - Ubuntu or Debian Only"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tomcat 8.0.x is End of Life, however Tomcat 7.x is not...
|
# Tomcat 8.0.x is End of Life, however Tomcat 7.x is not...
|
||||||
@ -105,11 +108,8 @@ fi
|
|||||||
|
|
||||||
# Uncomment to manually force a tomcat version
|
# Uncomment to manually force a tomcat version
|
||||||
#TOMCAT=""
|
#TOMCAT=""
|
||||||
# remove
|
|
||||||
|
|
||||||
#apt-get -y remove ${TOMCAT}
|
|
||||||
# Install features
|
# Install features
|
||||||
|
|
||||||
echo -e "${BLUE}Installing dependencies${NC}"
|
echo -e "${BLUE}Installing dependencies${NC}"
|
||||||
|
|
||||||
apt-get -qq -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavutil-dev \
|
apt-get -qq -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavutil-dev \
|
||||||
@ -125,38 +125,40 @@ ghostscript wget dpkg-dev
|
|||||||
|
|
||||||
# If apt fails to run completely the rest of this isn't going to work...
|
# If apt fails to run completely the rest of this isn't going to work...
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo $-e {FAILED} "apt-get failed to install all required dependencies"
|
echo -e "${RED}apt-get failed to install all required dependencies${NC}"
|
||||||
exit
|
exit 1
|
||||||
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
|
||||||
SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${GUACVERSION}"
|
SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${GUACVERSION}"
|
||||||
echo -e "${BLUE}Downloaded Files...${NC}"
|
echo -e "${BLUE}Downloaded Files...${NC}"
|
||||||
|
|
||||||
# Download Guacamole Server
|
# Download Guacamole Server
|
||||||
wget -q --show-progress -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
|
wget -q --show-progress -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "${RED}Failed to download guacamole-server-${GUACVERSION}.tar.gz"
|
echo -e "${RED}Failed to download guacamole-server-${GUACVERSION}.tar.gz"
|
||||||
echo "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz"
|
echo -e "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz${NC}"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo -e "${GREEN}Downloaded guacamole-server-${GUACVERSION}.tar.gz${NC}"
|
||||||
|
|
||||||
# Download Guacamole Client
|
# Download Guacamole Client
|
||||||
wget -q --show-progress -O guacamole-${GUACVERSION}.war ${SERVER}/binary/guacamole-${GUACVERSION}.war
|
wget -q --show-progress -O guacamole-${GUACVERSION}.war ${SERVER}/binary/guacamole-${GUACVERSION}.war
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed to download guacamole-${GUACVERSION}.war"
|
echo -e "${RED}Failed to download guacamole-${GUACVERSION}.war"
|
||||||
echo "${SERVER}/binary/guacamole-${GUACVERSION}.war"
|
echo -e "${SERVER}/binary/guacamole-${GUACVERSION}.war${NC}"
|
||||||
exit
|
exit 1
|
||||||
echo -e "${GREEN}Downloaded guacamole-${GUACVERSION}.war${COLOREND}"
|
|
||||||
fi
|
fi
|
||||||
|
echo -e "${GREEN}Downloaded guacamole-${GUACVERSION}.war${NC}"
|
||||||
|
|
||||||
# Download Guacamole authentication extensions
|
# Download Guacamole authentication extensions
|
||||||
wget -q --show-progress -O guacamole-auth-jdbc-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz
|
wget -q --show-progress -O guacamole-auth-jdbc-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed to download guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
|
echo -e "${RED}Failed to download guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
|
||||||
echo "${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
|
echo -e "${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo -e "${GREEN}Downloaded guacamole-auth-jdbc-${GUACVERSION}.tar.gz${NC}"
|
||||||
|
|
||||||
echo -e "${GREEN}Downloading complete.${NC}"
|
echo -e "${GREEN}Downloading complete.${NC}"
|
||||||
|
|
||||||
@ -171,8 +173,17 @@ mkdir -p /etc/guacamole/extensions
|
|||||||
# Install guacd
|
# Install guacd
|
||||||
cd guacamole-server-${GUACVERSION}
|
cd guacamole-server-${GUACVERSION}
|
||||||
|
|
||||||
# Hack for gcc7
|
# Patch for Guacamole Server 0.9.14
|
||||||
|
wget -q --show-progress -O ./src/terminal/cd0e48234a079813664052b56c501e854753303a.patch https://github.com/apache/guacamole-server/commit/cd0e48234a079813664052b56c501e854753303a.patch
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${RED}Failed to download cd0e48234a079813664052b56c501e854753303a.patch"
|
||||||
|
echo -e "https://github.com/apache/guacamole-server/commit/cd0e48234a079813664052b56c501e854753303a.patch"
|
||||||
|
echo -e "Attempting to proceed without patch...${NC}"
|
||||||
|
else
|
||||||
|
patch ./src/terminal/typescript.c ./src/terminal/cd0e48234a079813664052b56c501e854753303a.patch
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Hack for gcc7
|
||||||
if [[ $(gcc --version | head -n1 | grep -oP '\)\K.*' | awk '{print $1}' | grep "^7" | wc -l) -gt 0 ]]
|
if [[ $(gcc --version | head -n1 | grep -oP '\)\K.*' | awk '{print $1}' | grep "^7" | wc -l) -gt 0 ]]
|
||||||
then
|
then
|
||||||
echo -e "${BLUE}Building Guacamole with GCC6...${NC}"
|
echo -e "${BLUE}Building Guacamole with GCC6...${NC}"
|
||||||
@ -233,55 +244,53 @@ echo "mysql-hostname: localhost" >> /etc/guacamole/guacamole.properties
|
|||||||
echo "mysql-port: 3306" >> /etc/guacamole/guacamole.properties
|
echo "mysql-port: 3306" >> /etc/guacamole/guacamole.properties
|
||||||
echo "mysql-database: ${DB}" >> /etc/guacamole/guacamole.properties
|
echo "mysql-database: ${DB}" >> /etc/guacamole/guacamole.properties
|
||||||
echo "mysql-username: guacamole_user" >> /etc/guacamole/guacamole.properties
|
echo "mysql-username: guacamole_user" >> /etc/guacamole/guacamole.properties
|
||||||
echo "mysql-password: $guacdbuserpassword" >> /etc/guacamole/guacamole.properties
|
echo "mysql-password: ${guacdbuserpassword}" >> /etc/guacamole/guacamole.properties
|
||||||
|
|
||||||
# restart tomcat
|
# restart tomcat
|
||||||
echo -e "Restarting tomcat..."
|
echo -e "${BLUE}Restarting tomcat...${NC}"
|
||||||
|
|
||||||
service ${TOMCAT} restart
|
service ${TOMCAT} restart
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${RED}Failed${NC}"
|
echo -e "${RED}Failed${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}OK${NC}"
|
echo -e "${GREEN}OK${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create guacamole_db and grant guacamole_user permissions to it
|
# Create guacamole_db and grant guacamole_user permissions to it
|
||||||
|
|
||||||
# SQL code
|
# SQL code
|
||||||
SQLCODE="
|
SQLCODE="
|
||||||
create database ${DB};
|
create database ${DB};
|
||||||
create user 'guacamole_user'@'localhost' identified by \"$guacdbuserpassword\";
|
create user 'guacamole_user'@'localhost' identified by \"${guacdbuserpassword}\";
|
||||||
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
|
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
|
||||||
flush privileges;"
|
flush privileges;"
|
||||||
|
|
||||||
# Execute SQL code
|
# Execute SQL code
|
||||||
echo $SQLCODE | mysql -u root -p$mysqlrootpassword
|
echo ${SQLCODE} | mysql -u root -p${mysqlrootpassword}
|
||||||
|
|
||||||
# Add Guacamole schema to newly created database
|
# Add Guacamole schema to newly created database
|
||||||
echo -e "Adding db tables..."
|
echo -e "Adding db tables..."
|
||||||
|
cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p${mysqlrootpassword} ${DB}
|
||||||
cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword ${DB}
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${RED}Failed${NC}"
|
echo -e "${RED}Failed${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}OK${NC}"
|
echo -e "${GREEN}OK${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure guacd is started
|
# Ensure guacd is started
|
||||||
service guacd start
|
service guacd start
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
echo -e "Cleanup install files..."
|
echo -e "${BLUE}Cleanup install files...${NC}"
|
||||||
|
|
||||||
rm -rf guacamole-*
|
rm -rf guacamole-*
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${RED}Failed${NC}"
|
echo -e "${RED}Failed${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}OK${NC}"
|
echo -e "${GREEN}OK${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "Installation Complete\nhttp://localhost:8080/guacamole/\nDefault login guacadmin:guacadmin\nBe sure to change the password."
|
|
||||||
|
|
||||||
|
echo -e "${BLUE}Installation Complete\nhttp://localhost:8080/guacamole/\nDefault login guacadmin:guacadmin\nBe sure to change the password.${NC}"
|
||||||
|
Loading…
Reference in New Issue
Block a user