From ec3d2023b28281ca0f2f5c201b3c1054a7fdef3b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 3 Jun 2021 19:36:57 +0200 Subject: [PATCH 01/24] Add armhf support in DISCLAIMER --- doc/DISCLAIMER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 26d80a4..845ec1e 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,5 +1,5 @@ * Sonarr developper's repository only allows to download the very latest version. * The version displayed here may be different from the one actually installed. -* Supported architectures are `arm`, `arm64`, and `amd64` +* Supported architectures are `arm`, `armhf`, `arm64`, and `amd64` * Access control is done with YunoHost's permissions system. * API (`domain.tld/path/api`) can be accessed by visitors to allow control by remote clients. From f8253dc2de55380a85cba41c12a7b6fd664526b3 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 3 Jun 2021 17:37:17 +0000 Subject: [PATCH 02/24] Auto-update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38e694f..fa23550 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ A series collection manager for Usenet and BitTorrent users. * Sonarr developper's repository only allows to download the very latest version. * The version displayed here may be different from the one actually installed. -* Supported architectures are `arm`, `arm64`, and `amd64` +* Supported architectures are `arm`, `armhf`, `arm64`, and `amd64` * Access control is done with YunoHost's permissions system. * API (`domain.tld/path/api`) can be accessed by visitors to allow control by remote clients. From c7f898c770aeb4baa6df30fa39745cd6222b1834 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 4 Jun 2021 08:51:51 +0200 Subject: [PATCH 03/24] Fix service description in upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a86510a..328b2c6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,7 +120,7 @@ ynh_use_logrotate --non-append --logfile="$final_path/logs" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="Radarr daemon" --log="$final_path/logs/sonarr.txt" +yunohost service add $app --description="Sonarr daemon" --log="$final_path/logs/sonarr.txt" #================================================= # START SYSTEMD SERVICE From 363893fa32c6ad053a4d96248c7f1e4e447cfaeb Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 4 Jun 2021 08:53:13 +0200 Subject: [PATCH 04/24] Optimize check_process --- check_process | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/check_process b/check_process index 0b1d043..d41ffe8 100644 --- a/check_process +++ b/check_process @@ -8,7 +8,6 @@ domain="domain.tld" path="/path" admin="john" - port="666" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -28,4 +27,4 @@ Notification=none ;;; Upgrade options ; commit=CommitHash name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& + manifest_arg=domain=DOMAIN&path=PATH&admin=USER& From 6d2c9da8b5b42794a4df6955247804b263ba2911 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 4 Jun 2021 08:56:51 +0200 Subject: [PATCH 05/24] Silence mono installation warnings --- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index ade7b73..c245233 100755 --- a/scripts/install +++ b/scripts/install @@ -67,9 +67,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=4 -ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/restore b/scripts/restore index 29b5c2d..3a53eb2 100755 --- a/scripts/restore +++ b/scripts/restore @@ -84,9 +84,9 @@ chown -R $app:$app "$final_path" ynh_script_progression --message="Reinstalling dependencies..." --weight=4 # Define and install dependencies -ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index 328b2c6..2747533 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,9 +89,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=4 -ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" ynh_install_app_dependencies $pkg_dependencies From 5db7be86c86faffb07e8ed6d624228197034f00e Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 4 Jun 2021 10:09:57 +0200 Subject: [PATCH 06/24] Remove debug command --- scripts/install | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/install b/scripts/install index c245233..a4db445 100755 --- a/scripts/install +++ b/scripts/install @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - read -p "debug me" -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors From 42a92f32c62bb6f5e6f0e43ec76c42822da1ddbc Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 4 Jun 2021 10:21:05 +0200 Subject: [PATCH 07/24] Quotation marks for ynh_exec_warn_less --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index a4db445..40e9065 100755 --- a/scripts/install +++ b/scripts/install @@ -63,9 +63,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=4 -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' ynh_install_app_dependencies $pkg_dependencies From fdad33cc9faf6509b0e0e702b11236b75302fa7e Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 4 Jun 2021 13:06:15 +0200 Subject: [PATCH 08/24] Add service start timeout --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index fec2989..cfa454f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -108,7 +108,7 @@ fi # UPDATE CONFIGURATION FILE #================================================= -ynh_add_config --template="../conf/config.xml" --destination="$final_path/config.xml" +ynh_exec_warn_less 'ynh_add_config --template="../conf/config.xml" --destination="$final_path/config.xml"' mkdir -p "$final_path" chmod 750 "$final_path" diff --git a/scripts/install b/scripts/install index 40e9065..8291553 100755 --- a/scripts/install +++ b/scripts/install @@ -137,7 +137,7 @@ yunohost service add $app --description="Sonarr daemon" --log="$final_path/logs/ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 3a53eb2..d2cc550 100755 --- a/scripts/restore +++ b/scripts/restore @@ -110,7 +110,7 @@ yunohost service add $app --description="Sonarr daemon" --log="$final_path/logs/ #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 2747533..3050604 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -127,7 +127,7 @@ yunohost service add $app --description="Sonarr daemon" --log="$final_path/logs/ #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 #================================================= # RELOAD NGINX From 6e338f5709225522f93fbb821dcb25641e91310e Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 8 Jun 2021 01:24:46 +0200 Subject: [PATCH 09/24] =?UTF-8?q?Quotation=20marks=20for=20ynh=5Fexec=5Fwa?= =?UTF-8?q?rn=5Fless=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index d2cc550..dc18191 100755 --- a/scripts/restore +++ b/scripts/restore @@ -84,9 +84,9 @@ chown -R $app:$app "$final_path" ynh_script_progression --message="Reinstalling dependencies..." --weight=4 # Define and install dependencies -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index 3050604..19cfe8c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,9 +89,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=4 -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' ynh_install_app_dependencies $pkg_dependencies From 15c8e54af2a910bef7d362e737eb2c1d7e77715f Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 12 Jun 2021 11:17:50 +0200 Subject: [PATCH 10/24] Restart initial sonarr.service if multi-installed --- scripts/install | 7 +++++++ scripts/restore | 7 +++++++ scripts/upgrade | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/scripts/install b/scripts/install index 8291553..167bd40 100755 --- a/scripts/install +++ b/scripts/install @@ -139,6 +139,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 +# If a first Sonarr app was running before installing this one, +# it may have been stopped by the installation of the dependencies. +# Let's restart it. +if [[ $(systemctl list-units -all | grep 'sonarr.service' | grep 'inactive') ]]; then + ynh_exec_fully_quiet 'ynh_systemd_action --service_name=sonarr --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30' +fi + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index dc18191..250eae1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -112,6 +112,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 +# If a first Sonarr app was running before installing this one, +# it may have been stopped by the installation of the dependencies. +# Let's restart it. +if [[ $(systemctl list-units -all | grep 'sonarr.service' | grep 'inactive') ]]; then + ynh_exec_fully_quiet 'ynh_systemd_action --service_name=sonarr --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30' +fi + #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 19cfe8c..8dee388 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -129,6 +129,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 +# If a first Sonarr app was running before installing this one, +# it may have been stopped by the installation of the dependencies. +# Let's restart it. +if [[ $(systemctl list-units -all | grep 'sonarr.service' | grep 'inactive') ]]; then + ynh_exec_fully_quiet 'ynh_systemd_action --service_name=sonarr --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30' +fi + #================================================= # RELOAD NGINX #================================================= From a317bc75d70c394d964c50b626b65a9547ee9b91 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 12 Jun 2021 11:20:12 +0200 Subject: [PATCH 11/24] Make sure logs directory is created and chown'ed --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 167bd40..c041e3d 100755 --- a/scripts/install +++ b/scripts/install @@ -106,7 +106,8 @@ ynh_script_progression --message="Configuring Radarr..." --weight=2 api_key=$(ynh_string_random --length=32) ynh_app_setting_set --app=$app --key=api_key --value=$api_key -mkdir -p "$final_path" +# Create $final_path and its logs subdirectory +mkdir -p "$final_path/logs" chmod 750 "$final_path" ynh_add_config --template="../conf/config.xml" --destination="$final_path/config.xml" From d9a7e87a79f87db713c316214f9ffc8d9b999ccf Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 13 Jun 2021 13:08:51 +0200 Subject: [PATCH 12/24] Add external packages to the dependencies list otherwise they get removed if one instance of the app is uninstalled --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 5e60e99..d9b08ae 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="apt-transport-https dirmngr gnupg ca-certificates mediainfo" +pkg_dependencies="apt-transport-https dirmngr gnupg ca-certificates mediainfo mono-devel sonarr" #================================================= # PERSONAL HELPERS From 0e40d9c14549faa30ca49cc64d15ce371b3191bc Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 13 Jun 2021 13:18:14 +0200 Subject: [PATCH 13/24] Integrate with YunoHost's multimedia directories --- doc/DISCLAIMER.md | 1 + doc/DISCLAIMER_fr.md | 1 + scripts/install | 10 ++++++++++ scripts/restore | 10 ++++++++++ 4 files changed, 22 insertions(+) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 845ec1e..303f92c 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -3,3 +3,4 @@ * Supported architectures are `arm`, `armhf`, `arm64`, and `amd64` * Access control is done with YunoHost's permissions system. * API (`domain.tld/path/api`) can be accessed by visitors to allow control by remote clients. +* The app uses YunoHost's multimédia directories, hence it has write access to users' and shared directories in `/home/yunohost.multimedia`. After installation, you can choose these directories to store your media. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 4b70595..64a0d4f 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -3,3 +3,4 @@ * Les architectures compatibles sont `arm`, `armhf`, `arm64`, et `amd64` * Le contrôle de l'accès se fait avec le système de permissions de YunoHost. * L'API (`domain.tld/path/api`) est accessible aux visiteurs pour permettre le contrôle via des clients externes. +* L'application utilise les dossiers multimédia de YunoHost, elle a donc accès en écriture aux dossiers utilisateurs et communs de `/home/yunohost.multimedia`. Après installation, vous pourrez choisir ces dossiers pour y stocker vos médias. diff --git a/scripts/install b/scripts/install index c041e3d..7dea2e4 100755 --- a/scripts/install +++ b/scripts/install @@ -115,6 +115,16 @@ ynh_add_config --template="../conf/config.xml" --destination="$final_path/config chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" +#================================================= +# YUNOHOST MULTIMEDIA INTEGRATION +#================================================= +ynh_script_progression --message="Adding multimedia directories..." --weight=2 + +# Build YunoHost multimedia directories +ynh_multimedia_build_main_dir +# Enable writing into these directories +ynh_multimedia_addaccess $app + #================================================= # GENERIC FINALIZATIONs #================================================= diff --git a/scripts/restore b/scripts/restore index 250eae1..87bd5cf 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,6 +76,16 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" +#================================================= +# YUNOHOST MULTIMEDIA INTEGRATION +#================================================= +ynh_script_progression --message="Adding multimedia directories..." --weight=2 + +# Build YunoHost multimedia directories +ynh_multimedia_build_main_dir +# Enable writing into these directories +ynh_multimedia_addaccess $app + #================================================= # SPECIFIC RESTORATION #================================================= From 3b2d81334721a8e036dc90a4de60a5f74bbb1ec6 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 13 Jun 2021 11:19:04 +0000 Subject: [PATCH 14/24] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index fa23550..b149819 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ A series collection manager for Usenet and BitTorrent users. * Supported architectures are `arm`, `armhf`, `arm64`, and `amd64` * Access control is done with YunoHost's permissions system. * API (`domain.tld/path/api`) can be accessed by visitors to allow control by remote clients. +* The app uses YunoHost's multimédia directories, hence it has write access to users' and shared directories in `/home/yunohost.multimedia`. After installation, you can choose these directories to store your media. ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 969e63b..9c640bc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -28,6 +28,7 @@ Un gestionnaire de collection de séries pour utilisateurs de Usenet et BitTorre * Les architectures compatibles sont `arm`, `armhf`, `arm64`, et `amd64` * Le contrôle de l'accès se fait avec le système de permissions de YunoHost. * L'API (`domain.tld/path/api`) est accessible aux visiteurs pour permettre le contrôle via des clients externes. +* L'application utilise les dossiers multimédia de YunoHost, elle a donc accès en écriture aux dossiers utilisateurs et communs de `/home/yunohost.multimedia`. Après installation, vous pourrez choisir ces dossiers pour y stocker vos médias. ## Documentations et ressources From cd997dee23bc16f9c2904bb32e5bbafd2b3d6cf6 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 13 Jun 2021 13:28:40 +0200 Subject: [PATCH 15/24] Fix DISCLAIMER.md typo --- doc/DISCLAIMER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 303f92c..3b68602 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -3,4 +3,4 @@ * Supported architectures are `arm`, `armhf`, `arm64`, and `amd64` * Access control is done with YunoHost's permissions system. * API (`domain.tld/path/api`) can be accessed by visitors to allow control by remote clients. -* The app uses YunoHost's multimédia directories, hence it has write access to users' and shared directories in `/home/yunohost.multimedia`. After installation, you can choose these directories to store your media. +* The app uses YunoHost's multimedia directories, hence it has write access to users' and shared directories in `/home/yunohost.multimedia`. After installation, you can choose these directories to store your media. From eb0662a3aaab332a6f35302316edabfa57b36f2e Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 13 Jun 2021 11:29:12 +0000 Subject: [PATCH 16/24] Auto-update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b149819..4510aa4 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ A series collection manager for Usenet and BitTorrent users. * Supported architectures are `arm`, `armhf`, `arm64`, and `amd64` * Access control is done with YunoHost's permissions system. * API (`domain.tld/path/api`) can be accessed by visitors to allow control by remote clients. -* The app uses YunoHost's multimédia directories, hence it has write access to users' and shared directories in `/home/yunohost.multimedia`. After installation, you can choose these directories to store your media. +* The app uses YunoHost's multimedia directories, hence it has write access to users' and shared directories in `/home/yunohost.multimedia`. After installation, you can choose these directories to store your media. ## Documentation and resources From fd5c0a6cce159c6b589c6c93a7dab3b12d40048b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 13 Jun 2021 13:40:27 +0200 Subject: [PATCH 17/24] Bump YunoHost requirement for multimedia helpers --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 79baab2..9c7961f 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "email": "tituspijean@outlook.com" }, "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.2" }, "multi_instance": true, "services": [ From 513c9fc60b7e6b8d90465f4bd7a59f90ba500101 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 19 Sep 2021 08:24:31 +0200 Subject: [PATCH 18/24] Cleaning up --- doc/DESCRIPTION.md | 0 doc/DESCRIPTION_fr.md | 1 + manifest.json | 11 ++++------- scripts/backup | 5 ----- scripts/change_url | 23 +++++++++++------------ scripts/remove | 10 ---------- scripts/restore | 2 -- 7 files changed, 16 insertions(+), 36 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..38a802e --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Sonarr est un PVR pour les utilisateurs Usenet et BitTorrent. Il peut surveiller plusieurs flux RSS pour les nouveaux épisodes de vos émissions préférées et les récupérer, les trier et les renommer. Il peut également être configuré pour mettre à niveau automatiquement la qualité des fichiers déjà téléchargés lorsqu'un format de meilleure qualité devient disponible. diff --git a/manifest.json b/manifest.json index 9c7961f..bfc0cb4 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "sonarr", "packaging_format": 1, "description": { - "en": "A series collection manager for Usenet and BitTorrent users.", - "fr": "Un gestionnaire de collection de séries pour utilisateurs de Usenet et BitTorrent." + "en": "A series collection manager for Usenet and BitTorrent users", + "fr": "Gestionnaire de collection de séries pour utilisateurs de Usenet et BitTorrent" }, "version": "3.0.6.1196~ynh1", "url": "https://sonarr.tv", @@ -25,15 +25,13 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", "mysql" ], "arguments": { "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -43,8 +41,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" } ] } diff --git a/scripts/backup b/scripts/backup index 0670178..bfc28b4 100755 --- a/scripts/backup +++ b/scripts/backup @@ -36,11 +36,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/change_url b/scripts/change_url index cfa454f..f2e412b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -34,7 +34,7 @@ api_key=$(ynh_app_setting_get --app=$app --key=api_key) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -69,14 +69,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -108,26 +108,25 @@ fi # UPDATE CONFIGURATION FILE #================================================= -ynh_exec_warn_less 'ynh_add_config --template="../conf/config.xml" --destination="$final_path/config.xml"' +path=$new_path -mkdir -p "$final_path" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +ynh_exec_warn_less ynh_add_config --template="../conf/config.xml" --destination="$final_path/config.xml" + +chown $app:$app "$final_path/config.xml" #================================================= # GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -135,4 +134,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/remove b/scripts/remove index 745b6b6..93ff07a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -73,16 +73,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 87bd5cf..3d20cff 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,8 +37,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " From bc10a3b740cd104c45fb740ce4593bc506f89a20 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 19 Sep 2021 06:24:38 +0000 Subject: [PATCH 19/24] Auto-update README --- README.md | 2 +- README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4510aa4..b2288a1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -A series collection manager for Usenet and BitTorrent users. +A series collection manager for Usenet and BitTorrent users **Shipped version:** 3.0.6.1196~ynh1 diff --git a/README_fr.md b/README_fr.md index 9c640bc..11bc092 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,8 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Un gestionnaire de collection de séries pour utilisateurs de Usenet et BitTorrent. +Sonarr est un PVR pour les utilisateurs Usenet et BitTorrent. Il peut surveiller plusieurs flux RSS pour les nouveaux épisodes de vos émissions préférées et les récupérer, les trier et les renommer. Il peut également être configuré pour mettre à niveau automatiquement la qualité des fichiers déjà téléchargés lorsqu'un format de meilleure qualité devient disponible. + **Version incluse :** 3.0.6.1196~ynh1 From 56e0e8944ab078cc026720d8b4b4f1d49ee7327e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 19 Sep 2021 08:41:48 +0200 Subject: [PATCH 20/24] Update DESCRIPTION.md --- doc/DESCRIPTION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index e69de29..5faee6a 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. From 5557dff17197cf6ad0475e90f144c4f16fa16a66 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 19 Sep 2021 06:41:57 +0000 Subject: [PATCH 21/24] Auto-update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b2288a1..89b6af5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -A series collection manager for Usenet and BitTorrent users +Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. + **Shipped version:** 3.0.6.1196~ynh1 From 68716fc609e9b8624d634eea4cdeabaff67e2980 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 19 Sep 2021 10:33:06 +0200 Subject: [PATCH 22/24] Bump package version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index bfc0cb4..a136725 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A series collection manager for Usenet and BitTorrent users", "fr": "Gestionnaire de collection de séries pour utilisateurs de Usenet et BitTorrent" }, - "version": "3.0.6.1196~ynh1", + "version": "3.0.6.1196~ynh2", "url": "https://sonarr.tv", "upstream": { "license": "GPL-3.0-only", From 09f79a053c85656f8b674360ef9674de3caa487c Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 19 Sep 2021 08:33:08 +0000 Subject: [PATCH 23/24] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89b6af5..94580d7 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. -**Shipped version:** 3.0.6.1196~ynh1 +**Shipped version:** 3.0.6.1196~ynh2 diff --git a/README_fr.md b/README_fr.md index 11bc092..ded7be5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Sonarr est un PVR pour les utilisateurs Usenet et BitTorrent. Il peut surveiller plusieurs flux RSS pour les nouveaux épisodes de vos émissions préférées et les récupérer, les trier et les renommer. Il peut également être configuré pour mettre à niveau automatiquement la qualité des fichiers déjà téléchargés lorsqu'un format de meilleure qualité devient disponible. -**Version incluse :** 3.0.6.1196~ynh1 +**Version incluse :** 3.0.6.1196~ynh2 From ea260e41080cb62375bb591d547c0407812922fd Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 11 Oct 2021 23:29:35 +0200 Subject: [PATCH 24/24] Fetch repo key via https Co-authored-by: Alexandre Aubin --- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 7dea2e4..c7484bd 100755 --- a/scripts/install +++ b/scripts/install @@ -63,9 +63,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=4 -ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' -ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/restore b/scripts/restore index 3d20cff..d3a4a27 100755 --- a/scripts/restore +++ b/scripts/restore @@ -92,9 +92,9 @@ ynh_multimedia_addaccess $app ynh_script_progression --message="Reinstalling dependencies..." --weight=4 # Define and install dependencies -ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' -ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index 8dee388..ab55ef1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,9 +89,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=4 -ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://download.mono-project.com/repo/debian stable-buster main" --package="mono-devel" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"' -ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' +ynh_exec_warn_less 'ynh_install_extra_app_dependencies --repo="https://apt.sonarr.tv/debian buster main" --package="sonarr" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8"' ynh_install_app_dependencies $pkg_dependencies