From 5e192ac24ad3caadb0a1bdeb0e88c17a51cf8162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:25:48 +0100 Subject: [PATCH 01/11] v2 --- manifest.toml | 35 +++++++++++++++++++++++++++++++++++ scripts/_common.sh | 4 ++-- scripts/backup | 6 +++--- scripts/install | 16 ++++++++-------- scripts/remove | 10 +++++----- scripts/restore | 14 +++++++------- scripts/upgrade | 28 ++++++++++++++-------------- 7 files changed, 74 insertions(+), 39 deletions(-) create mode 100644 manifest.toml diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..6dfe401 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,35 @@ +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.0~ynh9" + +maintainers = [] + +[upstream] +license = "GPL-2.0" +website = "http://minidlna.sourceforge.net" +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) +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 = ">= 4.3.0" +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"] +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, ... + +[install] + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] diff --git a/scripts/_common.sh b/scripts/_common.sh index 1f0f9bd..f212503 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="minidlna" +#REMOVEME? pkg_dependencies="minidlna" #================================================= # PACKAGE CHECK BYPASSING... @@ -52,7 +52,7 @@ ynh_send_readme_to_admin() { type="${type:-install}" # Get the value of admin_mail_html - admin_mail_html=$(ynh_app_setting_get $app 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 diff --git a/scripts/backup b/scripts/backup index cb34770..8d7abb2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,14 +15,14 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/install b/scripts/install index a8ab94e..a586a44 100644 --- a/scripts/install +++ b/scripts/install @@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 +#REMOVEME? 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 +#REMOVEME? ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 #================================================= # STANDARD MODIFICATIONS @@ -38,20 +38,20 @@ 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) +#REMOVEME? 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 +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=45 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=45 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC SETUP diff --git a/scripts/remove b/scripts/remove index 6ba4007..a415f6e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,11 +12,11 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # STANDARD REMOVE @@ -34,10 +34,10 @@ fi #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +#REMOVEME? ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # CLOSE A PORT diff --git a/scripts/restore b/scripts/restore index eb8bb1f..11b7404 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,20 +14,20 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # SPECIFIC RESTORE @@ -50,10 +50,10 @@ ynh_multimedia_build_main_dir #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=45 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=45 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE VARIOUS FILES diff --git a/scripts/upgrade b/scripts/upgrade index b3abfb6..d9dc53f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? 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) +#REMOVEME? version=$(ynh_app_setting_get --app=$app --key=version) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings) +#REMOVEME? root_container=$(ynh_app_setting_get --app=$app --key=root_container) +#REMOVEME? friendly_name=$(ynh_app_setting_get --app=$app --key=friendly_name) #================================================= # CHECK VERSION @@ -32,17 +32,17 @@ 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)..." +#REMOVEME? 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 () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -76,9 +76,9 @@ fi #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=3 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=3 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC UPGRADE From 67da09d5482bb60f2f8bf45843f5c4cb08ee0b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:30:13 +0100 Subject: [PATCH 02/11] v2 --- manifest.toml | 26 +++++++++++++++++--------- scripts/backup | 14 -------------- scripts/install | 26 -------------------------- 3 files changed, 17 insertions(+), 49 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6dfe401..26714f2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -12,18 +12,19 @@ maintainers = [] [upstream] license = "GPL-2.0" website = "http://minidlna.sourceforge.net" -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) -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 = ">= 4.3.0" -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.2" +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 = false + +sso = false + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] @@ -33,3 +34,10 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.install_dir] [resources.permissions] + + [resources.ports] + main.default = 48200 + main.exposed = "TCP" + + [resources.apt] + packages = "minidlna" diff --git a/scripts/backup b/scripts/backup index 8d7abb2..d1c0fa2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,20 +10,6 @@ source ../settings/scripts/_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 - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index a586a44..6598c1b 100644 --- a/scripts/install +++ b/scripts/install @@ -9,19 +9,6 @@ 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? app=$YNH_APP_INSTANCE_NAME - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -37,21 +24,8 @@ ynh_app_setting_set --app=$app --key=overwrite_settings --value=1 #================================================= ynh_script_progression --message="Configuring firewall..." --weight=15 -# Find a free port -#REMOVEME? 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 -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=45 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC SETUP From 746b053171a59f449916b6f24bcdabe5e5542d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:36:17 +0100 Subject: [PATCH 03/11] v2 --- check_process | 21 ---- config_panel.toml.old | 19 ---- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 doc/POST_INSTALL.md | 3 + manifest.json | 32 ------ scripts/_common.sh | 142 -------------------------- scripts/install | 20 +--- scripts/remove | 23 ----- scripts/restore | 44 -------- scripts/upgrade | 52 ---------- tests.toml | 11 ++ 12 files changed, 16 insertions(+), 351 deletions(-) delete mode 100644 check_process delete mode 100644 config_panel.toml.old rename doc/{DISCLAIMER.md => ADMIN.md} (100%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) create mode 100644 doc/POST_INSTALL.md delete mode 100644 manifest.json create mode 100644 tests.toml 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/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..85da5f7 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,3 @@ +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 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/scripts/_common.sh b/scripts/_common.sh index f212503..b02fb07 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="minidlna" - #================================================= # PACKAGE CHECK BYPASSING... #================================================= @@ -28,142 +25,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 -#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="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/install b/scripts/install
index 6598c1b..3e402a1 100644
--- a/scripts/install
+++ b/scripts/install
@@ -12,10 +12,10 @@ source /usr/share/yunohost/helpers
 #=================================================
 # STORE SETTINGS FROM MANIFEST
 #=================================================
