2021-03-19 04:09:26 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2022-01-06 21:04:45 +01:00
|
|
|
function setup_sources {
|
2023-12-19 08:35:54 +01:00
|
|
|
guacamole_version="1.5.4"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="server" --dest_dir="$install_dir/.guacd-src"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
tomcat_guac_dir="$path"
|
|
|
|
if [ "$path" == "/" -o -z "$path" ]; then
|
2022-01-06 21:04:45 +01:00
|
|
|
tomcat_guac_dir="ROOT"
|
|
|
|
fi
|
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="client" --dest_dir="$install_dir/var/lib/tomcat9/webapps/$tomcat_guac_dir"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="auth-ldap" --dest_dir="$install_dir/etc/guacamole/extensions/ldap"
|
2023-06-05 14:35:50 +02:00
|
|
|
mv "$install_dir/etc/guacamole/extensions/ldap/guacamole-auth-ldap-$guacamole_version.jar" "$install_dir/etc/guacamole/extensions/guacamole-auth-ldap.jar"
|
2023-05-29 17:23:44 +02:00
|
|
|
ynh_secure_remove --file="$install_dir/etc/guacamole/extensions/ldap"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="auth-header" --dest_dir="$install_dir/etc/guacamole/extensions/header"
|
2023-06-05 14:35:50 +02:00
|
|
|
mv "$install_dir/etc/guacamole/extensions/header/guacamole-auth-header-$guacamole_version.jar" "$install_dir/etc/guacamole/extensions/guacamole-auth-header.jar"
|
2023-05-29 17:24:13 +02:00
|
|
|
ynh_secure_remove --file="$install_dir/etc/guacamole/extensions/header"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="auth-jdbc" --dest_dir="$install_dir/etc/guacamole/extensions/jdbc"
|
2023-06-05 14:35:50 +02:00
|
|
|
mv "$install_dir/etc/guacamole/extensions/jdbc/mysql/guacamole-auth-jdbc-mysql-$guacamole_version.jar" "$install_dir/etc/guacamole/extensions/guacamole-auth-jdbc-mysql.jar"
|
2023-05-29 17:10:43 +02:00
|
|
|
mv "$install_dir/etc/guacamole/extensions/jdbc/mysql/schema" "$install_dir/etc/guacamole/extensions/mysql-schema"
|
2023-05-29 17:23:44 +02:00
|
|
|
ynh_secure_remove --file="$install_dir/etc/guacamole/extensions/jdbc"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="mariadb-java-client" --dest_dir="$install_dir/etc/guacamole/lib/"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_setup_source --source_id="tomcat9_deb" --dest_dir="$install_dir/"
|
2022-01-06 21:04:45 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
pushd "$install_dir" || ynh_die
|
|
|
|
ar x "$install_dir/tomcat9.deb" "data.tar.xz"
|
2022-01-06 21:04:45 +01:00
|
|
|
popd || ynh_die
|
|
|
|
|
2023-05-29 17:23:44 +02:00
|
|
|
ynh_secure_remove --file="$install_dir/tomcat9.deb"
|
2023-05-29 17:10:43 +02:00
|
|
|
mkdir -p "$install_dir/tomcat9-data"
|
|
|
|
tar -C "$install_dir/tomcat9-data" -xJf "$install_dir/data.tar.xz"
|
|
|
|
cp -r "$install_dir/tomcat9-data/usr/share/tomcat9/etc" -T "$install_dir/etc/tomcat9/"
|
|
|
|
cp -r "$install_dir/tomcat9-data/etc/tomcat9/" -T "$install_dir/etc/tomcat9/"
|
2023-05-29 17:23:44 +02:00
|
|
|
ynh_secure_remove --file="$install_dir/data.tar.xz"
|
|
|
|
ynh_secure_remove --file="$install_dir/tomcat9-data"
|
2022-01-06 21:04:45 +01:00
|
|
|
}
|
|
|
|
|
2021-03-19 04:09:26 +01:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|