diff --git a/README.md b/README.md index 1ede895..304a62e 100644 --- a/README.md +++ b/README.md @@ -16,21 +16,17 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -MiniDLNA is a simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients. - - -**Shipped version:** 1.0~ynh9 -## Disclaimers / important information - -## Configuration - -Edit the file `/etc/minidlna.conf` to adjust the configuration of MiniDLNA. +MiniDLNA is a lightweight [DLNA](https://fr.wikipedia.org/wiki/Digital_Living_Network_Alliance) server. +It allows to easily share multimedia files with any compatible devices present on the LAN. +MiniDLNA does not have a graphical interface, but does not require any special configuration. ## YunoHost specific features * Use shared Multimedia Directories * Linked to transmission, Nextcloud and all other app which use Multimedia Directories. + +**Shipped version:** 1.3.0~ynh1 ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 50bcf6d..c70630f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,21 +16,17 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -MiniDLNA est un simple serveur multimédia, dont le but est d'être entièrement compatible avec les clients DLNA/UPnP-AV. - - -**Version incluse :** 1.0~ynh9 -## Avertissements / informations importantes - -## Configuration - -Éditez le fichier `/etc/minidlna.conf` pour ajuster la configuration de MiniDLNA. +MiniDLNA est un serveur [DLNA](https://fr.wikipedia.org/wiki/Digital_Living_Network_Alliance) ultra léger. +Il permet de partager très simplement les fichiers multimédias avec tout les appareils compatibles présent sur le réseau local. +Minidlna ne dispose pas d'une interface graphique, mais ne nécessite pas de configuration particulière. ## Fonctionnalités spécifiques à YunoHost * Utilise les répertoires multimédia partagés. * Lié à transmission, Nextcloud et toute autre application qui utilise les répertoires multimédia. + +**Version incluse :** 1.3.0~ynh1 ## Documentations et ressources * Site officiel de l’app : diff --git a/app_minidlna.md b/app_minidlna.md index 7095713..740e3e2 100644 --- a/app_minidlna.md +++ b/app_minidlna.md @@ -1,11 +1,5 @@ -# MiniDLNA - -MiniDLNA is a lightweight [DLNA](https://fr.wikipedia.org/wiki/Digital_Living_Network_Alliance) server. -It allows to easily share multimedia files with any compatible devices present on the LAN. - -MiniDLNA does not have a graphical interface, but does not require any special configuration. - ### What multimedia files are shared? + MiniDLNA is sharing the folder `/home/yunohost.multimedia/share`, which is common to each user in `/home/$USER/Multimedia/Share`. [More information about multimedia files here.](https://github.com/YunoHost-Apps/yunohost.multimedia) diff --git a/app_minidlna_fr.md b/app_minidlna_fr.md index 6c2493a..358b653 100644 --- a/app_minidlna_fr.md +++ b/app_minidlna_fr.md @@ -1,11 +1,4 @@ -# MiniDLNA - -MiniDLNA est un serveur [DLNA](https://fr.wikipedia.org/wiki/Digital_Living_Network_Alliance) ultra léger. -Il permet de partager très simplement les fichiers multimédias avec tout les appareils compatibles présent sur le réseau local. - -Minidlna ne dispose pas d'une interface graphique, mais ne nécessite pas de configuration particulière. - -### Quels fichiers multimédias sont partagés? +### Quels fichiers multimédias sont partagés ? Minidlna partage le dossier `/home/yunohost.multimedia/share`, qui est commun à chaque utilisateur dans le dossier `/home/$USER/Multimedia/Share`. diff --git a/check_process b/check_process deleted file mode 100644 index 817b6b6..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test paquet stable - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=0 - setup_nourl=1 - setup_private=0 - setup_public=0 - upgrade=1 - #upgrade=1 from_commit=2c107b09144c9829be5cc94b202d0f766b2a0db4 - #upgrade=1 from_commit=7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 - backup_restore=1 - multi_instance=0 - change_url=0 -;;; Upgrade options - ; commit=2c107b09144c9829be5cc94b202d0f766b2a0db4 - name=01 May 2017 2c107b09144c9829be5cc94b202d0f766b2a0db4 - manifest_arg=version=A. Version of the Debian repositories - recommended& - ; commit=7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 - name=20 Jun 2019 7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 - manifest_arg=version=B. Latest version available for Debian& diff --git a/config_panel.toml.old b/config_panel.toml.old deleted file mode 100644 index b771f08..0000000 --- a/config_panel.toml.old +++ /dev/null @@ -1,19 +0,0 @@ -version = "0.1" -name = "Minidlna configuration panel" - - -[main] -name = "Minidlna configuration" - - [main.minidlna_configuration] - name = "Minidlna configuration" - - [main.minidlna_configuration.root_container] - ask = "Type of directory shown to the clients ?" - choices = ["Standard container", "Browse Directory", "Music", "Pictures", "Video"] - default = "Browse Directory" - - [main.minidlna_configuration.friendly_name] - ask = "Name of DLNA server shown to clients ?" - type = "text" - default = "Yunohost DLNA" diff --git a/doc/ADMIN.md b/doc/ADMIN.md new file mode 100644 index 0000000..da9225e --- /dev/null +++ b/doc/ADMIN.md @@ -0,0 +1,5 @@ +## Configuration + +Edit the file `/etc/minidlna.conf` to adjust the configuration of MiniDLNA. + +MiniDLNA is going to serve the files present in the directory `/home/yunohost.multimedia/share \ No newline at end of file diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md new file mode 100644 index 0000000..bd0bd31 --- /dev/null +++ b/doc/ADMIN_fr.md @@ -0,0 +1,5 @@ +## Configuration + +Éditez le fichier `/etc/minidlna.conf` pour ajuster la configuration de MiniDLNA. + +MiniDLNA va servir les fichiers présents dans le répertoire `/home/yunohost.multimedia/share` \ No newline at end of file diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 7134d3d..76e96cb 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1,8 @@ -MiniDLNA is a simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients. +MiniDLNA is a lightweight [DLNA](https://fr.wikipedia.org/wiki/Digital_Living_Network_Alliance) server. +It allows to easily share multimedia files with any compatible devices present on the LAN. +MiniDLNA does not have a graphical interface, but does not require any special configuration. + +## YunoHost specific features + +* Use shared Multimedia Directories +* Linked to transmission, Nextcloud and all other app which use Multimedia Directories. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 11a2a0a..d225cec 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1,8 @@ -MiniDLNA est un simple serveur multimédia, dont le but est d'être entièrement compatible avec les clients DLNA/UPnP-AV. +MiniDLNA est un serveur [DLNA](https://fr.wikipedia.org/wiki/Digital_Living_Network_Alliance) ultra léger. +Il permet de partager très simplement les fichiers multimédias avec tout les appareils compatibles présent sur le réseau local. +Minidlna ne dispose pas d'une interface graphique, mais ne nécessite pas de configuration particulière. + +## Fonctionnalités spécifiques à YunoHost + +* Utilise les répertoires multimédia partagés. +* Lié à transmission, Nextcloud et toute autre application qui utilise les répertoires multimédia. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index c283755..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,8 +0,0 @@ -## Configuration - -Edit the file `/etc/minidlna.conf` to adjust the configuration of MiniDLNA. - -## YunoHost specific features - -* Use shared Multimedia Directories -* Linked to transmission, Nextcloud and all other app which use Multimedia Directories. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md deleted file mode 100644 index fadd206..0000000 --- a/doc/DISCLAIMER_fr.md +++ /dev/null @@ -1,8 +0,0 @@ -## Configuration - -Éditez le fichier `/etc/minidlna.conf` pour ajuster la configuration de MiniDLNA. - -## Fonctionnalités spécifiques à YunoHost - -* Utilise les répertoires multimédia partagés. -* Lié à transmission, Nextcloud et toute autre application qui utilise les répertoires multimédia. diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 928aba4..0000000 --- a/manifest.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "MiniDLNA", - "id": "minidlna", - "packaging_format": 1, - "description": { - "en": "Light DLNA server to share media files over the LAN", - "fr": "Serveur DLNA léger pour partager les fichiers multimédia sur le réseau local" - }, - "version": "1.0~ynh9", - "url": "http://minidlna.sourceforge.net/", - "upstream": { - "license": "GPL-2.0", - "website": "http://minidlna.sourceforge.net" - }, - "license": "GPL-2.0", - "maintainer": { - "name": "", - "email": "" - }, - "previous_maintainers": [{ - "name": "Maniack Crudelis", - "email": "maniackc_dev@crudelis.fr" - }], - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": false, - "services": [], - "arguments": { - "install" : [] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..3ccbd61 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,46 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +packaging_format = 2 + +id = "minidlna" +name = "MiniDLNA" +description.en = "Light DLNA server to share media files over the LAN" +description.fr = "Serveur DLNA léger pour partager les fichiers multimédia sur le réseau local" + +version = "1.3.0~ynh1" + +maintainers = [] + +[upstream] +license = "GPL-2.0" +website = "http://minidlna.sourceforge.net" +cpe = "cpe:2.3:a:readymedia_project:readymedia" + +[integration] +yunohost = ">= 11.2" +architectures = "all" +multi_instance = false + +ldap = false + +sso = false + +disk = "50M" +ram.build = "250M" +ram.runtime = "50M" + +[install] + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + + [resources.ports] + main.default = 48200 + main.exposed = "TCP" + + [resources.apt] + packages = "minidlna" diff --git a/scripts/_common.sh b/scripts/_common.sh index 1f0f9bd..e97e4ad 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,20 +4,16 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -pkg_dependencies="minidlna" - #================================================= # PACKAGE CHECK BYPASSING... #================================================= -IS_PACKAGE_CHECK () { - if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ] - then - return 0 - else - return 1 - fi +IS_PACKAGE_CHECK() { + if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then + return 0 + else + return 1 + fi } #================================================= @@ -28,142 +24,3 @@ IS_PACKAGE_CHECK () { #================================================= # 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="This is an automated message from your beloved YunoHost server. - -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 cb34770..6cc779f 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -6,24 +6,9 @@
 # IMPORT GENERIC HELPERS
 #=================================================
 
-# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_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
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_print_info --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
 #=================================================
 # DECLARE DATA AND CONF FILES TO BACKUP
 #=================================================
diff --git a/scripts/install b/scripts/install
index a8ab94e..8c01510 100644
--- a/scripts/install
+++ b/scripts/install
@@ -9,26 +9,13 @@
 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
-#=================================================
-
-app=$YNH_APP_INSTANCE_NAME
-
 #=================================================
 # STORE SETTINGS FROM MANIFEST
 #=================================================
 ynh_script_progression --message="Storing installation settings..." --weight=2
 
-ynh_app_setting_set --app=$app --key=overwrite_settings --value=1
-ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
+ynh_app_setting_set --app="$app" --key=overwrite_settings --value=1
+ynh_app_setting_set --app="$app" --key=admin_mail_html --value=1
 
 #=================================================
 # STANDARD MODIFICATIONS
@@ -37,21 +24,8 @@ ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
 #=================================================
 ynh_script_progression --message="Configuring firewall..." --weight=15
 
-# Find a free port
-port=$(ynh_find_port --port=48200)
-
-# Open ports
-ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port
 # Discovery Protocol SSDP for UPNP.
 ynh_exec_fully_quiet yunohost firewall allow --no-upnp UDP 1900
-ynh_app_setting_set --app=$app --key=port --value=$port
-
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Installing dependencies..." --weight=45
-
-ynh_install_app_dependencies $pkg_dependencies
 
 #=================================================
 # SPECIFIC SETUP