-#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2
+ynh_script_progression --message="Storing installation settings..." --weight=2
 
 ynh_app_setting_set --app=$app --key=overwrite_settings --value=1
-#REMOVEME? ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
+ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
 
 #=================================================
 # STANDARD MODIFICATIONS
@@ -82,22 +82,6 @@ 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
-
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/remove b/scripts/remove
index a415f6e..3818552 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,15 +9,6 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
-
 #=================================================
 # STANDARD REMOVE
 #=================================================
@@ -31,24 +22,10 @@ then
 	yunohost service remove $app
 fi
 
-#=================================================
-# REMOVE DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Removing dependencies..."
-
-# Remove metapackage and its dependencies
-#REMOVEME? ynh_remove_app_dependencies
-
 #=================================================
 # CLOSE A PORT
 #=================================================
 
-if yunohost firewall list | grep -q "\- $port$"
-then
-	ynh_script_progression --message="Closing port $port..."
-	ynh_exec_warn_less yunohost firewall disallow TCP $port
-fi
-
 ynh_exec_fully_quiet yunohost firewall disallow UDP 1900
 
 #=================================================
diff --git a/scripts/restore b/scripts/restore
index 11b7404..3d202bf 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,25 +10,6 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-#REMOVEME? ynh_clean_setup () {
-	ynh_clean_check_starting
-}
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_script_progression --message="Loading installation settings..."
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
-
 #=================================================
 # SPECIFIC RESTORE
 #=================================================
@@ -36,7 +17,6 @@ source /usr/share/yunohost/helpers
 #=================================================
 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,14 +27,6 @@ ynh_script_progression --message="Creating yunohost.multimedia directory..." --w
 
 ynh_multimedia_build_main_dir
 
-#=================================================
-# REINSTALL DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=45
-
-# Define and install dependencies
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # RESTORE VARIOUS FILES
 #=================================================
@@ -82,22 +54,6 @@ ynh_script_progression --message="Starting 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=restore
-
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index d9dc53f..7126dd7 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,41 +9,12 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? version=$(ynh_app_setting_get --app=$app --key=version)
-#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
-#REMOVEME? overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings)
-#REMOVEME? root_container=$(ynh_app_setting_get --app=$app --key=root_container)
-#REMOVEME? 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
-#=================================================
-#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
-
-# Backup the current version of the app
-#REMOVEME? ynh_backup_before_upgrade
-#REMOVEME? ynh_clean_setup () {
-	ynh_clean_check_starting
-	# 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
-
 #=================================================
 # ENSURE DOWNWARD COMPATIBILITY
 #=================================================
@@ -73,13 +44,6 @@ if [ -n "$version" ]; then
 	ynh_app_setting_delete --app=$app --key=version
 fi
 
-#=================================================
-# UPGRADE DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=3
-
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # SPECIFIC UPGRADE
 #=================================================
@@ -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..1774c62
--- /dev/null
+++ b/tests.toml
@@ -0,0 +1,11 @@
+test_format = 1.0
+
+[default]
+
+    # ------------
+    # Tests to run
+    # ------------
+
+     exclude = ["install.subdir", "install.private", "install.multi", "change_url"]  # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url
+    # NB: you should NOT need this except if you really have a good reason...
+

From 6829edc53467be1c445fc8cbd6822b9be68c4cad Mon Sep 17 00:00:00 2001
From: yunohost-bot 
Date: Tue, 9 Jan 2024 18:36:22 +0000
Subject: [PATCH 04/11] Auto-update README

---
 README.md    | 11 -----------
 README_fr.md | 11 -----------
 2 files changed, 22 deletions(-)

