From c3ad79d402dde5e380c08b10439e97ccb7bd5d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Apr 2023 19:09:18 +0200 Subject: [PATCH 01/13] v2 --- conf/mumble-server.ini | 2 +- conf/systemd.service | 4 +-- manifest.toml | 55 ++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 10 +++---- scripts/install | 48 +++++++++++++++---------------- scripts/remove | 18 ++++++------ scripts/restore | 28 +++++++++--------- scripts/upgrade | 64 +++++++++++++++++++++--------------------- 9 files changed, 143 insertions(+), 88 deletions(-) create mode 100644 manifest.toml diff --git a/conf/mumble-server.ini b/conf/mumble-server.ini index 921fd80..9929e2f 100644 --- a/conf/mumble-server.ini +++ b/conf/mumble-server.ini @@ -13,7 +13,7 @@ ; Path to database. If blank, will search for ; murmur.sqlite in default locations or create it if not found. -database=__FINALPATH__/mumble-server.sqlite +database=__INSTALL_DIR__/mumble-server.sqlite ; Murmur defaults to using SQLite with its default rollback journal. ; In some situations, using SQLite's write-ahead log (WAL) can be diff --git a/conf/systemd.service b/conf/systemd.service index 8079600..32d9edf 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ User=mumble-server Group=mumble-server Type=forking RuntimeDirectory=mumble-server -ExecStart=/usr/sbin/murmurd -ini __FINALPATH__/mumble-server.ini +ExecStart=/usr/sbin/murmurd -ini __INSTALL_DIR__/mumble-server.ini PIDFile=/var/run/mumble-server/__APP__.pid ExecReload=/bin/kill -s HUP $MAINPID PrivateDevices=true @@ -17,7 +17,7 @@ ProtectHome=true ProtectSystem=strict ProtectControlGroups=yes ProtectKernelModules=yes -ReadWritePaths=__FINALPATH__ /var/log/mumble-server /var/run/mumble-server +ReadWritePaths=__INSTALL_DIR__ /var/log/mumble-server /var/run/mumble-server [Install] WantedBy=multi-user.target diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..c504a14 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,55 @@ +packaging_format = 2 + +id = "mumbleserver" +name = "Mumble Server" +description.en = "Low-latency, high quality voice chat software (VoIP)" +description.fr = "Logiciel libre de voix sur IP (VoIP)" + +version = "1.3.4~ynh1" + +maintainers = [] + +[upstream] +license = "BSD-3-Clause" +website = "https://mumble.info" +admindoc = "https://wiki.mumble.info/wiki/Main_Page" +code = "https://github.com/mumble-voip/mumble" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + full_domain = true + + [install.welcometext] + ask.en = "Choose a welcome text for your server" + ask.fr = "Choisissez un message de bienvenue pour le serveur" + type = "string" + example = "Welcome to my Mumble server" + default = "Welcome" + + [install.registername] + ask.en = "Choose a name for the root channel (your Mumble server name)" + ask.fr = "Entrez un nom pour le channel racine (le nom de votre serveur Mumble)" + type = "string" + example = "Root" + default = "Root" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] diff --git a/scripts/_common.sh b/scripts/_common.sh index f37c864..85d6e25 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="mumble-server mailutils" +#REMOVEME? pkg_dependencies="mumble-server mailutils" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 2850990..d7f8488 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,16 +15,16 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -35,7 +35,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP SYSTEMD diff --git a/scripts/install b/scripts/install index 6fb3fda..9d45558 100644 --- a/scripts/install +++ b/scripts/install @@ -15,22 +15,22 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -welcometext=$YNH_APP_ARG_WELCOMETEXT -registername=$YNH_APP_ARG_REGISTERNAME +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? welcometext=$YNH_APP_ARG_WELCOMETEXT +#REMOVEME? registername=$YNH_APP_ARG_REGISTERNAME instance_id=$YNH_APP_INSTANCE_NUMBER -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME server_password=$(ynh_string_random) su_passwd=$(ynh_string_random) @@ -38,20 +38,20 @@ su_passwd=$(ynh_string_random) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 # Save app settings -ynh_app_setting_set --app=$app --key=domain --value="$domain" +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value="$domain" ynh_app_setting_set --app=$app --key=no_sso --value="true" -ynh_app_setting_set --app=$app --key=server_password --value="$server_password" +#REMOVEME? ynh_app_setting_set --app=$app --key=server_password --value="$server_password" ynh_app_setting_set --app=$app --key=su_passwd --value="$su_passwd" ynh_app_setting_set --app=$app --key=welcometext --value="$welcometext" ynh_app_setting_set --app=$app --key=registername --value="$registername" @@ -62,11 +62,11 @@ ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id" #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=64738) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=64738) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port # Open the port ynh_script_progression --message="Configuring firewall..." --weight=1 @@ -75,9 +75,9 @@ ynh_exec_warn_less yunohost firewall allow Both $port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=4 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=4 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC SETUP @@ -86,16 +86,16 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Adding a configuration file..." -mkdir -p "$final_path" -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +mkdir -p "$install_dir" +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Configuring with given settings -mumble_conf="$final_path/mumble-server.ini" +mumble_conf="$install_dir/mumble-server.ini" ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf" -chmod -R 770 "$final_path" -chown -R :mumble-server "$final_path" +chmod -R 770 "$install_dir" +chown -R :mumble-server "$install_dir" #================================================= # ADD USER TO SSL-CERT @@ -153,11 +153,11 @@ Password to join server: $server_password SuperUser Password : $su_passwd Welcome text : $welcometext Root channel (your Mumble server name): $registername -Final path (where to find your files) : $final_path +Final path (where to find your files) : $install_dir Mumble configuration file : $mumble_conf Note about config file: this package will regenerate the config file on upgrade. -If you changed it manually and upgrade mumble, you'll find a backup in $final_path. +If you changed it manually and upgrade mumble, you'll find a backup in $install_dir. Are you facing an issue, want to improve this app or say thank you? Please open a new issue in this project: https://github.com/YunoHost-Apps/mumbleserver_ynh diff --git a/scripts/remove b/scripts/remove index b62bf3d..4cd7e18 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE @@ -44,18 +44,18 @@ ynh_remove_systemd_config #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # CLOSE A PORT diff --git a/scripts/restore b/scripts/restore index 15ada36..b558222 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,29 +14,29 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS @@ -45,25 +45,25 @@ test ! -d $final_path \ #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=2 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=4 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=4 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE USER RIGHTS #================================================= # Restore permissions on app files -chmod -R 770 "$final_path" -chown -R :mumble-server "$final_path" +chmod -R 770 "$install_dir" +chown -R :mumble-server "$install_dir" #================================================= # Add user to ssl-cert so it can read certificates diff --git a/scripts/upgrade b/scripts/upgrade index 557f6cd..1966d3c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,19 +12,19 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -no_sso=$(ynh_app_setting_get --app=$app --key=no_sso) -server_password=$(ynh_app_setting_get --app=$app --key=server_password) -su_passwd=$(ynh_app_setting_get --app=$app --key=su_passwd) -welcometext=$(ynh_app_setting_get --app=$app --key=welcometext) -registername=$(ynh_app_setting_get --app=$app --key=registername) -port=$(ynh_app_setting_get --app=$app --key=port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -instance_id=$(ynh_app_setting_get --app=$app --key=instance_id) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? no_sso=$(ynh_app_setting_get --app=$app --key=no_sso) +#REMOVEME? server_password=$(ynh_app_setting_get --app=$app --key=server_password) +#REMOVEME? su_passwd=$(ynh_app_setting_get --app=$app --key=su_passwd) +#REMOVEME? welcometext=$(ynh_app_setting_get --app=$app --key=welcometext) +#REMOVEME? registername=$(ynh_app_setting_get --app=$app --key=registername) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? instance_id=$(ynh_app_setting_get --app=$app --key=instance_id) #================================================= # CHECK VERSION @@ -36,17 +36,17 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -62,10 +62,10 @@ ynh_systemd_action --service_name=$app --action="stop" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set "$app" final_path "$final_path" +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set "$app" install_dir "$install_dir" fi # test old time @@ -92,11 +92,11 @@ if [ -z "$server_password" ]; then | head -1 \ | sed -r "s/.* (([a-z])*\.([a-z])*).*/\1/g") - ynh_app_setting_set --app=$app --key=server_password --value=$server_password +#REMOVEME? ynh_app_setting_set --app=$app --key=server_password --value=$server_password ynh_app_setting_set --app=$app --key=welcometext --value=$welcometext ynh_app_setting_set --app=$app --key=registername --value=$registername ynh_app_setting_set --app=$app --key=su_passwd --value=$su_passwd - ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain systemctl stop mumble-server dpkg-reconfigure mumble-server --frontend=Noninteractive @@ -107,8 +107,8 @@ fi # Fix SSO issue # https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19 if [ -z "$domain" ]; then - domain=$(ynh_app_setting_get "$app" domain_mumble) - ynh_app_setting_set "$app" domain "$domain" +#REMOVEME? domain=$(ynh_app_setting_get "$app" domain_mumble) +#REMOVEME? ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_delete "$app" domain_mumble fi @@ -125,7 +125,7 @@ if [ -z "$instance_id" ]; then fi if [ -z "$registername" ]; then - registername=$(ynh_app_setting_get "$app" registerName) +#REMOVEME? registername=$(ynh_app_setting_get "$app" registerName) ynh_app_setting_set "$app" registername "$registername" ynh_app_setting_delete "$app" registerName fi @@ -133,9 +133,9 @@ fi #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=6 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=6 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC UPGRADE @@ -144,15 +144,15 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -mkdir -p $final_path +mkdir -p $install_dir # Configuring with given settings -mumble_conf="$final_path/mumble-server.ini" +mumble_conf="$install_dir/mumble-server.ini" ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf" -chmod -R 770 "$final_path" -chown -R :mumble-server "$final_path" +chmod -R 770 "$install_dir" +chown -R :mumble-server "$install_dir" #================================================= # Add user to ssl-cert so it can read certificates @@ -212,7 +212,7 @@ Password to join server: $server_password SuperUser Password : $su_passwd Welcome text : $welcometext Root channel (your Mumble server name): $registername -Final path (where to find your files) : $final_path +Final path (where to find your files) : $install_dir Mumble configuration file : $mumble_conf Note about config file: this package will regenerate the config file on upgrade. From 449b52a356406ba744599e6560891612667ecf21 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 7 Apr 2023 17:09:23 +0000 Subject: [PATCH 02/13] Auto-update README --- README.md | 4 ++-- README_fr.md | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 94a41dc..0d6e483 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Mumble Server for YunoHost -[![Integration level](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) ![Working status](https://ci-apps.yunohost.org/ci/badges/mumbleserver.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mumbleserver.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) ![Working status](https://ci-apps.yunohost.org/ci/badges/mumbleserver.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mumbleserver.maintain.svg) + [![Install Mumble Server with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mumbleserver) *[Lire ce readme en français.](./README_fr.md)* @@ -20,7 +21,6 @@ Mumble is a free, open source, low latency, high quality voice chat application. **Shipped version:** 1.3.4~ynh1 - ## Screenshots ![Screenshot of Mumble Server](./doc/screenshots/Mumble.png) diff --git a/README_fr.md b/README_fr.md index 6100c04..1908b82 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,24 +5,24 @@ It shall NOT be edited by hand. # Mumble Server pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mumbleserver.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mumbleserver.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mumbleserver.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mumbleserver.maintain.svg) + [![Installer Mumble Server avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mumbleserver) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Mumble Server rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Mumble Server rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Mumble est une application de chat vocal gratuite, open source, à faible latence et de haute qualité. Mumble a été la première application VoIP à établir une véritable communication vocale à faible latence il y a plus de dix ans. Mais la faible latence et le jeu ne sont pas les seuls cas d'utilisation dans lesquels il brille. -**Version incluse :** 1.3.4~ynh1 +**Version incluse :** 1.3.4~ynh1 +## Captures d’écran -## Captures d'écran - -![Capture d'écran de Mumble Server](./doc/screenshots/Mumble.png) +![Capture d’écran de Mumble Server](./doc/screenshots/Mumble.png) ## Avertissements / informations importantes @@ -40,9 +40,9 @@ Si vous devez changer le mot de passe du serveur/superutilisateur ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -58,4 +58,4 @@ ou sudo yunohost app upgrade mumbleserver -u https://github.com/YunoHost-Apps/mumbleserver_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From 30b897d58055416beeebc9ad546bc76cbdfa42a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Apr 2023 19:24:39 +0200 Subject: [PATCH 03/13] v2 --- doc/POST_INSTALL.md | 10 +++++++++ manifest.toml | 25 ++++++++++++--------- scripts/_common.sh | 3 --- scripts/backup | 16 -------------- scripts/install | 53 ++------------------------------------------- scripts/restore | 38 -------------------------------- scripts/upgrade | 46 --------------------------------------- 7 files changed, 27 insertions(+), 164 deletions(-) create mode 100644 doc/POST_INSTALL.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..2463654 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,10 @@ +Port : __PORT__ +Password to join server: __SERVER_PASSWORD__ +SuperUser Password : __SU_PASSWD__ +Welcome text : __WELCOMETEXT__ +Root channel (your Mumble server name): __REGISTERNAME__ +Final path (where to find your files) : __INSTALL_DIR__ +Mumble configuration file : __MUMBLE_CONF__ + +Note about config file: this package will regenerate the config file on upgrade. +If you changed it manually and upgrade mumble, you'll find a backup in __INSTALL_DIR__. diff --git a/manifest.toml b/manifest.toml index c504a14..0462186 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,22 +14,19 @@ license = "BSD-3-Clause" website = "https://mumble.info" admindoc = "https://wiki.mumble.info/wiki/Main_Page" code = "https://github.com/mumble-voip/mumble" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.17" +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" full_domain = true @@ -48,8 +45,16 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = "Root" [resources] + + [resources.ports] + main.default = 64738 + main.exposed = "Both" + [resources.system_user] [resources.install_dir] [resources.permissions] + + [resources.apt] + packages = "mumble-server mailutils" diff --git a/scripts/_common.sh b/scripts/_common.sh index 85d6e25..90e0dd3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="mumble-server mailutils" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index d7f8488..ac5b947 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,22 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index 9d45558..39c7498 100644 --- a/scripts/install +++ b/scripts/install @@ -11,74 +11,25 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? welcometext=$YNH_APP_ARG_WELCOMETEXT -#REMOVEME? registername=$YNH_APP_ARG_REGISTERNAME -instance_id=$YNH_APP_INSTANCE_NUMBER - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - server_password=$(ynh_string_random) su_passwd=$(ynh_string_random) -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 +ynh_script_progression --message="Storing installation settings..." --weight=2 -# Save app settings -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value="$domain" ynh_app_setting_set --app=$app --key=no_sso --value="true" -#REMOVEME? ynh_app_setting_set --app=$app --key=server_password --value="$server_password" +REMOVEME? ynh_app_setting_set --app=$app --key=server_password --value="$server_password" ynh_app_setting_set --app=$app --key=su_passwd --value="$su_passwd" ynh_app_setting_set --app=$app --key=welcometext --value="$welcometext" ynh_app_setting_set --app=$app --key=registername --value="$registername" ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id" -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=64738) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -# Open the port -ynh_script_progression --message="Configuring firewall..." --weight=1 -ynh_exec_warn_less yunohost firewall allow Both $port - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=4 - -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/restore b/scripts/restore index b558222..cceb9fb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,34 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -47,16 +19,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=4 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE USER RIGHTS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1966d3c..dc535b0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,45 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? no_sso=$(ynh_app_setting_get --app=$app --key=no_sso) -#REMOVEME? server_password=$(ynh_app_setting_get --app=$app --key=server_password) -#REMOVEME? su_passwd=$(ynh_app_setting_get --app=$app --key=su_passwd) -#REMOVEME? welcometext=$(ynh_app_setting_get --app=$app --key=welcometext) -#REMOVEME? registername=$(ynh_app_setting_get --app=$app --key=registername) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? instance_id=$(ynh_app_setting_get --app=$app --key=instance_id) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -62,12 +29,6 @@ ynh_systemd_action --service_name=$app --action="stop" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set "$app" install_dir "$install_dir" -fi - # test old time if [ -z "$server_password" ]; then old_mumble_conf="/etc/mumble-server.ini" @@ -130,13 +91,6 @@ if [ -z "$registername" ]; then ynh_app_setting_delete "$app" registerName fi -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=6 - -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - #================================================= # SPECIFIC UPGRADE #================================================= From 64d241146a7788e80091c0f625f91a685c8690bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 13:32:59 +0100 Subject: [PATCH 04/13] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index aed4e25..c930fe1 100644 --- a/manifest.json +++ b/manifest.json @@ -24,7 +24,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 11.0.9" + "yunohost": ">= 11.2" }, "multi_instance": true, "services": [ From 6155c827d943e154cae3391b264a3d35a686f661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 13:40:57 +0100 Subject: [PATCH 05/13] v2 --- doc/{DISCLAIMER.md => ADMIN.md} | 2 +- doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 2 +- manifest.json | 60 -------------------------- manifest.toml | 8 ++-- scripts/_common.sh | 62 --------------------------- scripts/install | 31 +------------- scripts/remove | 42 ------------------ scripts/upgrade | 34 +-------------- tests.toml | 16 +++++++ 9 files changed, 25 insertions(+), 232 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (89%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (90%) delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 89% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index 5372115..c80f615 100644 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -6,6 +6,6 @@ This package installs the Debian package and configures it with given settings. ## Config If you need to change password of the server/superuser -1- edit `/var/www/mumbleserver/mumble-server.ini` +1- edit `__INSTALL_DIR__/mumble-server.ini` 2- remove (or change) the password for serverpassword= 3- restart mumbleserver diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 90% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md index d8612db..aef7804 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/ADMIN_fr.md @@ -6,6 +6,6 @@ mumbleserver_ynh installe le paquet Debian et le configure avec les paramètres ## Configuration Si vous devez changer le mot de passe du serveur/superutilisateur -1- éditez `/var/www/mumbleserver/mumble-server.ini` +1- éditez `__INSTALL_DIR__/mumble-server.ini` 2- supprimer (ou changer) le mot de passe pour serverpassword= 3- redémarrer mumbleserver diff --git a/manifest.json b/manifest.json deleted file mode 100644 index aed4e25..0000000 --- a/manifest.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "Mumble Server", - "id": "mumbleserver", - "packaging_format": 1, - "description": { - "en": "Low-latency, high quality voice chat software (VoIP)", - "fr": "Logiciel libre de voix sur IP (VoIP)" - }, - "version": "1.3.4~ynh1", - "url": "https://mumble.info", - "upstream": { - "license": "BSD-3-Clause", - "website": "https://mumble.info", - "admindoc": "https://wiki.mumble.info/wiki/Main_Page", - "code": "https://github.com/mumble-voip/mumble" - }, - "license": "BSD-3-Clause", - "maintainer": { - "name": "", - "email": "" - }, - "previous_maintainers": [{ - "name": "Jean-Baptiste Holcroft", - "email": "jean-baptiste@holcroft.fr" - }], - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "welcometext", - "type": "string", - "ask": { - "en": "Choose a welcome text for your server", - "fr": "Choisissez un message de bienvenue pour le serveur" - }, - "example": "Welcome to my Mumble server", - "default": "Welcome" - }, - { - "name": "registername", - "type": "string", - "ask": { - "en": "Choose a name for the root channel (your Mumble server name)", - "fr": "Entrez un nom pour le channel racine (le nom de votre serveur Mumble)" - }, - "example": "Root", - "default": "Root" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 0462186..686cb64 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,11 +16,14 @@ admindoc = "https://wiki.mumble.info/wiki/Main_Page" code = "https://github.com/mumble-voip/mumble" [integration] -yunohost = ">= 11.1.17" +yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = "not_relevant" + sso = "not_relevant" + disk = "50M" ram.build = "50M" ram.runtime = "50M" @@ -28,7 +31,6 @@ ram.runtime = "50M" [install] [install.domain] type = "domain" - full_domain = true [install.welcometext] ask.en = "Choose a welcome text for your server" @@ -57,4 +59,4 @@ ram.runtime = "50M" [resources.permissions] [resources.apt] - packages = "mumble-server mailutils" + packages = "mumble-server, mailutils" diff --git a/scripts/_common.sh b/scripts/_common.sh index 90e0dd3..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,65 +15,3 @@ #================================================= # FUTURE OFFICIAL HELPERS #================================================= - - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin app_message [recipients] -# | arg: app_message - The message to send to the administrator. -# | arg: recipients - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -ynh_send_readme_to_admin() { - local app_message="${1:-...No specific information...}" - local recipients="${2:-root}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!" - - local mail_message="This is an automated message from your beloved YunoHost server. - -Specific information for the application $app. - -$app_message - ---- -Automatic diagnosis data from YunoHost - -$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" - - # Define binary to use for mail command - if [ -e /usr/bin/bsd-mailx ] - then - local mail_bin=/usr/bin/bsd-mailx - else - local mail_bin=/usr/bin/mail.mailutils - fi - - # Send the email to the recipients - echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" -} diff --git a/scripts/install b/scripts/install index 39c7498..a32a622 100644 --- a/scripts/install +++ b/scripts/install @@ -38,12 +38,11 @@ ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id" ynh_script_progression --message="Adding a configuration file..." mkdir -p "$install_dir" -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Configuring with given settings mumble_conf="$install_dir/mumble-server.ini" -ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf" +ynh_add_config --template="mumble-server.ini" --destination="$mumble_conf" chmod -R 770 "$install_dir" chown -R :mumble-server "$install_dir" @@ -78,13 +77,6 @@ ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - yunohost service add $app --description="Mumble server" --log="/var/log/mumble-server/$app.log" --needs_exposed_ports="$port" #================================================= @@ -94,27 +86,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/mumble-server/$app.log" -#================================================= -# SEND README TO ADMIN -#================================================= - -message=" -Port : $port -Password to join server: $server_password -SuperUser Password : $su_passwd -Welcome text : $welcometext -Root channel (your Mumble server name): $registername -Final path (where to find your files) : $install_dir -Mumble configuration file : $mumble_conf - -Note about config file: this package will regenerate the config file on upgrade. -If you changed it manually and upgrade mumble, you'll find a backup in $install_dir. - -Are you facing an issue, want to improve this app or say thank you? -Please open a new issue in this project: https://github.com/YunoHost-Apps/mumbleserver_ynh -" -ynh_send_readme_to_admin "$message" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 4cd7e18..1675087 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -33,40 +22,9 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow Both $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index dc535b0..067b459 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,11 +53,10 @@ if [ -z "$server_password" ]; then | head -1 \ | sed -r "s/.* (([a-z])*\.([a-z])*).*/\1/g") -#REMOVEME? ynh_app_setting_set --app=$app --key=server_password --value=$server_password + ynh_app_setting_set --app=$app --key=server_password --value=$server_password ynh_app_setting_set --app=$app --key=welcometext --value=$welcometext ynh_app_setting_set --app=$app --key=registername --value=$registername ynh_app_setting_set --app=$app --key=su_passwd --value=$su_passwd -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain systemctl stop mumble-server dpkg-reconfigure mumble-server --frontend=Noninteractive @@ -65,14 +64,6 @@ if [ -z "$server_password" ]; then systemctl disable mumble-server --quiet fi -# Fix SSO issue -# https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19 -if [ -z "$domain" ]; then -#REMOVEME? domain=$(ynh_app_setting_get "$app" domain_mumble) -#REMOVEME? ynh_app_setting_set "$app" domain "$domain" - ynh_app_setting_delete "$app" domain_mumble -fi - # Fix SSO issue # https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19 if [ -z "$no_sso" ]; then @@ -154,29 +145,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/mumble-server/$app.log" -#================================================= -# SEND README TO ADMIN -#================================================= - -message=" -Mumbleserver was updated! - -Port : $port -Password to join server: $server_password -SuperUser Password : $su_passwd -Welcome text : $welcometext -Root channel (your Mumble server name): $registername -Final path (where to find your files) : $install_dir -Mumble configuration file : $mumble_conf - -Note about config file: this package will regenerate the config file on upgrade. -If you changed it manually and upgrade mumble, you'll find a backup in /home/yunohost.conf/backup/var/www/mumbleserver/. - -Are you facing an issue, want to improve this app or say thank you? -Please open a new issue in this project: https://github.com/YunoHost-Apps/mumbleserver_ynh -" -ynh_send_readme_to_admin "$message" - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..5386c8a --- /dev/null +++ b/tests.toml @@ -0,0 +1,16 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ + + exclude = ["install.subdir", "change_url"] # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url + + # ------------------------------- + # Default args to use for install + # ------------------------------- + + args.welcometext="Welcome to my Mumble server" + args.registername="Root" \ No newline at end of file From dce4793a17768bfdb341bf1c9ad059327182bad5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 28 Dec 2023 12:41:02 +0000 Subject: [PATCH 06/13] Auto-update README --- README.md | 16 +--------------- README_fr.md | 16 +--------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 0d6e483..ea057d0 100644 --- a/README.md +++ b/README.md @@ -25,26 +25,12 @@ Mumble is a free, open source, low latency, high quality voice chat application. ![Screenshot of Mumble Server](./doc/screenshots/Mumble.png) -## Disclaimers / important information - -## Setup - -This package installs the Debian package and configures it with given settings. Password and other usefull information will be sent by email after installation. - -- [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server) - -## Config -If you need to change password of the server/superuser -1- edit `/var/www/mumbleserver/mumble-server.ini` -2- remove (or change) the password for serverpassword= -3- restart mumbleserver - ## Documentation and resources * Official app website: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 1908b82..479cb69 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,26 +24,12 @@ Mumble est une application de chat vocal gratuite, open source, à faible latenc ![Capture d’écran de Mumble Server](./doc/screenshots/Mumble.png) -## Avertissements / informations importantes - -## Configuration - -mumbleserver_ynh installe le paquet Debian et le configure avec les paramètres donnés. Le mot de passe et d'autres informations utiles sont envoyés par email après l'installation. - -- [Ajouter l'administrateur](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server) - -## Configuration -Si vous devez changer le mot de passe du serveur/superutilisateur -1- éditez `/var/www/mumbleserver/mumble-server.ini` -2- supprimer (ou changer) le mot de passe pour serverpassword= -3- redémarrer mumbleserver - ## Documentations et ressources * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From bfb3665123183ecf5172c6aa035ade2ab96796ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:06:32 +0100 Subject: [PATCH 07/13] Update install --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index a32a622..d2e7603 100644 --- a/scripts/install +++ b/scripts/install @@ -24,10 +24,8 @@ su_passwd=$(ynh_string_random) ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=no_sso --value="true" -REMOVEME? ynh_app_setting_set --app=$app --key=server_password --value="$server_password" +ynh_app_setting_set --app=$app --key=server_password --value="$server_password" ynh_app_setting_set --app=$app --key=su_passwd --value="$su_passwd" -ynh_app_setting_set --app=$app --key=welcometext --value="$welcometext" -ynh_app_setting_set --app=$app --key=registername --value="$registername" ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id" #================================================= From a1200d6a08ecdaefffa04143aac0028148c2068e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:28:47 +0100 Subject: [PATCH 08/13] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index d2e7603..591a6ac 100644 --- a/scripts/install +++ b/scripts/install @@ -17,6 +17,7 @@ source /usr/share/yunohost/helpers server_password=$(ynh_string_random) su_passwd=$(ynh_string_random) +instance_id=$YNH_APP_INSTANCE_NUMBER #================================================= # STORE SETTINGS FROM MANIFEST From 867cf3673eca470ac77244b3b6dc0ea54b6e5d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:27:14 +0100 Subject: [PATCH 09/13] cleaning --- doc/POST_INSTALL.md | 2 +- scripts/install | 14 +++----------- scripts/remove | 7 ------- scripts/upgrade | 32 +++++++++++--------------------- 4 files changed, 15 insertions(+), 40 deletions(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 2463654..948debe 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -4,7 +4,7 @@ SuperUser Password : __SU_PASSWD__ Welcome text : __WELCOMETEXT__ Root channel (your Mumble server name): __REGISTERNAME__ Final path (where to find your files) : __INSTALL_DIR__ -Mumble configuration file : __MUMBLE_CONF__ +Mumble configuration file : __INSTALL_DIR__/mumble-server.ini Note about config file: this package will regenerate the config file on upgrade. If you changed it manually and upgrade mumble, you'll find a backup in __INSTALL_DIR__. diff --git a/scripts/install b/scripts/install index 591a6ac..982910f 100644 --- a/scripts/install +++ b/scripts/install @@ -34,14 +34,11 @@ ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding a configuration file..." --weight=2 mkdir -p "$install_dir" -# Configuring with given settings -mumble_conf="$install_dir/mumble-server.ini" - -ynh_add_config --template="mumble-server.ini" --destination="$mumble_conf" +ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini" chmod -R 770 "$install_dir" chown -R :mumble-server "$install_dir" @@ -59,7 +56,7 @@ usermod --append --groups ssl-cert mumble-server # || true temporarily to ignore a bug in murmurd 1.3.0 # https://github.com/mumble-voip/mumble/issues/3911 -ynh_exec_warn_less murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" || true +#ynh_exec_warn_less murmurd -ini "$install_dir/mumble-server.ini" -supw "$su_passwd" "$instance_id" || true #================================================= # Disable default server installed by Debian's package @@ -68,11 +65,6 @@ ynh_exec_warn_less murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" systemctl stop mumble-server systemctl disable mumble-server --quiet -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/remove b/scripts/remove index 1675087..4f1a654 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,13 +25,6 @@ fi # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." - ynh_secure_remove --file="/var/log/mumble-server/$app.log" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 067b459..76ff2b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/mumble-server/$app.log" #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -30,7 +30,7 @@ ynh_systemd_action --service_name=$app --action="stop" ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # test old time -if [ -z "$server_password" ]; then +if [ -z "${server_password:-}" ]; then old_mumble_conf="/etc/mumble-server.ini" server_password=$(cat "$old_mumble_conf" \ @@ -66,19 +66,19 @@ fi # Fix SSO issue # https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19 -if [ -z "$no_sso" ]; then - ynh_app_setting_set "$app" no_sso "true" +if [ -z "${no_sso:-}" ]; then + ynh_app_setting_set --app="$app" --key=no_sso --value="true" fi # Fix multi installation -if [ -z "$instance_id" ]; then +if [ -z "${instance_id:-}" ]; then instance_id=$YNH_APP_INSTANCE_NUMBER - ynh_app_setting_set "$app" instance_id "$instance_id" + ynh_app_setting_set --app="$app" instance_id --value="$instance_id" fi -if [ -z "$registername" ]; then -#REMOVEME? registername=$(ynh_app_setting_get "$app" registerName) - ynh_app_setting_set "$app" registername "$registername" +if [ -z "${registername:-}" ]; then + registername=$(ynh_app_setting_get "$app" registerName) + ynh_app_setting_set --app="$app" --key=registername --value="$registername" ynh_app_setting_delete "$app" registerName fi @@ -91,10 +91,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1 mkdir -p $install_dir -# Configuring with given settings -mumble_conf="$install_dir/mumble-server.ini" - -ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf" +ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini" chmod -R 770 "$install_dir" chown -R :mumble-server "$install_dir" @@ -111,7 +108,7 @@ usermod --append --groups ssl-cert mumble-server # || true temporarily to ignore a bug in murmurd 1.3.0 # https://github.com/mumble-voip/mumble/issues/3911 -murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" || true +murmurd -ini "$install_dir/mumble-server.ini" -supw "$su_passwd" "$instance_id" || true #================================================= # Disable default server installed by Debian's package @@ -128,13 +125,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - # Add Mumble as a YunoHost service yunohost service add $app --description="Mumble server" --log="/var/log/mumble-server/$app.log" --needs_exposed_ports="$port" From d1d63413f31a9eebd8a62d392eaac56f89ac006f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:27:48 +0100 Subject: [PATCH 10/13] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 76ff2b6..0ece539 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,7 +108,7 @@ usermod --append --groups ssl-cert mumble-server # || true temporarily to ignore a bug in murmurd 1.3.0 # https://github.com/mumble-voip/mumble/issues/3911 -murmurd -ini "$install_dir/mumble-server.ini" -supw "$su_passwd" "$instance_id" || true +#murmurd -ini "$install_dir/mumble-server.ini" -supw "$su_passwd" "$instance_id" || true #================================================= # Disable default server installed by Debian's package From de793c13306fa7938be705de8fd3f1b8df6bf23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:28:43 +0100 Subject: [PATCH 11/13] Create POST_INSTALL_fr.md --- doc/POST_INSTALL_fr.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/POST_INSTALL_fr.md diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md new file mode 100644 index 0000000..7c3e8d4 --- /dev/null +++ b/doc/POST_INSTALL_fr.md @@ -0,0 +1,10 @@ +Port : __PORT__ +Mot de passe pour rejoindre le serveur : __SERVER_PASSWORD__ +Mot de passe superutilisateur : __SU_PASSWD__ +Texte de bienvenue : __WELCOMETEXT__ +Canal racine (nom de votre serveur Mumble) : __REGISTERNAME__ +Chemin final (où trouver vos fichiers) : __INSTALL_DIR__ +Fichier de configuration Mumble : __INSTALL_DIR__/mumble-server.ini + +Remarque sur le fichier de configuration : ce package régénérera le fichier de configuration lors de la mise à niveau. +Si vous l'avez modifié manuellement et mis à niveau Mumble, vous trouverez une sauvegarde dans __INSTALL_DIR__. \ No newline at end of file From 3939c59cd3f12cdbf28299e734dc459623265d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:28:57 +0100 Subject: [PATCH 12/13] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 686cb64..fa51621 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Mumble Server" description.en = "Low-latency, high quality voice chat software (VoIP)" description.fr = "Logiciel libre de voix sur IP (VoIP)" -version = "1.3.4~ynh1" +version = "1.3.4~ynh2" maintainers = [] From 04806f0b1fa5b7896d98d9e98ceb20bbca0aee18 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 28 Dec 2023 15:29:01 +0000 Subject: [PATCH 13/13] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea057d0..6816cf8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Mumble is a free, open source, low latency, high quality voice chat application. Mumble was the first VoIP application to establish true low latency voice communication over a decade ago. But low latency and gaming are not the only use cases it shines in. -**Shipped version:** 1.3.4~ynh1 +**Shipped version:** 1.3.4~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 479cb69..2020494 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Mumble est une application de chat vocal gratuite, open source, à faible latence et de haute qualité. Mumble a été la première application VoIP à établir une véritable communication vocale à faible latence il y a plus de dix ans. Mais la faible latence et le jeu ne sont pas les seuls cas d'utilisation dans lesquels il brille. -**Version incluse :** 1.3.4~ynh1 +**Version incluse :** 1.3.4~ynh2 ## Captures d’écran