diff --git a/README.md b/README.md index eb13c42..a526e45 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in The TURN Server is a VoIP media traffic NAT traversal server and gateway. It can be used as a general-purpose network traffic TURN server and gateway, too. -**Shipped version:** 4.5.2.3~ynh2 -## Disclaimers / important information - -## Configuration - -You need to install TURN server in a root or subdomain like `turn.domain.tld` - -How to configure this app: a plain file with SSH. - -## Testing - -For testing we can use Trickle-Ice testing tool. Go to [trickle-ice page](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice) and enter following details. -``` -TURN URI : turn::5349 -TURN username: -TURN password: -``` - +**Shipped version:** 4.5.2.3~ynh3 ## Documentation and resources * Official admin documentation: diff --git a/README_fr.md b/README_fr.md index 764b9e9..62fd13f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,24 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po The TURN Server is a VoIP media traffic NAT traversal server and gateway. It can be used as a general-purpose network traffic TURN server and gateway, too. -**Version incluse :** 4.5.2.3~ynh2 -## Avertissements / informations importantes - -## Configuration - -Vous devez installer coTURN à la racine ou un sous-domaine comme `turn.domain.tld` - -How to configure this app: a plain file with SSH. - -## Testing - -Pour les tests, vous pouvez utiliser l'outil de test Trickle-Ice. Accédez à la page [trickle-ice](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice) et entrez les détails suivants. -``` -TURN URI : turn::5349 -TURN username: -TURN password: -``` - +**Version incluse :** 4.5.2.3~ynh3 ## Documentations et ressources * Documentation officielle de l’admin : diff --git a/conf/cron_coturn b/conf/cron_coturn index 367154f..07b6cdd 100644 --- a/conf/cron_coturn +++ b/conf/cron_coturn @@ -1,2 +1,2 @@ # Check if the IP as not changed at every 15th minute -*/15 * * * * root bash __DATA_PATH__/Coturn_config_rotate.sh >/dev/null 2>&1 +*/15 * * * * root bash __DATA_DIR__/Coturn_config_rotate.sh >/dev/null 2>&1 diff --git a/conf/turnserver.conf b/conf/turnserver.conf index 991bce2..8751215 100644 --- a/conf/turnserver.conf +++ b/conf/turnserver.conf @@ -27,7 +27,7 @@ # TLS version 1.0, 1.1 and 1.2. # For secure UDP connections, Coturn supports DTLS version 1. # -tls-listening-port=__TURNSERVER_TLS_PORT__ +tls-listening-port=__PORT_TURNSERVER_TLS__ # Alternative listening port for UDP and TCP listeners; # default (or zero) value means "listening port plus one". @@ -43,7 +43,7 @@ tls-listening-port=__TURNSERVER_TLS_PORT__ # Alternative listening port for TLS and DTLS protocols. # Default (or zero) value means "TLS listening port plus one". # -alt-tls-listening-port=__TURNSERVER_ALT_TLS_PORT__ +alt-tls-listening-port=__PORT_TURNSERVER_ALT_TLS__ # Some network setups will require using a TCP reverse proxy in front # of the STUN server. If the proxy port option is set a single listener @@ -690,7 +690,7 @@ no-cli # CLI server port. Default is 5766. # -cli-port=__CLI_PORT__ +cli-port=__PORT_CLI__ # CLI access password. Default is empty (no password). # For the security reasons, it is recommended that you use the encrypted diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 82% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index 583515b..e3f378d 100644 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -1,6 +1,6 @@ ## Configuration -You need to install TURN server in a root or subdomain like `turn.domain.tld` +You need to install TURN server in a root or subdomain like `__DOMAIN__` How to configure this app: a plain file with SSH. diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 75% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md index d4a294c..d20abe8 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/ADMIN_fr.md @@ -1,14 +1,12 @@ ## Configuration -Vous devez installer coTURN à la racine ou un sous-domaine comme `turn.domain.tld` - -How to configure this app: a plain file with SSH. +Vous devez installer coTURN à la racine ou un sous-domaine comme `__DOMAIN__` ## Testing Pour les tests, vous pouvez utiliser l'outil de test Trickle-Ice. Accédez à la page [trickle-ice](https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice) et entrez les détails suivants. ``` -TURN URI : turn::5349 +TURN URI : turn:__DOMAIN__:5349 TURN username: TURN password: ``` diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..36f24cb --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,5 @@ +For testing we can use Trickle-Ice testing tool. Go to trickle-ice page https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ and enter following details. + +STUN or TURN URI: turn:__DOMAIN__:__PORT_TURNSERVER_TLS__ +TURN username: turnserver +TURN password: __TURNSERVER_PWD__ diff --git a/manifest.json b/manifest.json deleted file mode 100644 index adaa2a2..0000000 --- a/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "Coturn", - "id": "coturn", - "packaging_format": 1, - "description": { - "en": "VoIP media traffic NAT traversal server and gateway", - "fr": "Serveur et passerelle NAT du trafic média VoIP" - }, - "version": "4.5.2.3~ynh2", - "url": "https://github.com/coturn/coturn", - "upstream": { - "license": "BSD-3-Clause", - "admindoc": "https://github.com/coturn/coturn/wiki", - "code": "https://github.com/coturn/coturn", - "cpe": "cpe:2.3:a:coturn_project:coturn" - }, - "license": "BSD-3-Clause", - "maintainer": { - "name": "eric_G", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": false, - "services": [], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - } - ] - } -} \ No newline at end of file diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..c026fc4 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,48 @@ +packaging_format = 2 + +id = "coturn" +name = "Coturn" +description.en = "VoIP media traffic NAT traversal server and gateway" +description.fr = "Serveur et passerelle NAT du trafic média VoIP" + +version = "4.5.2.3~ynh3" + +maintainers = ["eric_G"] + +[upstream] +license = "BSD-3-Clause" +admindoc = "https://github.com/coturn/coturn/wiki" +code = "https://github.com/coturn/coturn" + +[integration] +yunohost = ">= 11.1.19" +architectures = "all" +multi_instance = false +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" + + [install.domain] + type = "domain" + full_domain = true + +[resources] + [resources.ports] + turnserver_tls.default = 5349 + turnserver_tls.exposed = "Both" + turnserver_alt_tls.default = 5350 + turnserver_alt_tls.exposed = "Both" + cli.default = 5766 + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + + [resources.apt] + packages = "sqlite3 libsqlite3-dev coturn acl" diff --git a/scripts/_common.sh b/scripts/_common.sh index 1ab2257..599c71e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -pkg_dependencies="sqlite3 libsqlite3-dev coturn acl" - #================================================= # PERSONAL HELPERS #================================================= @@ -14,140 +11,3 @@ pkg_dependencies="sqlite3 libsqlite3-dev coturn acl" #================================================= # EXPERIMENTAL HELPERS #================================================= - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type] -# | arg: -m --app_message= - The file with the content to send to the administrator. -# | arg: -r, --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" -# | arg: -t, --type= - Type of mail, could be 'backup', 'change_url', 'install', 'remove', 'restore', 'upgrade' -ynh_send_readme_to_admin() { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [m]=app_message= [r]=recipients= [t]=type= ) - local app_message - local recipients - local type - # Manage arguments with getopts - - ynh_handle_getopts_args "$@" - app_message="${app_message:-}" - recipients="${recipients:-root}" - type="${type:-install}" - - # Get the value of admin_mail_html - admin_mail_html=$(ynh_app_setting_get $app admin_mail_html) - admin_mail_html="${admin_mail_html:-0}" - - # 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") - - # Subject base - local mail_subject="☁️🆈🅽🅷☁️: \`$app\`" - - # Adapt the subject according to the type of mail required. - if [ "$type" = "backup" ]; then - mail_subject="$mail_subject has just been backup." - elif [ "$type" = "change_url" ]; then - mail_subject="$mail_subject has just been moved to a new URL!" - elif [ "$type" = "remove" ]; then - mail_subject="$mail_subject has just been removed!" - elif [ "$type" = "restore" ]; then - mail_subject="$mail_subject has just been restored!" - elif [ "$type" = "upgrade" ]; then - mail_subject="$mail_subject has just been upgraded!" - else # install - mail_subject="$mail_subject has just been installed!" - fi - - local mail_message="Specific information for the application $app. - -$(if [ -n "$app_message" ] -then - cat "$app_message" -else - echo "...No specific information..." -fi) - ---- -Automatic diagnosis data from YunoHost - -__PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')__PRE_TAG2__" - - # Store the message into a file for further modifications. - echo "$mail_message" > mail_to_send - - # If a html email is required. Apply html tags to the message. - if [ "$admin_mail_html" -eq 1 ] - then - # Insert 'br' tags at each ending of lines. - ynh_replace_string "$" "
" mail_to_send - - # Insert starting HTML tags - sed --in-place '1s@^@\n\n\n\n@' mail_to_send - - # Keep tabulations - ynh_replace_string " " "\ \ " mail_to_send - ynh_replace_string "\t" "\ \ " mail_to_send - - # Insert url links tags - ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "\1" mail_to_send - - # Insert pre tags - ynh_replace_string "__PRE_TAG1__" "
" mail_to_send
-		ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
-
-		# Insert finishing HTML tags
-		echo -e "\n\n" >> mail_to_send
-
-	# Otherwise, remove tags to keep a plain text.
-	else
-		# Remove URL tags
-		ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send
-		ynh_replace_string "__URL_TAG2__" ": " mail_to_send
-
-		# Remove PRE tags
-		ynh_replace_string "__PRE_TAG[1-2]__" "" mail_to_send
-	fi
-
-	# 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
-
-	if [ "$admin_mail_html" -eq 1 ]
-	then
-		content_type="text/html"
-	else
-		content_type="text/plain"
-	fi
-
-	# Send the email to the recipients
-	cat mail_to_send | $mail_bin -a "Content-Type: $content_type; charset=UTF-8" -s "$mail_subject" "$recipients"
-}
diff --git a/scripts/backup b/scripts/backup
index 97b158f..a00c642 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -10,22 +10,6 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_print_info --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-
 #=================================================
 # DECLARE DATA AND CONF FILES TO BACKUP
 #=================================================
