Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Sonarr to v3 #3803

Merged
merged 7 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cross/sonarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PKG_NAME = NzbDrone
PKG_VERS = 2.0.0.5344
PKG_NAME = Sonarr
PKG_VERS = 3.0.5.1144
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME).master.$(PKG_VERS).mono.$(PKG_EXT)
PKG_DIST_SITE = https://download.sonarr.tv/v2/master/mono
PKG_DIR = NzbDrone
PKG_DIST_NAME = $(PKG_NAME).main.$(PKG_VERS).linux.$(PKG_EXT)
PKG_DIST_SITE = https://download.sonarr.tv/v3/main/$(PKG_VERS)
PKG_DIR = $(PKG_NAME)

DEPENDS =

Expand Down
2 changes: 1 addition & 1 deletion cross/sonarr/PLIST
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rsc:share/NzbDrone
rsc:share/Sonarr
6 changes: 3 additions & 3 deletions cross/sonarr/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NzbDrone.master.2.0.0.5344.mono.tar.gz SHA1 223ea825e9968a25d4b376fe529eba2258a5a326
NzbDrone.master.2.0.0.5344.mono.tar.gz SHA256 2a15cb9dfa45eb34558fccdc9a1611028790b56a1b59c7407c27c726ea715d2f
NzbDrone.master.2.0.0.5344.mono.tar.gz MD5 cad83d5f4885af1f62f802899903c6f8
Sonarr.main.3.0.5.1144.linux.tar.gz SHA1 2335133139a46f1ce0d1b2cb1f566d30285d3d1e
Sonarr.main.3.0.5.1144.linux.tar.gz SHA256 77aff6978d4dc80027979c815bd5a79579dd9bb50d39b1b2d14b3bb9e18058aa
Sonarr.main.3.0.5.1144.linux.tar.gz MD5 675ce0ab2f1e643860ab1daab45b2842
9 changes: 3 additions & 6 deletions spk/sonarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
SPK_NAME = nzbdrone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to use Sonarr as package name
Once we have to do the breaking change, why not now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I looked into doing this previously there were some major issues that I didn't find an easy resolution for (at the time).

If I remember correctly a couple of the issues as a result of making this change were:

  • By making this change synology package manager would now treat this as a new/separate package (would no longer use the standard package upgrade processes). This means that we would have to manually add a check for the old database and also build-in the database migration from the old app (via scripting). This was doable but added more potential problems than I wanted to deal with at the time.
  • Synology package manager will not allow you to install a package with the same webports and a couple other items. This means that this package would require some scripting to work around that install issue. If I remember correctly you would need to have it start the install with different webports set in the new package, then remove the old app or change the webports via scripting as part of the process.
  • In addition, and to potentially resolve the previous point, a bigger challenge (for me) was that I did not find a good way to add scripting to stop/uninstall the old app via scripting/commands within this new app. It seemed it would open up too many potential issues.

Perhaps there were more issues, I can't remember. However, I think this would be kind of nice to have if someone wants to make all of the above work. I don't know if another package has gone through this process before and might already have some of this scripting added to a package upgrade/rename. Another option is to make this a separate v3 package and force users to manually upgrade/migrate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please not make this complicated just for a name that a regular users wouldn't see!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please not make this complicated just for a name that a regular users wouldn't see!

That's what we decided last time and I agree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to look at the documentation but in DSM7 there is a way to replace a package wich is exactly what we need to address these issues. We just need to wait until it's released

Copy link
Member

@publicarray publicarray Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also agree that for this PR we should leave it as is. It's not worth to work on until DSM7 is released

SPK_VERS = $(shell date +%Y%m%d)
SPK_REV = 18
SPK_REV = 19
SPK_ICON = src/sonarr.png

# Mono not supported on ppc platforms. C.f. cross/mono/Makefile and references therein for details.
UNSUPPORTED_ARCHS = $(PPC_ARCHS)

DEPENDS = cross/busybox cross/curl cross/mediainfo cross/sqlite cross/sonarr
DEPENDS = cross/curl cross/mediainfo cross/sqlite cross/sonarr

SPK_DEPENDS = "mono>3.6"

Expand All @@ -17,7 +17,7 @@ DESCRIPTION_SPN = Sonarr es un PVR para los usuarios de grupos de noticias y tor
RELOAD_UI = yes
DISPLAY_NAME = Sonarr
STARTABLE = yes
CHANGELOG = "Update openssl to 1.1."
CHANGELOG = "Update Sonarr to v3.0.5.1144"

HOMEPAGE = https://sonarr.tv
LICENSE = GPLv3
Expand All @@ -34,9 +34,6 @@ WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = sonarr_extra_install

BUSYBOX_CONFIG = usrmng
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"

include ../../mk/spksrc.spk.mk

.PHONY: sonarr_extra_install
Expand Down
30 changes: 13 additions & 17 deletions spk/sonarr/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,8 @@ SVC_BACKGROUND=y