@@ -65,14 +39,13 @@ ynh_multimedia_build_main_dir
 #=================================================
 # INCREASE INOTIFY'S LIMITS
 #=================================================
-ynh_script_progression --message="Increasing inotify's limits..."
+ynh_script_progression --message="Increasing inotify's limits..." --weight=1
 
 # Increase the maximum number of files inotify can monitor.
 cp -a ../conf/90-inotify_minidlna.conf /etc/sysctl.d/
 # Then, reload the kernel configuration.
-if ! IS_PACKAGE_CHECK   # LXC doesn't allow sysctl to play with kernel options.
-then
-	sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf
+if ! IS_PACKAGE_CHECK; then   # LXC doesn't allow sysctl to play with kernel options.
+    sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf
 fi
 
 #=================================================
@@ -83,11 +56,11 @@ ynh_script_progression --message="Configuring MiniDLNA..." --weight=2
 ynh_replace_string --match_string="^#*media_dir=.*" --replace_string="media_dir=/home/yunohost.multimedia/share" --target_file=/etc/minidlna.conf
 ynh_replace_string --match_string="^#*port=.*" --replace_string="port=$port" --target_file=/etc/minidlna.conf
 friendly_name="Yunohost DLNA"
-ynh_app_setting_set --app=$app --key=friendly_name --value="$friendly_name"
+ynh_app_setting_set --app="$app" --key=friendly_name --value="$friendly_name"
 ynh_replace_string --match_string="^#*friendly_name=.*" --replace_string="friendly_name=$friendly_name" --target_file=/etc/minidlna.conf
 root_container="B"
 ynh_replace_string --match_string="^#*root_container=.*" --replace_string="root_container=$root_container" --target_file=/etc/minidlna.conf