@@ -41,7 +25,7 @@ ynh_backup --src_path="/etc/turnserver.conf"
 # BACKUP THE COTURN DATAPATH
 #=================================================
 
-ynh_backup --src_path="/home/yunohost.app/$app"
+ynh_backup --src_path="$data_dir"
 
 #=================================================
 # SPECIFIC BACKUP
diff --git a/scripts/install b/scripts/install
index 03b7cd7..6d9b4cc 100644
--- a/scripts/install
+++ b/scripts/install
@@ -9,27 +9,10 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# RETRIEVE ARGUMENTS FROM THE MANIFEST
-#=================================================
-
-domain=$YNH_APP_ARG_DOMAIN
-
-app=$YNH_APP_INSTANCE_NAME
-
 #=================================================
 # STORE SETTINGS FROM MANIFEST
 #=================================================
-ynh_script_progression --message="Storing installation settings..." --weight=4
 
-ynh_app_setting_set --app=$app --key=domain --value=$domain
 ynh_app_setting_set --app=$app --key=no_sso --value=true
 
 #=================================================
@@ -48,41 +31,12 @@ then
     chmod 640 /etc/ssl/private/dh2048.pem
 fi
 
-#=================================================
-# STANDARD MODIFICATIONS
-#=================================================
-# FIND AND OPEN A PORT
-#=================================================
-ynh_script_progression --message="Finding an available port..." --weight=3
-
-# Find an available port
-turnserver_tls_port=$(ynh_find_port --port=5349)
-turnserver_alt_tls_port=$(ynh_find_port --port=$((turnserver_tls_port+1)))
-cli_port=$(ynh_find_port --port=5766)
-
-# Open the port
-ynh_exec_warn_less yunohost firewall allow Both $turnserver_tls_port
-ynh_exec_warn_less yunohost firewall allow Both $turnserver_alt_tls_port
-
-# Store opened ports
-ynh_app_setting_set --app=$app --key=turnserver_tls_port --value=$turnserver_tls_port
-ynh_app_setting_set --app=$app --key=turnserver_alt_tls_port --value=$turnserver_alt_tls_port
-ynh_app_setting_set --app=$app --key=cli_port --value=$cli_port
-
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Installing dependencies..." --weight=5
-
-ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
 ynh_script_progression --message="Configuring system user..." --weight=3
 
 # Create a system user
