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