diff --git a/README.md b/README.md
index 1ede895..3d1a85b 100644
--- a/README.md
+++ b/README.md
@@ -20,17 +20,6 @@ MiniDLNA is a simple media server software, with the aim of being fully complian
 
 
 **Shipped version:** 1.0~ynh9
-## Disclaimers / important information
-
-## 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.
-
 ## Documentation and resources
 
 * Official app website: 
diff --git a/README_fr.md b/README_fr.md
index 50bcf6d..d5a8486 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -20,17 +20,6 @@ MiniDLNA est un simple serveur multimédia, dont le but est d'être entièrement
 
 
 **Version incluse :** 1.0~ynh9
-## Avertissements / informations importantes
-
-## 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.
-
 ## Documentations et ressources
 
 * Site officiel de l’app : 

From 25d3496415565464f5f52b7f9e4f107c2b146282 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 9 Jan 2024 21:46:15 +0100
Subject: [PATCH 05/11] cleaning

---
 app_minidlna.md       | 8 +-------
 app_minidlna_fr.md    | 9 +--------
 doc/ADMIN_fr.md       | 5 +----
 doc/DESCRIPTION.md    | 9 ++++++++-
 doc/DESCRIPTION_fr.md | 9 ++++++++-
 doc/POST_INSTALL.md   | 3 ---
 manifest.toml         | 4 ++--
 scripts/backup        | 1 -
 scripts/install       | 4 ++--
 scripts/remove        | 2 +-
 scripts/restore       | 7 ++++---
 scripts/upgrade       | 6 +++---
 12 files changed, 31 insertions(+), 36 deletions(-)
 delete mode 100644 doc/POST_INSTALL.md

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/doc/ADMIN_fr.md b/doc/ADMIN_fr.md
index fadd206..bd0bd31 100644
--- a/doc/ADMIN_fr.md
+++ b/doc/ADMIN_fr.md
@@ -2,7 +2,4 @@
 
 É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.
+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/POST_INSTALL.md b/doc/POST_INSTALL.md
deleted file mode 100644
index 85da5f7..0000000
--- a/doc/POST_INSTALL.md
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/manifest.toml b/manifest.toml
index 26714f2..dee3bc3 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -5,7 +5,7 @@ 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.0~ynh9"
+version = "1.3.0~ynh1"
 
 maintainers = []
 
@@ -23,7 +23,7 @@ ldap = false
 sso = false
 
 disk = "50M"
-ram.build = "50M"
+ram.build = "250M"
 ram.runtime = "50M"
 
 [install]
diff --git a/scripts/backup b/scripts/backup
index d1c0fa2..6cc779f 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -6,7 +6,6 @@
 # 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
 
diff --git a/scripts/install b/scripts/install
index 3e402a1..70bc14a 100644
--- a/scripts/install
+++ b/scripts/install
@@ -39,7 +39,7 @@ 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/
@@ -70,7 +70,7 @@ 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"
 
diff --git a/scripts/remove b/scripts/remove
index 3818552..c49e70d 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -33,7 +33,7 @@ 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"
diff --git a/scripts/restore b/scripts/restore
index 3d202bf..1e42e58 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -30,7 +30,7 @@ ynh_multimedia_build_main_dir
 #=================================================
 # 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.
@@ -40,17 +40,18 @@ 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"
 
 #=================================================
 # 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"
 
diff --git a/scripts/upgrade b/scripts/upgrade
index 7126dd7..b91408c 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -18,7 +18,7 @@ upgrade_type=$(ynh_check_app_version_changed)
 #=================================================
 # 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
@@ -34,7 +34,7 @@ fi
 
 # If friendly_name doesn't exist, create it
 if [ -z "$friendly_name" ]; then
-	friendly_name="Yunohost DLNA"
+	friendly_name="YunoHost DLNA"
 	ynh_app_setting_set --app=$app --key=friendly_name --value=$friendly_name
 fi
 
@@ -90,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"
 

From 9050833bca20999baf81571011346114b5a40e5a Mon Sep 17 00:00:00 2001
From: yunohost-bot 
Date: Tue, 9 Jan 2024 20:46:20 +0000
Subject: [PATCH 06/11] Auto-update README

---
 README.md    | 11 +++++++++--
 README_fr.md | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 3d1a85b..304a62e 100644
--- a/README.md
+++ b/README.md
@@ -16,10 +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.
+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.0~ynh9
+**Shipped version:** 1.3.0~ynh1
 ## Documentation and resources
 
 * Official app website: 
diff --git a/README_fr.md b/README_fr.md
index d5a8486..c70630f 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -16,10 +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.
+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.0~ynh9
+**Version incluse :** 1.3.0~ynh1
 ## Documentations et ressources
 
 * Site officiel de l’app : 

