1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mumbleserver_ynh.git synced 2024-09-03 19:46:03 +02:00
This commit is contained in:
Éric Gaspar 2023-12-28 13:40:57 +01:00
parent e6e07b5c62
commit 6155c827d9
9 changed files with 25 additions and 232 deletions

View file

@ -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

View file

@ -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

View file

@ -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"
}
]
}
}

View file

@ -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"

View file

@ -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"
}

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================

16
tests.toml Normal file
View file

@ -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"