diff --git a/README.md b/README.md index 357f3a8..937f98e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ It shall NOT be edited by hand. Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**Shipped version:** 1.5.4~ynh2 +**Shipped version:** 1.5.5~ynh1 ## Screenshots diff --git a/README_es.md b/README_es.md index 91817d2..ce8207f 100644 --- a/README_es.md +++ b/README_es.md @@ -18,7 +18,7 @@ No se debe editar a mano. Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**Versión actual:** 1.5.4~ynh2 +**Versión actual:** 1.5.5~ynh1 ## Capturas diff --git a/README_eu.md b/README_eu.md index 99287c1..91a6fae 100644 --- a/README_eu.md +++ b/README_eu.md @@ -18,7 +18,7 @@ EZ editatu eskuz. Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**Paketatutako bertsioa:** 1.5.4~ynh2 +**Paketatutako bertsioa:** 1.5.5~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index cae4a51..650c11b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**Version incluse :** 1.5.4~ynh2 +**Version incluse :** 1.5.5~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 52795af..10e03c3 100644 --- a/README_gl.md +++ b/README_gl.md @@ -18,7 +18,7 @@ NON debe editarse manualmente. Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**Versión proporcionada:** 1.5.4~ynh2 +**Versión proporcionada:** 1.5.5~ynh1 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md index 399635f..fe2a272 100644 --- a/README_id.md +++ b/README_id.md @@ -18,7 +18,7 @@ Ini TIDAK boleh diedit dengan tangan. Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**Versi terkirim:** 1.5.4~ynh2 +**Versi terkirim:** 1.5.5~ynh1 ## Tangkapan Layar @@ -28,7 +28,7 @@ Guacamole is a clientless remote desktop gateway. It supports standard protocols - Website aplikasi resmi: - Dokumentasi admin resmi: -- Repositori kode aplikasi hulu: +- Depot kode aplikasi hulu: - Gudang YunoHost: - Laporkan bug: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index d82a176..2c56d5a 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -18,7 +18,7 @@ Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH -**分发版本:** 1.5.4~ynh2 +**分发版本:** 1.5.5~ynh1 ## 截图 diff --git a/conf/tomcat.service b/conf/tomcat.service index 1f1e0c9..fd777fe 100644 --- a/conf/tomcat.service +++ b/conf/tomcat.service @@ -1,13 +1,13 @@ [Unit] Description=Apache Tomcat 9 Web Application Server After=network.target -RequiresMountsFor=/var/log/__APP__/tomcat __INSTALL_DIR__/var/lib/tomcat9 +RequiresMountsFor=/var/log/__APP__/tomcat __INSTALL_DIR__/var/lib/__TOMCAT_VERSION__ [Service] # Configuration -Environment="CATALINA_HOME=/usr/share/tomcat9" -Environment="CATALINA_BASE=__INSTALL_DIR__/var/lib/tomcat9" +Environment="CATALINA_HOME=/usr/share/__TOMCAT_VERSION__" +Environment="CATALINA_BASE=__INSTALL_DIR__/var/lib/__TOMCAT_VERSION__" Environment="CATALINA_TMPDIR=/tmp" Environment="JAVA_OPTS=-Djava.awt.headless=true" Environment="GUACAMOLE_HOME=__INSTALL_DIR__/etc/guacamole" @@ -15,13 +15,13 @@ Environment="GUACAMOLE_HOME=__INSTALL_DIR__/etc/guacamole" # Lifecycle Type=simple -ExecStartPre=+/usr/libexec/tomcat9/tomcat-update-policy.sh -ExecStart=/bin/sh /usr/libexec/tomcat9/tomcat-start.sh > /var/log/__APP__/tomcat/tomcat.log 2>&1 +ExecStartPre=+/usr/libexec/__TOMCAT_VERSION__/tomcat-update-policy.sh +ExecStart=/bin/sh /usr/libexec/__TOMCAT_VERSION__/tomcat-start.sh > /var/log/__APP__/tomcat/tomcat.log 2>&1 SuccessExitStatus=143 Restart=on-abort # Logging -SyslogIdentifier=__APP__-tomcat9 +SyslogIdentifier=__APP__-__TOMCAT_VERSION__ # Security User=__APP__-tomcat @@ -29,11 +29,11 @@ Group=__APP__-tomcat PrivateTmp=yes AmbientCapabilities=CAP_NET_BIND_SERVICE NoNewPrivileges=true -CacheDirectory=__APP__-tomcat9 +CacheDirectory=__APP__-__TOMCAT_VERSION__ CacheDirectoryMode=750 ProtectSystem=strict -ReadWritePaths=__INSTALL_DIR__/etc/tomcat9/Catalina/ -ReadWritePaths=__INSTALL_DIR__/var/lib/tomcat9/webapps/ +ReadWritePaths=__INSTALL_DIR__/etc/__TOMCAT_VERSION__/Catalina/ +ReadWritePaths=__INSTALL_DIR__/var/lib/__TOMCAT_VERSION__/webapps/ ReadWritePaths=/var/log/__APP__/tomcat/ [Install] diff --git a/manifest.toml b/manifest.toml index 171f143..9f53082 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Guacamole" description.en = "Clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH" description.fr = "Service de bureau à distance sans client. Fonctionne avec des protocoles standard comme VNC, RDP, et SSH" -version = "1.5.4~ynh2" +version = "1.5.5~ynh1" maintainers = ["Jules Bertholet"] @@ -42,35 +42,33 @@ ram.runtime = "50M" type = "user" [install.init_main_permission] - help.en = "Not recommended" - help.fr = "Pas reccomandé" type = "group" default = "all_users" [resources] [resources.sources] [resources.sources.server] - url = "https://downloads.apache.org/guacamole/1.5.4/source/guacamole-server-1.5.4.tar.gz" - sha256 = "4c0add552b1fc387c23a35c430155e01f2dfcf9daa0f96fbf805d0ace756729e" + url = "https://downloads.apache.org/guacamole/1.5.5/source/guacamole-server-1.5.5.tar.gz" + sha256 = "67499611c2e22d9c933763adc5408e716a4bfd08a3eb8a5ba2fc6f8f70868f6b" [resources.sources.client] - url = "https://downloads.apache.org/guacamole/1.5.4/binary/guacamole-1.5.4.war" - sha256 = "5728b563911bd64bce0a0b81c74ea8ccb2190d1785bff34030fc6885a8273d3e" + url = "https://downloads.apache.org/guacamole/1.5.5/binary/guacamole-1.5.5.war" + sha256 = "4267307f3600663723f24af92d596e99c8359425315135052a42d451f9529200" format = "zip" extract = false rename = "guacamole.war" [resources.sources.auth-header] - url = "https://downloads.apache.org/guacamole/1.5.4/binary/guacamole-auth-header-1.5.4.tar.gz" - sha256 = "7a0adc0daa19ec69a0244f491222c62124b02f81f40aa91e9a94d06a2635d038" + url = "https://downloads.apache.org/guacamole/1.5.5/binary/guacamole-auth-header-1.5.5.tar.gz" + sha256 = "a39ca9563be6d31b4dc1251c76a62baeb2a9d4930b3055e342bb9ce80e526a78" [resources.sources.auth-ldap] - url = "https://downloads.apache.org/guacamole/1.5.4/binary/guacamole-auth-ldap-1.5.4.tar.gz" - sha256 = "f912fe921cd0d429a752709e31a37b931e95d88a47bc4007ab49377d1c1a6336" + url = "https://downloads.apache.org/guacamole/1.5.5/binary/guacamole-auth-ldap-1.5.5.tar.gz" + sha256 = "01d3cd74da5de9da9cc73a788ab2938dd44f5cbe42ad90eebb4bee07f246dfa3" [resources.sources.auth-jdbc] - url = "https://downloads.apache.org/guacamole/1.5.4/binary/guacamole-auth-jdbc-1.5.4.tar.gz" - sha256 = "f45736b28eb6647b7eb0d2b48331e12e5a432661f61115b63d1a05a5bd20244d" + url = "https://downloads.apache.org/guacamole/1.5.5/binary/guacamole-auth-jdbc-1.5.5.tar.gz" + sha256 = "80cca0a02076babad0dc7c76b60daa896f3d9bf10be82708f425fd42ce411393" [resources.sources.mariadb-java-client] url = "https://downloads.mariadb.com/Connectors/java/connector-java-2.7.4/mariadb-java-client-2.7.4.jar" @@ -79,13 +77,6 @@ ram.runtime = "50M" extract = false rename = "mariadb-java-client.jar" - [resources.sources.tomcat9_deb] - url = "https://ftp.debian.org/debian/pool/main/t/tomcat9/tomcat9_9.0.43-2~deb11u10_all.deb" - sha256 = "0dd30fee78ecd3980e9ee3ba018071755ddf84e2288b860900709f1013e368ed" - format = "whatever" - extract = false - rename = "tomcat9.deb" - [resources.ports] main.default = 8080 guacd.default = 4822 @@ -121,7 +112,7 @@ ram.runtime = "50M" "libssl-dev", "libvorbis-dev", "libwebp-dev", - "tomcat9", + "tomcat9\\|tomcat10", ] [resources.database] diff --git a/scripts/_common.sh b/scripts/_common.sh index 11a92d5..7c353d9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,11 @@ # COMMON VARIABLES #================================================= -guacamole_version="1.5.4" +if [ "$YNH_DEBIAN_VERSION" == "bullseye" ] ; then + tomcat_version="tomcat9" +elif [ "$YNH_DEBIAN_VERSION" == "bookworm" ] ; then + tomcat_version="tomcat10" +fi #================================================= # PERSONAL HELPERS @@ -14,25 +18,29 @@ function setup_sources { ynh_setup_source --source_id="server" --dest_dir="$install_dir/.guacd-src" tomcat_guac_dir="$path" - if [ "$path" == "/" -o -z "$path" ]; then + if [ "$path" == "/" ]; then tomcat_guac_dir="ROOT" fi - ynh_setup_source --source_id="tomcat9_deb" --dest_dir="$install_dir/downloads/tomcat9" - pushd "$install_dir/downloads/tomcat9" || ynh_die - ar x "tomcat9.deb" "data.tar.xz" + mkdir -p $install_dir/downloads/$tomcat_version + pushd "$install_dir/downloads/$tomcat_version" + apt-get download $tomcat_version + # Gotta use eval such that the wildcard works zbgmpf + eval "mv tomcat*.deb tomcat.deb" + ar x "tomcat.deb" "data.tar.xz" tar xJf data.tar.xz - popd || ynh_die + popd mkdir -p "$install_dir/etc" - cp -r "$install_dir/downloads/tomcat9/usr/share/tomcat9/etc" -T "$install_dir/etc/tomcat9/" - cp -r "$install_dir/downloads/tomcat9/etc/tomcat9/" -T "$install_dir/etc/tomcat9/" + cp -r "$install_dir/downloads/$tomcat_version/usr/share/$tomcat_version/etc" -T "$install_dir/etc/$tomcat_version/" + cp -r "$install_dir/downloads/$tomcat_version/etc/$tomcat_version/" -T "$install_dir/etc/$tomcat_version/" ynh_setup_source --source_id="client" --dest_dir="$install_dir/downloads" - mkdir -p "$install_dir/var/lib/tomcat9/webapps" - mv "$install_dir/downloads/guacamole.war" "$install_dir/var/lib/tomcat9/webapps/$tomcat_guac_dir.war" + mkdir -p "$install_dir/var/lib/$tomcat_version/webapps" + mv "$install_dir/downloads/guacamole.war" "$install_dir/var/lib/$tomcat_version/webapps/$tomcat_guac_dir.war" mkdir -p "$install_dir/etc/guacamole/extensions" + guacamole_version="$(ynh_app_upstream_version)" ynh_setup_source --source_id="auth-ldap" --dest_dir="$install_dir/downloads/auth-ldap" mv "$install_dir/downloads/auth-ldap/guacamole-auth-ldap-$guacamole_version.jar" "$install_dir/etc/guacamole/extensions/guacamole-auth-ldap.jar" @@ -55,19 +63,11 @@ function _set_permissions() { setfacl -n -R -m "user:$app-guacd:rx" -m "default:user:$app-guacd:rx" "$install_dir" setfacl -n -R -m "user:$app-tomcat:rx" -m "default:user:$app-tomcat:rx" "$install_dir" - # chown -R nobody:$app-tomcat "$install_dir/etc/tomcat9/" "$install_dir/etc/guacamole/" - chown -R "$app-tomcat":"$app-tomcat" "$install_dir/var/lib/tomcat9/webapps" + # chown -R nobody:$app-tomcat "$install_dir/etc/$tomcat_version/" "$install_dir/etc/guacamole/" + chown -R "$app-tomcat":"$app-tomcat" "$install_dir/var/lib/$tomcat_version/webapps" setfacl -n -R -m "user:$app-guacd:-" -m "default:user:$app-guacd:-" \ - "$install_dir/var/lib/tomcat9/" "$install_dir/etc/guacamole/" "$install_dir/etc/tomcat9/" + "$install_dir/var/lib/$tomcat_version/" "$install_dir/etc/guacamole/" "$install_dir/etc/$tomcat_version/" chown -R "$app-guacd:$app-guacd" "/var/log/$app/guacd/" chown -R "$app-tomcat:$app-tomcat" "/var/log/$app/tomcat/" } - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= diff --git a/scripts/change_url b/scripts/change_url index cb11768..b65c972 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -44,7 +44,7 @@ if [ $change_path -eq 1 ]; then new_path_tomcat="ROOT" fi - mv "$install_dir/var/lib/tomcat9/webapps/$old_path_tomcat" "$install_dir/var/lib/tomcat9/webapps/$new_path_tomcat" + mv "$install_dir/var/lib/$tomcat_version/webapps/$old_path_tomcat" "$install_dir/var/lib/$tomcat_version/webapps/$new_path_tomcat" fi #================================================= diff --git a/scripts/install b/scripts/install index bdc9698..edda8a2 100755 --- a/scripts/install +++ b/scripts/install @@ -17,23 +17,11 @@ ynh_script_progression --message="Stopping system tomcat..." --weight=1 # Guacamole depends on Apache Tomcat. # But installing Tomcat from the Debian repos automatically enables and starts it. # So we stop and disable it, unless Tomcat was already enabled or started by the user beforehand - -tomcat_enabled="" -tomcat_active="" -if [ "$(systemctl cat tomcat9 --quiet)" ]; then - if (systemctl is-enabled tomcat9 --quiet); then - tomcat_enabled=1 - fi - if (systemctl is-active tomcat9 --quiet); then - tomcat_active=1 - fi +if systemctl is-enabled $tomcat_version --quiet 2>/dev/null; then + systemctl disable $tomcat_version --quiet fi - -if [ $tomcat_enabled ]; then - systemctl disable tomcat9 --quiet -fi -if [ $tomcat_active ]; then - systemctl stop tomcat9 --quiet +if systemctl is-active $tomcat_version --quiet 2>/dev/null; then + systemctl stop $tomcat_version --quiet fi #================================================= @@ -55,9 +43,9 @@ setup_sources mkdir -p "/var/log/$app/tomcat/" "/var/log/$app/guacd/" "/var/log/$app/tomcat/" mkdir -p "$install_dir/etc/" -ln -s -f "$install_dir/etc/tomcat9" "$install_dir/var/lib/tomcat9/conf" -ln -s -f "/var/log/$app/tomcat/" "$install_dir/var/lib/tomcat9/logs" -ln -s -f "/var/cache/$app-tomcat9" "$install_dir/var/lib/tomcat9/work" +ln -s -f "$install_dir/etc/$tomcat_version" "$install_dir/var/lib/$tomcat_version/conf" +ln -s -f "/var/log/$app/tomcat/" "$install_dir/var/lib/$tomcat_version/logs" +ln -s -f "/var/cache/$app-$tomcat_version" "$install_dir/var/lib/$tomcat_version/work" #================================================= # ADD CONFIGURATIONS @@ -65,7 +53,7 @@ ln -s -f "/var/cache/$app-tomcat9" "$install_dir/var/lib/tomcat9/work" ynh_add_config --template="guacamole.properties" --destination="$install_dir/etc/guacamole/guacamole.properties" -ynh_replace_string --match_string="8080" --replace_string="$port" --target_file="$install_dir/etc/tomcat9/server.xml" +ynh_replace_string --match_string="8080" --replace_string="$port" --target_file="$install_dir/etc/$tomcat_version/server.xml" _set_permissions diff --git a/scripts/remove b/scripts/remove index 7b10ee8..16ba247 100755 --- a/scripts/remove +++ b/scripts/remove @@ -39,7 +39,6 @@ ynh_remove_fail2ban_config #================================================= # Remove the log files -ynh_secure_remove --file="/var/log/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index 7dcd68e..983c00c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,22 +15,11 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping system tomcat..." --weight=1 -tomcat_enabled="" -tomcat_active="" -if [ "$(systemctl cat tomcat9 --quiet)" ]; then - if (systemctl is-enabled tomcat9 --quiet); then - tomcat_enabled=1 - fi - if (systemctl is-active tomcat9 --quiet); then - tomcat_active=1 - fi +if systemctl is-enabled $tomcat_version --quiet 2>/dev/null; then + systemctl disable $tomcat_version --quiet fi - -if [ ! $tomcat_enabled ]; then - systemctl disable tomcat9 --quiet -fi -if [ ! $tomcat_active ]; then - systemctl stop tomcat9 --quiet +if systemctl is-active $tomcat_version --quiet 2>/dev/null; then + systemctl stop $tomcat_version --quiet fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 63ed75e..f2dbd7d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,23 +62,11 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=1 # Guacamole depends on Apache Tomcat. # But installing Tomcat from the Debian repos automatically enables and starts it. # So we stop and disable it, unless Tomcat was already enabled or started by the user beforehand - -tomcat_enabled="" -tomcat_active="" -if [ "$(systemctl cat tomcat9 --quiet)" ]; then - if (systemctl is-enabled tomcat9 --quiet); then - tomcat_enabled=1 - fi - if (systemctl is-active tomcat9 --quiet); then - tomcat_active=1 - fi +if systemctl is-enabled $tomcat_version --quiet 2>/dev/null; then + systemctl disable $tomcat_version --quiet fi - -if [ ! $tomcat_enabled ]; then - systemctl disable tomcat9 --quiet -fi -if [ ! $tomcat_active ]; then - systemctl stop tomcat9 --quiet +if systemctl is-active $tomcat_version --quiet 2>/dev/null; then + systemctl stop $tomcat_version --quiet fi #================================================= @@ -99,9 +87,9 @@ popd #================================================= mkdir -p "$install_dir/etc/" -ln -s -f "$install_dir/etc/tomcat9" "$install_dir/var/lib/tomcat9/conf" -ln -s -f "/var/log/$app/tomcat/" "$install_dir/var/lib/tomcat9/logs" -ln -s -f "/var/cache/$app-tomcat9" "$install_dir/var/lib/tomcat9/work" +ln -s -f "$install_dir/etc/$tomcat_version" "$install_dir/var/lib/$tomcat_version/conf" +ln -s -f "/var/log/$app/tomcat/" "$install_dir/var/lib/$tomcat_version/logs" +ln -s -f "/var/cache/$app-$tomcat_version" "$install_dir/var/lib/$tomcat_version/work" #================================================= # CREATE LOG DIRS @@ -115,7 +103,7 @@ mkdir -p "/var/log/$app/tomcat/" "/var/log/$app/guacd/" "/var/log/$app/tomcat/" ynh_add_config --template="guacamole.properties" --destination="$install_dir/etc/guacamole/guacamole.properties" -ynh_replace_string --match_string="8080" --replace_string="$port" --target_file="$install_dir/etc/tomcat9/server.xml" +ynh_replace_string --match_string="8080" --replace_string="$port" --target_file="$install_dir/etc/$tomcat_version/server.xml" #================================================= # SETUP SYSTEMD