-ynh_system_user_create --username=turnserver
 adduser turnserver ssl-cert
 
 #=================================================
@@ -130,11 +84,10 @@ ynh_store_file_checksum --file="$coturn_config_path"
 
 # WARNING : theses command are used in INSTALL, UPGRADE
 # For any update do it in all files
-data_path="/home/yunohost.app/$app"
-mkdir -p $data_path
-cp -f ../sources/Coturn_config_rotate.sh $data_path/
-ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=$data_path/Coturn_config_rotate.sh
-chmod +x $data_path/Coturn_config_rotate.sh
+cp -f ../sources/Coturn_config_rotate.sh $data_dir/
+ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=$data_dir/Coturn_config_rotate.sh
+
+chmod +x $data_dir/Coturn_config_rotate.sh
 
 #=================================================
 # SET COTURN CRON
@@ -156,7 +109,7 @@ ynh_use_logrotate --logfile "/var/log/$app"
 #=================================================
 
 # Set permissions to app files
-chown root: -R $data_path
+chown root: -R $data_dir
 chown -R turnserver:root /var/log/$app
 chown turnserver:root /etc/turnserver.conf
 setfacl -R -m user:turnserver:rwX  /var/log/$app
@@ -166,7 +119,7 @@ setfacl -R -m user:turnserver:rwX  /var/log/$app
 #=================================================
 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
 
-yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$turnserver_tls_port"
+yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port_turnserver_tls"
 
 #=================================================
 # START SYSTEMD SERVICE
@@ -176,25 +129,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
 # Start a systemd service
 ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/$app/$app.log"
 
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# WARNING : theses command are used in INSTALL, RESTORE
-# For any update do it in all files
-
-echo "Coturn server was successfully installed :)
-
-For testing we can use Trickle-Ice testing tool. Go to trickle-ice page https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ and enter following details.
-
-STUN or TURN URI: turn:$domain:$turnserver_tls_port
-TURN username:    turnserver
-TURN password:    $turnserver_pwd
-
-If you're facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/coturn_ynh" > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --type="install"
-
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/remove b/scripts/remove
index 88dd904..6c47d00 100644
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,17 +9,6 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
-turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port)
-
 #=================================================
 # STANDARD REMOVE
 #=================================================
@@ -41,14 +30,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
 # Remove the dedicated systemd config
 ynh_remove_systemd_config
 
-#=================================================
-# REMOVE DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Removing dependencies..." --weight=1
-
-# Remove metapackage and its dependencies
-ynh_remove_app_dependencies
-
 #=================================================
 # REMOVE APP MAIN DIR
 #=================================================
@@ -84,22 +65,6 @@ ynh_secure_remove --file=/var/log/$app
 # Remove the sqlitedb file
 #ynh_secure_remove --file=/var/lib/turn
 
-#=================================================
-# CLOSE PORTS
-#=================================================
-
-if yunohost firewall list | grep -q "\- $turnserver_tls_port$"
-then
-    ynh_script_progression --message="Closing port $turnserver_tls_port..." --weight=1
-    ynh_exec_warn_less yunohost firewall disallow Both $turnserver_tls_port 
-fi
-
-if yunohost firewall list | grep -q "\- $turnserver_alt_tls_port$"
-then
-    ynh_script_progression --message="Closing port $turnserver_alt_tls_port..." --weight=1
-    ynh_exec_warn_less yunohost firewall disallow Both $turnserver_alt_tls_port
-fi
-
 #=================================================
 # GENERIC FINALIZATION
 #=================================================
@@ -109,7 +74,6 @@ ynh_script_progression --message="Removing the dedicated system user..." --weigh
 
 # Delete a system user
 deluser turnserver ssl-cert
-ynh_system_user_delete --username=turnserver
 
 #=================================================
 # END OF SCRIPT
diff --git a/scripts/restore b/scripts/restore
index 8d0dc96..3c4a2e0 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -9,31 +9,6 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
-turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port)
-
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Installing dependencies..." --weight=5
-
-ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # RESTORE COTURN CONFIGURATION
 #=================================================
