From 79b86138c1e4455cde05425516b63434c1a677ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 12 Mar 2023 12:21:52 +0100 Subject: [PATCH] v2 --- conf/cron_coturn | 2 +- conf/turnserver.conf | 6 +- doc/{DISCLAIMER.md => ADMIN.md} | 2 +- doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 6 +- doc/POST_INSTALL.md | 5 + manifest.json | 35 ------- manifest.toml | 30 ++++-- scripts/_common.sh | 140 -------------------------- scripts/backup | 18 +--- scripts/install | 81 ++------------- scripts/remove | 36 ------- scripts/restore | 38 +------ scripts/upgrade | 34 ++----- tests.toml | 7 ++ 14 files changed, 56 insertions(+), 384 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (82%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (75%) create mode 100644 doc/POST_INSTALL.md delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/conf/cron_coturn b/conf/cron_coturn index 89b54ba..5b4ee3f 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; \ No newline at end of file +*/15 * * * * root bash /__DATA_DIR__/Coturn_config_rotate.sh; \ No newline at end of file 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 737d7de..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~ynh1", - "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 index c7760fb..ce8319f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,28 +13,36 @@ maintainers = ["eric_G"] license = "BSD-3-Clause" admindoc = "https://github.com/coturn/coturn/wiki" code = "https://github.com/coturn/coturn" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -website = "https://github.com/coturn/coturn" -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.15" +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core 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 34d6eb9..599c71e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="sqlite3 libsqlite3-dev coturn acl" - #================================================= # PERSONAL HELPERS #================================================= @@ -14,140 +11,3 @@ #================================================= # 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 -#REMOVEME? 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 d7cd029..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
-#=================================================
-
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_print_info --message="Loading installation settings..."
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-#REMOVEME? 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 54584a1..43f2f8f 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
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# RETRIEVE ARGUMENTS FROM THE MANIFEST
-#=================================================
-
-#REMOVEME? domain=$YNH_APP_ARG_DOMAIN
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
 #=================================================
 # STORE SETTINGS FROM MANIFEST
 #=================================================
-#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=4
 
-#REMOVEME? 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
-#=================================================
-#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=3
-
-# Find an available port
-#REMOVEME? turnserver_tls_port=$(ynh_find_port --port=5349)
-#REMOVEME? turnserver_alt_tls_port=$(ynh_find_port --port=$((turnserver_tls_port+1)))
-#REMOVEME? 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
-#REMOVEME? ynh_app_setting_set --app=$app --key=turnserver_tls_port --value=$turnserver_tls_port
-#REMOVEME? ynh_app_setting_set --app=$app --key=turnserver_alt_tls_port --value=$turnserver_alt_tls_port
-#REMOVEME? ynh_app_setting_set --app=$app --key=cli_port --value=$cli_port
-
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5
-
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3
+ynh_script_progression --message="Configuring system user..." --weight=3
 
 # Create a system user
-#REMOVEME? ynh_system_user_create --username=turnserver
 adduser turnserver ssl-cert
 
 #=================================================
@@ -130,11 +84,13 @@ 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
+#data_path="/home/yunohost.app/$app"
+#mkdir -p $data_path
+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
+#ynh_add_config --template="../sources/Coturn_config_rotate.sh" --destination="$data_dir/Coturn_config_rotate.sh"
+
+chmod +x $data_dir/Coturn_config_rotate.sh
 
 #=================================================
 # SET COTURN CRON
@@ -156,7 +112,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
@@ -176,25 +132,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 a6e25c4..c70401a 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? turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
-#REMOVEME? 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
-#=================================================
-#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1
-
-# Remove metapackage and its dependencies
-#REMOVEME? 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 @@ fi
 
 # Delete a system user
 deluser turnserver ssl-cert
-#REMOVEME? ynh_system_user_delete --username=turnserver
 
 #=================================================
 # END OF SCRIPT
diff --git a/scripts/restore b/scripts/restore
index 8196d39..22ae1af 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -9,31 +9,6 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# 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? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-#REMOVEME? turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
-#REMOVEME? turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port)
-
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5
-
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # RESTORE COTURN CONFIGURATION
 #=================================================
@@ -57,10 +32,9 @@ ynh_restore_file --origin_path="/var/log/$app"
 #=================================================
 # RECREATE THE DEDICATED USER
 #=================================================
-#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
+ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
 
 # Create the dedicated user (if not existing)
-#REMOVEME? ynh_system_user_create --username=turnserver
 adduser turnserver ssl-cert
 
 #=================================================
@@ -113,15 +87,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 2a10940..35d0a04 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -29,20 +29,6 @@ source /usr/share/yunohost/helpers
 
 upgrade_type=$(ynh_check_app_version_changed)
 
-#=================================================
-# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
-#=================================================
-#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
-
-# Backup the current version of the app
-#REMOVEME? ynh_backup_before_upgrade
-#REMOVEME? ynh_clean_setup () {
-	# Restore it if the upgrade fails
-#REMOVEME? 	ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
 #=================================================
 # STANDARD UPGRADE STEPS
 #=================================================
@@ -52,20 +38,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
-#=================================================
-#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1
-
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # CREATE DEDICATED USER
 #=================================================
-#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
+ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
 
 # Create a dedicated user (if not existing)
-#REMOVEME? ynh_system_user_create --username=turnserver
 adduser turnserver ssl-cert
 
 #=================================================
@@ -109,10 +87,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
+#data_path="/home/yunohost.app/$app"
+#mkdir -p $data_path
+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_path/Coturn_config_rotate.sh
 
 #=================================================
@@ -147,7 +125,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
diff --git a/tests.toml b/tests.toml
new file mode 100644
index 0000000..91daf17
--- /dev/null
+++ b/tests.toml
@@ -0,0 +1,7 @@
+test_format = 1.0
+
+[default]
+
+    # ------------
+    # Tests to run
+    # ------------
\ No newline at end of file