-ynh_app_setting_set --app=$app --key=root_container --value="$root_container"
+ynh_app_setting_set --app="$app" --key=root_container --value="$root_container"
 ynh_replace_string --match_string="^#wide_links=.*" --replace_string="wide_links=yes" --target_file=/etc/minidlna.conf
 
 # Calculate and store the config file checksum into the app settings
@@ -96,9 +69,9 @@ ynh_store_file_checksum --file="/etc/minidlna.conf"
 #=================================================
 # INTEGRATE SERVICE IN YUNOHOST
 #=================================================
-ynh_script_progression --message="Integrating service in YunoHost..."
+ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
 
-yunohost service add $app --log="/var/log/$app.log" --needs_exposed_ports="1900"
+yunohost service add "$app" --log="/var/log/$app.log" --needs_exposed_ports="1900"
 
 #=================================================
 # START SYSTEMD SERVICE
@@ -106,23 +79,7 @@ yunohost service add $app --log="/var/log/$app.log" --needs_exposed_ports="1900"
 ynh_script_progression --message="Starting a systemd service..." --weight=4
 
 # Start a systemd service
-ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app.log"
-
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# Get main domain and buid the url of the admin panel of the app.
-admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-
-echo "You can find a config file at /etc/minidlna.conf
-
-MiniDLNA is going to serve the files present in the directory /home/yunohost.multimedia/share
-
-Please have a look to the documentation to learn more how to use MiniDLNA, https://yunohost.org/#/app_minidlna
-" > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type=install
+ynh_systemd_action --service_name="$app" --action="restart" --log_path="/var/log/$app.log"
 
 #=================================================
 # END OF SCRIPT
diff --git a/scripts/remove b/scripts/remove
index 6ba4007..4fb59d4 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,15 +9,6 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=2
-
-app=$YNH_APP_INSTANCE_NAME
-
-port=$(ynh_app_setting_get --app=$app --key=port)
-
 #=================================================
 # STANDARD REMOVE
 #=================================================
@@ -25,30 +16,15 @@ port=$(ynh_app_setting_get --app=$app --key=port)
 #=================================================
 
 # 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