service_postinst ()
{
mkdir -p ${CONFIG_DIR}
set_unix_permissions "${CONFIG_DIR}"

# If necessary, add user also to the old group before removing it
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "${LEGACY_GROUP}"
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "users"

# Discard legacy obsolete busybox user account
BIN=${SYNOPKG_PKGDEST}/bin
$BIN/busybox --install $BIN >> ${INST_LOG}
$BIN/delgroup "${USER}" "users" >> ${INST_LOG}
$BIN/deluser "${USER}" >> ${INST_LOG}
}

service_preupgrade ()
Expand All @@ -62,10 +53,11 @@ service_preupgrade ()
# The /var/ folder gets automatically copied by service-installer after this
if [ -d "${LEGACY_CONFIG_DIR}" ]; then
echo "Moving ${LEGACY_CONFIG_DIR} to ${INST_VAR}" >> ${INST_LOG}
mv ${LEGACY_CONFIG_DIR} ${CONFIG_DIR} >> ${LOG_FILE} 2>&1
else
mv ${LEGACY_CONFIG_DIR} ${CONFIG_DIR} >> ${INST_LOG} 2>&1
fi
if [ ! -d ${CONFIG_DIR} ]; then
# Create, in case it's missing for some reason
mkdir ${CONFIG_DIR} >> ${LOG_FILE} 2>&1
mkdir -p ${CONFIG_DIR} >> ${INST_LOG} 2>&1
fi

# Is Installed Sonarr Binary Ver. >= SPK Sonarr Binary Ver.?
Expand All @@ -90,17 +82,21 @@ service_postupgrade ()
. ${CONFIG_DIR}/KEEP_VAR
if [ "$KEEP_CUR" == "yes" ]; then
echo "Restoring Sonarr version from before upgrade" >> ${INST_LOG}
rm -fr ${SYNOPKG_PKGDEST}/share >> $INST_LOG 2>&1
mv ${INST_VAR}/share ${SYNOPKG_PKGDEST}/ >> $INST_LOG 2>&1
rm -fr ${SYNOPKG_PKGDEST}/share >> ${INST_LOG} 2>&1
mv ${INST_VAR}/share ${SYNOPKG_PKGDEST}/ >> ${INST_LOG} 2>&1
set_unix_permissions "${SYNOPKG_PKGDEST}/share"
fi

set_unix_permissions "${CONFIG_DIR}"

# If backup was created before new-style packages
# new updates/backups will fail due to permissions (see #3185)
set_unix_permissions "/tmp/nzbdrone_backup"
set_unix_permissions "/tmp/nzbdrone_update"
if [ -d "/tmp/nzbdrone_backup" ] || [ -d "/tmp/nzbdrone_update" ] || [ -d "/tmp/sonarr_backup" ] || [ -d "/tmp/sonarr_update" ]; then
set_unix_permissions "/tmp/nzbdrone_backup"
set_unix_permissions "/tmp/nzbdrone_update"
set_unix_permissions "/tmp/sonarr_backup"
set_unix_permissions "/tmp/sonarr_update"
fi

# Remove upgrade Flag
rm ${CONFIG_DIR}/KEEP_VAR
Expand Down
7 changes: 6 additions & 1 deletion spk/sonarr/src/wizard/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[{
"step_title": "RECOMMENDATION: Download A Backup Before Upgrading",
"items": [{
"desc": "<strong style='color:red'>IMPORTANT:</strong> This update is an upgrade to Sonarr v3. We suggest that you download a manual backup as a precautionary measure before installing this update.<br><br>You can download a backup via Sonarr's built-in web-interface.<br>To do this, navigate to <b>System>Backup</b> in the Sonarr UI.<br><br>Create a backup and then download a copy of that backup before installing this upgrade."
}]
},{
"step_title": "Updating Sonarr",
"items": [{
"desc": "Keep Sonarr up-to-date by using Sonarr's built-in updater.<br>Navigate to System>Updates in the Sonarr UI."
"desc": "Keep Sonarr up-to-date by using Sonarr's built-in updater.<br>Navigate to <b>System>Updates</b> in the Sonarr UI."
}]
},{
"step_title": "Attention! DSM Permissions",
Expand Down
7 changes: 6 additions & 1 deletion spk/sonarr/src/wizard/upgrade_uifile_fre
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[{
"step_title": "RECOMMENDATION: Télécharger une sauvegarde avant la mise à niveau",
"items": [{
"desc": "<strong style='color:red'>IMPORTANT:</strong> Cette mise à jour est une mise à niveau vers Sonarr v3. Nous vous suggérons de télécharger une sauvegarde manuelle par mesure de précaution avant d'installer cette mise à jour.<br><br>Vous pouvez télécharger une sauvegarde via l'interface Web intégrée de Sonarr.<br>Pour ce faire, accédez à <b>System>Backup</b> dans l'interface utilisateur Sonarr.<br><br>Créez une sauvegarde, puis téléchargez une copie de cette sauvegarde avant d'installer cette mise à niveau."
}]
},{
"step_title": "Mettre à jour Sonarr",
"items": [{
"desc": "Garder Sonarr à jour en utilisant System>Updates dans l'interface Sonarr."
"desc": "Garder Sonarr à jour en utilisant <b>System>Updates</b> dans l'interface Sonarr."
}]
},{
"step_title": "Attention! Permissions DSM",
Expand Down