From 321326058d0e4eedc8fef72e91a99252e8143d5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 9 Jan 2024 21:46:48 +0100
Subject: [PATCH 07/11] Update ADMIN.md

---
 doc/ADMIN.md | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/doc/ADMIN.md b/doc/ADMIN.md
index c283755..da9225e 100644
--- a/doc/ADMIN.md
+++ b/doc/ADMIN.md
@@ -2,7 +2,4 @@
 
 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.
+MiniDLNA is going to serve the files present in the directory `/home/yunohost.multimedia/share
\ No newline at end of file

From 10cd46e104f10a9e4e075a1b92068af6ba877c1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= 
Date: Wed, 24 Jan 2024 18:08:06 +0100
Subject: [PATCH 08/11] Fix upgrade (missing variables)

---
 scripts/upgrade | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/upgrade b/scripts/upgrade
index b91408c..ea5b6e4 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -21,25 +21,25 @@ upgrade_type=$(ynh_check_app_version_changed)
 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
+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

From c96fb76d9f417b782e14cf3f631d32a931da9990 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= 
Date: Wed, 24 Jan 2024 18:23:19 +0100
Subject: [PATCH 09/11] Remove exclusions that should be automatically detected

---
 tests.toml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tests.toml b/tests.toml
index 1774c62..d64ef3c 100644
--- a/tests.toml
+++ b/tests.toml
@@ -5,7 +5,3 @@ test_format = 1.0
     # ------------
     # Tests to run
     # ------------
-
-     exclude = ["install.subdir", "install.private", "install.multi", "change_url"]  # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url
-    # NB: you should NOT need this except if you really have a good reason...
-

From ff4797a659fe6381907ed5808486f9a64f9d6549 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= 
Date: Wed, 24 Jan 2024 18:29:11 +0100
Subject: [PATCH 10/11] Cleanup

---
 manifest.toml      |  2 ++
 scripts/_common.sh | 13 ++++++-------
 scripts/install    | 17 ++++++++---------
 scripts/remove     | 19 +++++++++----------
 scripts/restore    |  9 ++++-----
 tests.toml         |  2 ++
 6 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/manifest.toml b/manifest.toml
index dee3bc3..e8f9d09 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -1,3 +1,5 @@
+#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
+
 packaging_format = 2
 
 id = "minidlna"
diff --git a/scripts/_common.sh b/scripts/_common.sh
index b02fb07..e97e4ad 100755
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -8,13 +8,12 @@
 # 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
 }
 
 #=================================================
diff --git a/scripts/install b/scripts/install
index 70bc14a..8c01510 100644
--- a/scripts/install
+++ b/scripts/install
@@ -14,8 +14,8 @@ source /usr/share/yunohost/helpers
 #=================================================
 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
@@ -44,9 +44,8 @@ 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
 
 #=================================================
@@ -57,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
@@ -72,7 +71,7 @@ ynh_store_file_checksum --file="/etc/minidlna.conf"
 #=================================================
 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
@@ -80,7 +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"
+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 c49e70d..4fb59d4 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -16,10 +16,9 @@ source /usr/share/yunohost/helpers
 #=================================================
 
 # 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
 
 #=================================================
@@ -36,12 +35,12 @@ ynh_exec_fully_quiet yunohost firewall disallow UDP 1900
 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 1e42e58..c8370de 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -33,9 +33,8 @@ ynh_multimedia_build_main_dir
 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"
@@ -46,14 +45,14 @@ ynh_restore_file --origin_path="/etc/minidlna.conf"
 #=================================================
 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..." --weight=1
 
-ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/$app.log"
+ynh_systemd_action --service_name="$app" --action=restart --log_path="/var/log/$app.log"
 
 #=================================================
 # END OF SCRIPT
diff --git a/tests.toml b/tests.toml
index d64ef3c..953b195 100644
--- a/tests.toml
+++ b/tests.toml
@@ -1,3 +1,5 @@
+#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
+
 test_format = 1.0
 
 [default]

From 7a773737d84ffc581f970d40e74f327416c0c3ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= 
Date: Wed, 24 Jan 2024 18:38:13 +0100
Subject: [PATCH 11/11] Add cpe

---
 manifest.toml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/manifest.toml b/manifest.toml
index e8f9d09..3ccbd61 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -14,6 +14,7 @@ maintainers = []
 [upstream]
 license = "GPL-2.0"
 website = "http://minidlna.sourceforge.net"
+cpe = "cpe:2.3:a:readymedia_project:readymedia"
 
 [integration]
 yunohost = ">= 11.2"