@@ -60,7 +35,6 @@ ynh_restore_file --origin_path="/var/log/$app"
 ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
 
 # Create the dedicated user (if not existing)
-ynh_system_user_create --username=turnserver
 adduser turnserver ssl-cert
 
 #=================================================
@@ -90,16 +64,6 @@ chown -R turnserver:root /var/log/$app
 chown turnserver:root /etc/turnserver.conf
 setfacl -R -m user:turnserver:rwX  /var/log/$app
 
-#=================================================
-# SPECIFIC RESTORATION
-#=================================================
-# REINSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Reinstalling dependencies..." --weight=1
-
-# Define and install dependencies
-ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # RESTORE SYSTEMD
 #=================================================
@@ -113,15 +77,7 @@ systemctl enable $app.service --quiet
 #=================================================
 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
 
-yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$turnserver_tls_port"
-
-#=================================================
-# OPEN THE PORT
-#=================================================
-
-# Ouvre le port dans le firewall
-ynh_exec_warn_less yunohost firewall allow Both $turnserver_tls_port
-ynh_exec_warn_less yunohost firewall allow Both $turnserver_alt_tls_port
+yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port_turnserver_tls"
 
 #=================================================
 # START SYSTEMD SERVICE
diff --git a/scripts/upgrade b/scripts/upgrade
index 25fa4b7..8297176 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,40 +9,12 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
-turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port)
-cli_port=$(ynh_app_setting_get --app=$app --key=cli_port)
-turnserver_pwd=$(ynh_app_setting_get --app=$app --key=turnserver_pwd)
-
 #=================================================
 # CHECK VERSION
 #=================================================
 
 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=1
-
-# Backup the current version of the app
-ynh_backup_before_upgrade
-ynh_clean_setup () {
-	# Restore it if the upgrade fails
-	ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
 #=================================================
 # STANDARD UPGRADE STEPS
 #=================================================
@@ -52,20 +24,12 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
 
 ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
 
-#=================================================
-# UPGRADE DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Upgrading dependencies..." --weight=1
-
-ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
 ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
 
 # Create a dedicated user (if not existing)
-ynh_system_user_create --username=turnserver
 adduser turnserver ssl-cert
 
 #=================================================
@@ -76,6 +40,7 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
 mkdir -p /var/log/$app
 # Create systemd service for turnserver
 cp ../conf/default.coturn /etc/default/coturn
+
 # Create a dedicated systemd config
 ynh_add_systemd_config
 
@@ -109,11 +74,10 @@ ynh_store_file_checksum --file="$coturn_config_path"
 
 # WARNING : theses command are used in INSTALL, UPGRADE
 # For any update do it in all files
-data_path="/home/yunohost.app/$app"
-mkdir -p $data_path
-cp -f ../sources/Coturn_config_rotate.sh $data_path/
-ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=$data_path/Coturn_config_rotate.sh
-chmod +x $data_path/Coturn_config_rotate.sh
+cp -f ../sources/Coturn_config_rotate.sh $data_dir/
+ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=$data_dir/Coturn_config_rotate.sh
+
+chmod +x $data_dir/Coturn_config_rotate.sh
 
 #=================================================
 # SET COTURN CRON
@@ -147,7 +111,7 @@ ynh_use_logrotate --logfile "/var/log/$app"
 #=================================================
 
 # Set permissions to app files
-chown root: -R $data_path
+chown root: -R $data_dir
 chown -R turnserver:root /var/log/$app
 chown turnserver:root /etc/turnserver.conf
 setfacl -R -m user:turnserver:rwX  /var/log/$app
@@ -157,7 +121,7 @@ setfacl -R -m user:turnserver:rwX  /var/log/$app
 #=================================================
 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
 
-yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$turnserver_tls_port"
+yunohost service add $app --description="Coturn TURN server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port_turnserver_tls"
 
 #=================================================
 # START SYSTEMD SERVICE
diff --git a/tests.toml b/tests.toml
new file mode 100644
index 0000000..3f6472f
--- /dev/null
+++ b/tests.toml
@@ -0,0 +1,9 @@
+test_format = 1.0
+
+[default]
+
+    # ------------
+    # Tests to run
+    # ------------
+
+        test_upgrade_from.2b6e951d.name = "Upgrade from 4.5.2.3"