1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mumbleserver_ynh.git synced 2024-09-03 19:46:03 +02:00

Merge branch 'testing' into mumble-web

This commit is contained in:
ericgaspar 2021-06-04 23:01:05 +02:00
commit 10e607da6a
No known key found for this signature in database
GPG key ID: 574F281483054D44
17 changed files with 357 additions and 156 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,55 @@
---
name: Bug report
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
---
**How to post a meaningful bug report**
1. *Read this whole template first.*
2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *When in doubt, post here and we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*
---
### Describe the bug
*A clear and concise description of what the bug is.*
### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain:
- Using, or trying to install package version/branch:
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
### Steps to reproduce
- *If you performed a command from the CLI, the command itself is enough. For example:*
```sh
sudo yunohost app install the_app
```
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:*
1. *Go to '...'*
2. *Click on '...'*
3. *Scroll down to '...'*
4. *See error*
### Expected behavior
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
### Logs
*When an operation fails, YunoHost provides a simple way to share the logs.*
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
*If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,16 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished and ready to be reviewed/tested
- [ ] The fix/enhancement were manually tested (if applicable)
## Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

View file

@ -1,41 +1,55 @@
# Mumble server package for YunoHost <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
[![Integration level](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) # Mumble Server for YunoHost
[![Install with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mumbleserver)
It installs the Debian package and configures it with given settings. [![Integration level](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) ![](https://ci-apps.yunohost.org/ci/badges/mumbleserver.status.svg) ![](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)
Password and other usefull information will be sent to you after installation. *[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Mumble Server quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
Low-latency, high quality voice chat software (VoIP).
**Shipped version:** 1.3.0~ynh2
## Screenshots
![](./doc/screenshots/connected.png)
## Disclaimers / important information
#### Setup #### Setup
This package installs the Debian package and configures it with given settings. Password and other usefull information will be sent to you after installation.
- [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server) - [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server)
#### Maintainers & history ## Documentation and resources
----------------
* 2014: Package creation was maid by [matlink]](https://github.com/Matlink) * Official app website: https://mumble.info
* 2016: improved and maintained by [Moul](https://github.com/M5oul) * Official admin documentation: https://wiki.mumble.info/wiki/Main_Page
* 2018: full rewrite and now maintained by [Jibec](https://github.com/Jibec) * Upstream app code repository: https://github.com/mumble-voip/mumble
* YunoHost documentation for this app: https://yunohost.org/app_mumbleserver
* Report a bug: https://github.com/YunoHost-Apps/mumbleserver_ynh/issues
**Shipped version:** 1.2.8 (source package provided by Debian) ## Developer info
# State of this package Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mumbleserver_ynh/tree/testing).
* works fine: To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/mumbleserver_ynh/tree/testing --debug
or
sudo yunohost app upgrade mumbleserver -u https://github.com/YunoHost-Apps/mumbleserver_ynh/tree/testing --debug
```
* [x] install/remove/backup/remove/upgrade/multi-instance with x86_64 **More info regarding app packaging:** https://yunohost.org/packaging_apps
* to be confirmed
* [x] ARM support
* [x] Improve systemd protection
* to be added:
* [ ] Improve log file and add logrotate
## Links
* Report a bug about this package: https://github.com/YunoHost-Apps/mumbleserver_ynh
* Report a bug about Mumble itself: https://github.com/mumble-voip/mumble
* Mumble website: https://mumble.info
* YunoHost website: https://yunohost.org

51
README_fr.md Normal file
View file

@ -0,0 +1,51 @@
# Mumble Server pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/mumbleserver.svg)](https://dash.yunohost.org/appci/app/mumbleserver) ![](https://ci-apps.yunohost.org/ci/badges/mumbleserver.status.svg) ![](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)*
*[Lire ce readme en français.](./README_fr.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.*
## Vue d'ensemble
Logiciel libre de voix sur IP (VoIP).
**Version incluse :** 1.3.0~ynh2
## Captures d'écran
![](./doc/screenshots/connected.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 après l'installation.
- [Ajouter l'administrateur](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server)
## Documentations et ressources
* Site officiel de l'app : https://mumble.info
* Documentation officielle de l'admin : https://wiki.mumble.info/wiki/Main_Page
* Dépôt de code officiel de l'app : https://github.com/mumble-voip/mumble
* Documentation YunoHost pour cette app : https://yunohost.org/app_mumbleserver
* Signaler un bug : https://github.com/YunoHost-Apps/mumbleserver_ynh/issues
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mumbleserver_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/mumbleserver_ynh/tree/testing --debug
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 :** https://yunohost.org/packaging_apps

View file

@ -1,10 +1,8 @@
;; Test complet ;; Test complet
auto_remove=1 auto_remove=1
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) welcometext="Welcome to my Mumble server"
is_public=1 (PUBLIC|public=1|private=0)
welcometext="Welcome to my mumble server"
registername="Root" registername="Root"
mumbleweb=1 mumbleweb=1
; Checks ; Checks
@ -15,21 +13,12 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=d9ece341d532bd5eac9af9ce191da7b62d1e8bb1
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0
;;; Levels
Level 1=auto
Level 2=auto
Level 3=auto
# https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/11
Level 4=1
Level 5=auto
Level 6=auto
Level 7=auto
Level 8=0
Level 9=0
Level 10=0
;;; Options ;;; Options
Email=jean-baptiste@holcroft.fr Email=
Notification=all Notification=none
;;; Upgrade options
; commit=d9ece341d532bd5eac9af9ce191da7b62d1e8bb1
name=Merge pull request #40 from YunoHost-Apps/testing

View file

@ -85,7 +85,7 @@ pidfile=/var/run/mumble-server/__APP__.pid
# configure it here than through D-Bus or Ice. # configure it here than through D-Bus or Ice.
# #
# Welcome message sent to clients when they connect. # Welcome message sent to clients when they connect.
welcometext="__WELCOME__" welcometext="__WELCOMETEXT__"
# Port to bind TCP and UDP sockets to. # Port to bind TCP and UDP sockets to.
port=__PORT__ port=__PORT__
@ -95,7 +95,7 @@ port=__PORT__
#host= #host=
# Password to join server. # Password to join server.
serverpassword=__SRV_PWD__ serverpassword=__SERVER_PASSWORD__
# Maximum bandwidth (in bits per second) clients are allowed # Maximum bandwidth (in bits per second) clients are allowed
# to send speech at. # to send speech at.
@ -143,7 +143,7 @@ users=100
# addresses. # addresses.
# Only uncomment the 'registerName' parameter if you wish to give your "Root" channel a custom name. # Only uncomment the 'registerName' parameter if you wish to give your "Root" channel a custom name.
# #
registerName=__REGISTER__ registerName=__REGISTERNAME__
#registerPassword=secret #registerPassword=secret
#registerUrl=http://mumble.sourceforge.net/ #registerUrl=http://mumble.sourceforge.net/
#registerHostname= #registerHostname=

View file

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Mumble Server (Murmur, app __APP__) Description=Mumble Server: voice chat application
Requires=network-online.target Requires=network-online.target
After=network.target After=network.target

5
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,5 @@
#### Setup
This package installs the Debian package and configures it with given settings. Password and other usefull information will be sent to you after installation.
- [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server)

5
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,5 @@
## 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 après l'installation.
- [Ajouter l'administrateur](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server)

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -3,19 +3,29 @@
"id": "mumbleserver", "id": "mumbleserver",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Mumble is a libre, low-latency, high quality voice chat software primarily intended for use while gaming.", "en": "Low-latency, high quality voice chat software (VoIP).",
"fr": "Mumble est un logiciel libre de voix sur IP (VoIP), son principal usage étant la communication pendant les parties de jeux en réseau." "fr": "Logiciel libre de voix sur IP (VoIP)."
}, },
"version": "1.3.0~ynh2",
"url": "https://mumble.info", "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", "license": "BSD-3-Clause",
"maintainer": { "maintainer": {
"name": "",
"email": ""
},
"previous_maintainers": [{
"name": "Jean-Baptiste Holcroft", "name": "Jean-Baptiste Holcroft",
"email": "jean-baptiste@holcroft.fr" "email": "jean-baptiste@holcroft.fr"
}, }],
"requirements": { "requirements": {
"yunohost": ">= 3.7.0" "yunohost": ">= 4.2.4"
}, },
"version": "1.2.8~ynh7",
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
], ],
@ -24,26 +34,17 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain (used to select the correct certificate)"
},
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for mumble web"
},
"example": "/web", "example": "/web",
"default": "/web" "default": "/web"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public application?"
},
"help": { "help": {
"en": "Set to no to limit access to logged YunoHost users." "en": "Set to no to limit access to logged YunoHost users."
}, },

View file

@ -1,7 +1,27 @@
#!/bin/bash #!/bin/bash
pkg_dependencies="mumble-server mailutils websockify" pkg_dependencies="mumble-server mailutils websockify"
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="mumble-server mailutils"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Send an email to inform the administrator # Send an email to inform the administrator
# #
# usage: ynh_send_readme_to_admin app_message [recipients] # usage: ynh_send_readme_to_admin app_message [recipients]
@ -63,16 +83,3 @@ $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')"
echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
} }
# Execute a command as another user
# usage: ynh_exec_as USER COMMAND [ARG ...]
ynh_exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}

View file

@ -13,18 +13,22 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# STANDARD BACKUP STEPS # STANDARD BACKUP STEPS
@ -63,4 +67,4 @@ ynh_backup "/etc/systemd/system/$app-web.service"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -27,7 +27,7 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
welcometext=$YNH_APP_ARG_WELCOMETEXT welcometext=$YNH_APP_ARG_WELCOMETEXT
registerName=$YNH_APP_ARG_REGISTERNAME registername=$YNH_APP_ARG_REGISTERNAME
instance_id=$YNH_APP_INSTANCE_NUMBER instance_id=$YNH_APP_INSTANCE_NUMBER
mumbleweb=$YNH_APP_ARG_MUMBLEWEB mumbleweb=$YNH_APP_ARG_MUMBLEWEB
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
@ -38,6 +38,7 @@ su_passwd=$(ynh_string_random)
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
ynh_script_progression --message="Validating installation parameters..." --weight=1
final_path=/var/www/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die "This path already contains a folder"
@ -45,15 +46,16 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2
# Save app settings # Save app settings
ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_set --app=$app --key=domain --value="$domain"
ynh_app_setting_set "$app" no_sso "true" ynh_app_setting_set --app=$app --key=no_sso --value="true"
ynh_app_setting_set "$app" server_password "$server_password" ynh_app_setting_set --app=$app --key=server_password --value="$server_password"
ynh_app_setting_set "$app" su_passwd "$su_passwd" ynh_app_setting_set --app=$app --key=su_passwd --value="$su_passwd"
ynh_app_setting_set "$app" welcometext "$welcometext" ynh_app_setting_set --app=$app --key=welcometext --value="$welcometext"
ynh_app_setting_set "$app" registerName "$registerName" ynh_app_setting_set --app=$app --key=registerName --value="$registername"
ynh_app_setting_set "$app" instance_id "$instance_id" ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id"
ynh_app_setting_set "$app" mumbleweb "$mumbleweb" ynh_app_setting_set "$app" mumbleweb "$mumbleweb"
ynh_app_setting_set "$app" is_public "$is_public" ynh_app_setting_set "$app" is_public "$is_public"
@ -62,12 +64,14 @@ ynh_app_setting_set "$app" is_public "$is_public"
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
ynh_script_progression --message="Finding an available port..." --weight=1
port=$(ynh_find_port 64738) port=$(ynh_find_port --port=64738)
ynh_app_setting_set "$app" port "$port" ynh_app_setting_set --app=$app --key=port --value=$port
# Open port in firewall # Open the port
yunohost firewall allow Both "$port" ynh_script_progression --message="Configuring firewall..." --weight=1
ynh_exec_warn_less yunohost firewall allow Both $port
if [ "$mumbleweb" -eq 1 ] ; then if [ "$mumbleweb" -eq 1 ] ; then
port_web=$(ynh_find_port 64800) port_web=$(ynh_find_port 64800)
@ -79,12 +83,13 @@ fi
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=4
# Install Mumble Debian package via apt # Install Mumble Debian package via apt
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
if [ "$mumbleweb" -eq 1 ] ; then if [ "$mumbleweb" -eq 1 ] ; then
ynh_install_nodejs --nodejs_version="10" ynh_install_nodejs --nodejs_version="12"
fi fi
#================================================= #=================================================
@ -120,26 +125,23 @@ ynh_script_progression --message="Configuring system user..." --weight=3
# Create a dedicated system user # Create a dedicated system user
ynh_system_user_create --username="$app" --home_dir="$final_path" ynh_system_user_create --username="$app" --home_dir="$final_path"
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# mumble server conf.ini # mumble server conf.ini
#================================================= #=================================================
mkdir -p "$final_path"
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Configuring with given settings # Configuring with given settings
mumble_conf="$final_path/mumble-server.ini" mumble_conf="$final_path/mumble-server.ini"
cp ../conf/mumble-server.ini "$mumble_conf" ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf"
ynh_replace_string "__FINALPATH__" "$final_path" "$mumble_conf"
ynh_replace_string "__APP__" "$app" "$mumble_conf"
ynh_replace_string "__WELCOME__" "$welcometext" "$mumble_conf"
ynh_replace_string "__PORT__" "$port" "$mumble_conf"
ynh_replace_string "__SRV_PWD__" "$server_password" "$mumble_conf"
ynh_replace_string "__REGISTER__" "$registerName" "$mumble_conf"
ynh_replace_string "__DOMAIN__" "$domain" "$mumble_conf"
ynh_store_file_checksum "$mumble_conf"
if [ "$mumbleweb" -eq 1 ] ; then if [ "$mumbleweb" -eq 1 ] ; then
ynh_use_nodejs ynh_use_nodejs
@ -184,23 +186,31 @@ usermod --append --groups ssl-cert mumble-server
# Set SuperUser password # Set SuperUser password
#================================================= #=================================================
murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" # || 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
#================================================= #=================================================
# Disable default server installed by Debian's package # Disable default server installed by Debian's package
#================================================= #=================================================
systemctl stop mumble-server systemctl stop mumble-server
systemctl disable mumble-server systemctl disable mumble-server --quiet
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
# Add Mumble as a YunoHost service # Add Mumble as a YunoHost service
yunohost service add "$app" -l "/var/log/mumble-server/$app.log" yunohost service add $app --description="Mumble server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port
systemctl restart "$app" #=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action=restart #--log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -230,7 +240,7 @@ Port : $port
Password to join server: $server_password Password to join server: $server_password
SuperUser Password : $su_passwd SuperUser Password : $su_passwd
Welcome text : $welcometext Welcome text : $welcometext
Root channel (your mumble server name): $registerName Root channel (your mumble server name): $registername
Final path (where to find your files) : $final_path Final path (where to find your files) : $final_path
Mumble configuration file : $mumble_conf Mumble configuration file : $mumble_conf
@ -242,9 +252,8 @@ Please open a new issue in this project: https://github.com/YunoHost-Apps/mumble
" "
ynh_send_readme_to_admin "$message" ynh_send_readme_to_admin "$message"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --time --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -21,21 +22,24 @@ port=$(ynh_app_setting_get "$app" port)
port_web=$(ynh_app_setting_get "$app" port_web) port_web=$(ynh_app_setting_get "$app" port_web)
mumbleweb=$(ynh_app_setting_get "$app" mumbleweb) mumbleweb=$(ynh_app_setting_get "$app" mumbleweb)
final_path=$(ynh_app_setting_get "$app" final_path) final_path=$(ynh_app_setting_get "$app" final_path)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
# REMOVE SERVICE FROM ADMIN PANEL # REMOVE SERVICE FROM ADMIN PANEL
#================================================= #=================================================
if yunohost service status | grep -q "$app" # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
echo "Remove $app service" ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove "$app" yunohost service remove $app
fi fi
#================================================= #=================================================
# STOP AND REMOVE SERVICE # STOP AND REMOVE SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
@ -44,6 +48,7 @@ ynh_remove_systemd_config mumble-web
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
@ -57,9 +62,10 @@ ynh_remove_nodejs
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing app main directory..." --weight=2
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove "$final_path" ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
@ -75,8 +81,8 @@ ynh_remove_nginx_config
if yunohost firewall list | grep -q "\- $port$" if yunohost firewall list | grep -q "\- $port$"
then then
echo "Close port $port" ynh_script_progression --message="Close port $port" --weight=1
yunohost firewall disallow Both "$port" > /dev/null 2>&1 ynh_exec_warn_less yunohost firewall disallow Both $port
fi fi
if [ "$mumbleweb" -eq 1 ] ; then if [ "$mumbleweb" -eq 1 ] ; then
@ -104,3 +110,8 @@ ynh_script_progression --message="Removing the dedicated system user..." --time
# Delete a system user # Delete a system user
ynh_system_user_delete --username="$app" ynh_system_user_delete --username="$app"
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last

View file

@ -13,12 +13,12 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -26,9 +26,11 @@ domain=$(ynh_app_setting_get --app="$app" --key=domain)
path_url=$(ynh_app_setting_get --app="$app" --key=path) path_url=$(ynh_app_setting_get --app="$app" --key=path)
final_path=$(ynh_app_setting_get --app"$app" --key=final_path) final_path=$(ynh_app_setting_get --app"$app" --key=final_path)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1
ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 ynh_script_progression --message="Validating restoration parameters..." --time --weight=1
@ -48,18 +50,25 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 ynh_script_progression --message="Restoring the app main directory..." --weight=2
ynh_restore_file "$final_path" ynh_restore_file --origin_path="$final_path"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username="$app" ynh_system_user_create --username="$app"
ynh_script_progression --message="Reinstalling dependencies..." --weight=4
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
@ -89,14 +98,15 @@ usermod --append --groups ssl-cert mumble-server
#================================================= #=================================================
systemctl stop mumble-server systemctl stop mumble-server
systemctl disable mumble-server systemctl disable mumble-server --quiet
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
# Add Mumble as a YunoHost service # Add Mumble as a YunoHost service
yunohost service add "$app" -l "/var/log/mumble-server/$app.log" yunohost service add $app --description="Mumble server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
@ -126,8 +136,21 @@ ynh_script_progression --message="Reloading nginx web server..." --time --weight
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action=restart #--log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --time --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -5,12 +5,14 @@
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -28,9 +30,16 @@ final_path=$(ynh_app_setting_get "$app" final_path)
instance_id=$(ynh_app_setting_get "$app" instance_id) instance_id=$(ynh_app_setting_get "$app" instance_id)
mumbleweb=$(ynh_app_setting_get "$app" mumbleweb) mumbleweb=$(ynh_app_setting_get "$app" mumbleweb)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z "$final_path" ]; then if [ -z "$final_path" ]; then
@ -50,9 +59,9 @@ if [ -z "$server_password" ]; then
| grep "welcometext=" \ | grep "welcometext=" \
| sed "s/welcometext=//") | sed "s/welcometext=//")
registerName=$(cat "$old_mumble_conf" \ registername=$(cat "$old_mumble_conf" \
| grep "registerName=" \ | grep "registerName=" \
| sed "s/registerName=//") | sed "s/registername=//")
# we don't know what the previous password was, let's regenerate it # we don't know what the previous password was, let's regenerate it
su_passwd=$(ynh_string_random) su_passwd=$(ynh_string_random)
@ -62,16 +71,16 @@ if [ -z "$server_password" ]; then
| head -1 \ | head -1 \
| sed -r "s/.* (([a-z])*\.([a-z])*).*/\1/g") | sed -r "s/.* (([a-z])*\.([a-z])*).*/\1/g")
ynh_app_setting_set "$app" server_password "$server_password" ynh_app_setting_set --app=$app --key=server_password --value=$server_password
ynh_app_setting_set "$app" welcometext "$welcometext" ynh_app_setting_set --app=$app --key=welcometext --value=$welcometext
ynh_app_setting_set "$app" registerName "$registerName" ynh_app_setting_set --app=$app --key=registerName --value=$registername
ynh_app_setting_set "$app" su_passwd "$su_passwd" ynh_app_setting_set --app=$app --key=su_passwd --value=$su_passwd
ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_set --app=$app --key=domain --value=$domain
systemctl stop mumble-server systemctl stop mumble-server
dpkg-reconfigure mumble-server --frontend=Noninteractive dpkg-reconfigure mumble-server --frontend=Noninteractive
systemctl stop mumble-server systemctl stop mumble-server
systemctl disable mumble-server systemctl disable mumble-server --quiet
fi fi
# Fix SSO issue # Fix SSO issue
@ -94,10 +103,10 @@ if [ -z "$instance_id" ]; then
ynh_app_setting_set "$app" instance_id "$instance_id" ynh_app_setting_set "$app" instance_id "$instance_id"
fi fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -156,6 +165,13 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
ynh_system_user_create --username="$app" ynh_system_user_create --username="$app"
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=6
# Install Mumble Debian package via apt
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
@ -167,19 +183,7 @@ mkdir -p $final_path
# Configuring with given settings # Configuring with given settings
mumble_conf="$final_path/mumble-server.ini" mumble_conf="$final_path/mumble-server.ini"
ynh_backup_if_checksum_is_different "$mumble_conf" ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf"
cp ../conf/mumble-server.ini "$mumble_conf"
ynh_replace_string "__FINALPATH__" "$final_path" "$mumble_conf"
ynh_replace_string "__APP__" "$app" "$mumble_conf"
ynh_replace_string "__WELCOME__" "$welcometext" "$mumble_conf"
ynh_replace_string "__PORT__" "$port" "$mumble_conf"
ynh_replace_string "__SRV_PWD__" "$server_password" "$mumble_conf"
ynh_replace_string "__REGISTER__" "$registerName" "$mumble_conf"
ynh_replace_string "__DOMAIN__" "$domain" "$mumble_conf"
ynh_store_file_checksum "$mumble_conf"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -196,7 +200,7 @@ fi
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
@ -226,21 +230,28 @@ usermod --append --groups ssl-cert mumble-server
# Set SuperUser password # Set SuperUser password
#================================================= #=================================================
murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" # || 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
#================================================= #=================================================
# Disable default server installed by Debian's package # Disable default server installed by Debian's package
#================================================= #=================================================
systemctl stop mumble-server systemctl stop mumble-server
systemctl disable mumble-server systemctl disable mumble-server --quiet
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
# Add Mumble as a YunoHost service # Add Mumble as a YunoHost service
yunohost service add "$app" -l "/var/log/mumble-server/$app.log" yunohost service add $app --description="Mumble server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -268,7 +279,7 @@ Port : $port
Password to join server: $server_password Password to join server: $server_password
SuperUser Password : $su_passwd SuperUser Password : $su_passwd
Welcome text : $welcometext Welcome text : $welcometext
Root channel (your mumble server name): $registerName Root channel (your mumble server name): $registername
Final path (where to find your files) : $final_path Final path (where to find your files) : $final_path
Mumble configuration file : $mumble_conf Mumble configuration file : $mumble_conf
@ -284,4 +295,4 @@ ynh_send_readme_to_admin "$message"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --time --last ynh_script_progression --message="Upgrade of $app completed" --last