-	ynh_script_progression --message="Removing $app service integration..."
-	yunohost service remove $app
+if ynh_exec_warn_less yunohost service status $app >/dev/null; then
+    ynh_script_progression --message="Removing $app service integration..."
+    yunohost service remove $app
 fi
 
-#=================================================
-# REMOVE DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Removing dependencies..."
-
-# Remove metapackage and its dependencies
-ynh_remove_app_dependencies
-
 #=================================================
 # CLOSE A PORT
 #=================================================
 
-if yunohost firewall list | grep -q "\- $port$"
-then
-	ynh_script_progression --message="Closing port $port..."
-	ynh_exec_warn_less yunohost firewall disallow TCP $port
-fi
-
 ynh_exec_fully_quiet yunohost firewall disallow UDP 1900
 
 #=================================================
@@ -56,15 +32,15 @@ ynh_exec_fully_quiet yunohost firewall disallow UDP 1900
 #=================================================
 # REMOVE VARIOUS FILES
 #=================================================
-ynh_script_progression --message="Removing various files..."
+ynh_script_progression --message="Removing various files..." --weight=1
 
 if [ -e "/etc/sysctl.d/90-inotify_minidlna.conf" ]; then
-	ynh_secure_remove --file="/etc/sysctl.d/90-inotify_minidlna.conf"
-	# Reload the kernel configuration.
-	if ! IS_PACKAGE_CHECK   # LXC doesn't allow sysctl to play with kernel options.
-	then
-		sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf
-	fi
+    ynh_secure_remove --file="/etc/sysctl.d/90-inotify_minidlna.conf"
+    # Reload the kernel configuration.
+    if ! IS_PACKAGE_CHECK   # LXC doesn't allow sysctl to play with kernel options.
+    then
+        sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf
+    fi
 fi
 
 #=================================================
diff --git a/scripts/restore b/scripts/restore
index eb8bb1f..c8370de 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,25 +10,6 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
-	ynh_clean_check_starting
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
-port=$(ynh_app_setting_get --app=$app --key=port)
-
 #=================================================
 # SPECIFIC RESTORE
 #=================================================
@@ -36,7 +17,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
 #=================================================
 ynh_script_progression --message="Configuring firewall..." --weight=15
 
-ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port
 # Discovery Protocol SSDP for UPNP.
 ynh_exec_fully_quiet yunohost firewall allow --no-upnp UDP 1900
 
@@ -47,56 +27,32 @@ ynh_script_progression --message="Creating yunohost.multimedia directory..." --w
 
 ynh_multimedia_build_main_dir
 
-#=================================================
-# REINSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Reinstalling dependencies..." --weight=45
-
-# Define and install dependencies
-ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # RESTORE VARIOUS FILES
 #=================================================
-ynh_script_progression --message="Restoring various files..."
+ynh_script_progression --message="Restoring various files..." --weight=1
 
 ynh_restore_file --origin_path="/etc/sysctl.d/90-inotify_minidlna.conf"
-if ! IS_PACKAGE_CHECK   # LXC doesn't allow sysctl to play with kernel options.
-then
-	sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf
+if ! IS_PACKAGE_CHECK; then   # LXC doesn't allow sysctl to play with kernel options.
+    sysctl -p /etc/sysctl.d/90-inotify_minidlna.conf
 fi
 # Delete the current config of minidlna, in order to replace it by the version from the backup
 ynh_secure_remove --file="/etc/minidlna.conf"
 ynh_restore_file --origin_path="/etc/minidlna.conf"
+
 #=================================================
 # INTEGRATE SERVICE IN YUNOHOST
 #=================================================
-ynh_script_progression --message="Integrating service in YunoHost..."
+ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
 
-yunohost service add $app --log="/var/log/$app.log" --needs_exposed_ports="1900"
+yunohost service add "$app" --log="/var/log/$app.log" --needs_exposed_ports="1900"
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
-ynh_script_progression --message="Starting a systemd service..."
+ynh_script_progression --message="Starting a systemd service..." --weight=1
 
-ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/$app.log"
-
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# Get main domain and buid the url of the admin panel of the app.
-admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-
-echo "You can find a config file at /etc/minidlna.conf
-
-MiniDLNA is going to serve the files present in the directory /home/yunohost.multimedia/share
-
-Please have a look to the documentation to learn more how to use MiniDLNA, https://yunohost.org/#/app_minidlna
-" > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type=restore
+ynh_systemd_action --service_name="$app" --action=restart --log_path="/var/log/$app.log"
 
 #=================================================
 # END OF SCRIPT
diff --git a/scripts/upgrade b/scripts/upgrade
index b3abfb6..ea5b6e4 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,77 +9,41 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=2
-
-app=$YNH_APP_INSTANCE_NAME
-
-version=$(ynh_app_setting_get --app=$app --key=version)
-port=$(ynh_app_setting_get --app=$app --key=port)
-overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings)
-root_container=$(ynh_app_setting_get --app=$app --key=root_container)
-friendly_name=$(ynh_app_setting_get --app=$app --key=friendly_name)
-
 #=================================================
 # CHECK VERSION
 #=================================================
-ynh_script_progression --message="Checking 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)..."
-
-# Backup the current version of the app
-ynh_backup_before_upgrade
-ynh_clean_setup () {
-	ynh_clean_check_starting
-	# Restore it if the upgrade fails
-	ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
 #=================================================
 # ENSURE DOWNWARD COMPATIBILITY
 #=================================================
-ynh_script_progression --message="Ensuring downward compatibility..."
+ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
 
 # If overwrite_settings doesn't exist, create it
-if [ -z "$overwrite_settings" ]; then
+if [ -z "${overwrite_settings:-}" ]; then
 	overwrite_settings=1
 	ynh_app_setting_set --app=$app --key=overwrite_settings --value=$overwrite_settings
 fi
 
 # If root_container doesn't exist, create it
-if [ -z "$root_container" ]; then
+if [ -z "${root_container:-}" ]; then
 	root_container="B"
 	ynh_app_setting_set --app=$app --key=root_container --value=$root_container
 fi
 
 # If friendly_name doesn't exist, create it
-if [ -z "$friendly_name" ]; then
-	friendly_name="Yunohost DLNA"
+if [ -z "${friendly_name:-}" ]; then
+	friendly_name="YunoHost DLNA"
 	ynh_app_setting_set --app=$app --key=friendly_name --value=$friendly_name
 fi
 
 # If version exists, remove the backport source list, as it's no longer used.
-if [ -n "$version" ]; then
+if [ -n "${version:-}" ]; then
 	ynh_secure_remove --file="/etc/apt/sources.list.d/minidlna.list"
 	ynh_app_setting_delete --app=$app --key=version
 fi
 
-#=================================================
-# UPGRADE DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Upgrading dependencies..." --weight=3
-
-ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # SPECIFIC UPGRADE
 #=================================================
@@ -126,7 +90,7 @@ fi
 #=================================================
 # INTEGRATE SERVICE IN YUNOHOST
 #=================================================
-ynh_script_progression --message="Integrating service in YunoHost..."
+ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
 
 yunohost service add $app --log="/var/log/$app.log" --needs_exposed_ports="1900"
 
@@ -137,22 +101,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=7
 
 ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app.log"
 
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# Get main domain and buid the url of the admin panel of the app.
-admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-
-echo "You can find a config file at /etc/minidlna.conf
-
-MiniDLNA is going to serve the files present in the directory /home/yunohost.multimedia/share
-
-Please have a look to the documentation to learn more how to use MiniDLNA, https://yunohost.org/#/app_minidlna
-" > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type=upgrade
-
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/tests.toml b/tests.toml
new file mode 100644
index 0000000..953b195
--- /dev/null
+++ b/tests.toml
@@ -0,0 +1,9 @@
+#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
+
+test_format = 1.0
+
+[default]
+
+    # ------------
+    # Tests to run
+    # ------------