From c6389c112396089a89f2fb15099492422612094d Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 7 May 2024 21:16:37 +0200 Subject: [PATCH 1/4] Fix packaging v2 migration (#18) --- conf/nginx.conf | 2 +- manifest.toml | 1 - scripts/install | 2 +- scripts/upgrade | 9 +++++++++ tests.toml | 7 +++++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 4195917..b6197c4 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,7 @@ location __PATH__ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; - # Allow the Radarr API + # Allow the Sonarr API location __PATH__/api { auth_request off; proxy_pass http://127.0.0.1:__PORT____PATH__/api; diff --git a/manifest.toml b/manifest.toml index 55aa865..065b9bf 100644 --- a/manifest.toml +++ b/manifest.toml @@ -57,7 +57,6 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] - dir = "/var/lib/__APP__" [resources.ports] diff --git a/scripts/install b/scripts/install index 1c52387..52b6579 100755 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,7 @@ chown -R "$app:$app" "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Configuring Radarr..." --weight=2 +ynh_script_progression --message="Configuring Sonarr..." --weight=2 mkdir -p "/var/log/$app" ln -s "/var/log/$app" "$data_dir/logs" diff --git a/scripts/upgrade b/scripts/upgrade index 9950335..1e9125e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,15 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# Fixes specific to packaging v2 migration +if ynh_compare_current_package_version --comparison le --version 3.0.6.1196~ynh3 +then + # In packaging v1, final_path=/var/lib/$app but actually held the data. No data_dir was defined + # Upon migration, the core moves /var/lib/$app to /var/www/$app, so let's move it to the data_dir + ynh_print_warn --message="Fix manivest v2 migration: moving contents of $install_dir to $data_dir... (this may take a while)" + mv $install_dir/* $data_dir +fi + if [ ! -L "$data_dir/logs" ]; then ynh_secure_remove --file="$data_dir/logs" ln -s "/var/log/$app" "$data_dir/logs" diff --git a/tests.toml b/tests.toml index eecb3cf..466afa7 100644 --- a/tests.toml +++ b/tests.toml @@ -8,8 +8,11 @@ test_format = 1.0 # Default args to use for install # ------------------------------- - args.admin="john" - # ------------ # Tests to run # ------------ + + test_upgrade_from.768c1ce.name = "Upgrade from 3.0.6.1196~ynh3 (packaging v1)" + test_upgrade_from.768c1ce.args.domain = "domain.tld" + test_upgrade_from.768c1ce.args.path = "/sonarr" + test_upgrade_from.768c1ce.args.admin = "package_checker" From 7c98967822d02172d510cec897d3f5e5e4471c6a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 7 May 2024 19:16:42 +0000 Subject: [PATCH 2/4] Auto-update READMEs --- README_zh_Hans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_zh_Hans.md b/README_zh_Hans.md index de0c929..65f8f80 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -3,7 +3,7 @@ 请勿手动编辑。 --> -# YunoHost 的 Sonarr +# YunoHost 上的 Sonarr [![集成程度](https://dash.yunohost.org/integration/sonarr.svg)](https://dash.yunohost.org/appci/app/sonarr) ![工作状态](https://ci-apps.yunohost.org/ci/badges/sonarr.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/sonarr.maintain.svg) From 31414047071058ecfe8904ea365c4d95541476d0 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 7 May 2024 21:38:22 +0200 Subject: [PATCH 3/4] Bump package version and add doc --- doc/POST_UPGRADE.d/4.0.4.1491~ynh2.md | 2 ++ manifest.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 doc/POST_UPGRADE.d/4.0.4.1491~ynh2.md diff --git a/doc/POST_UPGRADE.d/4.0.4.1491~ynh2.md b/doc/POST_UPGRADE.d/4.0.4.1491~ynh2.md new file mode 100644 index 0000000..1136087 --- /dev/null +++ b/doc/POST_UPGRADE.d/4.0.4.1491~ynh2.md @@ -0,0 +1,2 @@ +Starting from 4.0.4.1491~ynh2, the data directory will be moved from the unusual (for a YunoHost package) `/var/lib/__APP__` to `/home/yunohost.app/__APP__`. +Beware, if you have customized or hacked your app. Enjoy Sonarr! diff --git a/manifest.toml b/manifest.toml index 065b9bf..bbd7301 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Sonarr" description.en = "Series collection manager for Usenet and BitTorrent users" description.fr = "Gestionnaire de collection de séries pour utilisateurs de Usenet et BitTorrent" -version = "4.0.4.1491~ynh1" +version = "4.0.4.1491~ynh2" maintainers = ["tituspijean"] From 0cc2aee0adfa2012724289892d5e5229cf68e08b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 7 May 2024 19:41:01 +0000 Subject: [PATCH 4/4] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1355822..4fa3bf7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. 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:** 4.0.4.1491~ynh1 +**Shipped version:** 4.0.4.1491~ynh2 ## Screenshots diff --git a/README_eu.md b/README_eu.md index 45dd075..0080ac8 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. 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. -**Paketatutako bertsioa:** 4.0.4.1491~ynh1 +**Paketatutako bertsioa:** 4.0.4.1491~ynh2 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index 06f9203..a70676c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. 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 :** 4.0.4.1491~ynh1 +**Version incluse :** 4.0.4.1491~ynh2 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index c6a98a5..5333da2 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. 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. -**Versión proporcionada:** 4.0.4.1491~ynh1 +**Versión proporcionada:** 4.0.4.1491~ynh2 ## Capturas de pantalla diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 65f8f80..d986e34 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ 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. -**分发版本:** 4.0.4.1491~ynh1 +**分发版本:** 4.0.4.1491~ynh2 ## 截图