From 16d0d28a73a02fc8a4eb86cee109b86b32bf8369 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Thu, 15 Apr 2021 21:34:34 +0200 Subject: [PATCH 1/7] migrate SPK_LINKS to SPK_USR_LOCAL_LINKS - SPK_LINKS is not supported anymore, use SPK_USR_LOCAL_LINKS and/or SPK_COMMANDS - adjust all packages with former SPK_LINKS (beets, borgbackup, rdiff-backup) --- mk/spksrc.service.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mk/spksrc.service.mk b/mk/spksrc.service.mk index bdde9503ce0..413e8ed0a57 100644 --- a/mk/spksrc.service.mk +++ b/mk/spksrc.service.mk @@ -60,6 +60,12 @@ else ifeq ($(call version_ge, ${TCVERSION}, 7.0),1) SPK_USER = $(SPK_NAME) endif +ifeq ($(strip $(STARTABLE)),yes) +# we only evaluate for STARTABLE=no +# STARTABLE=yes is default (same as STARTABLE not defined) +STARTABLE= +endif + # Recommend explicit STARTABLE=no ifeq ($(strip $(SSS_SCRIPT) $(SERVICE_COMMAND) $(SERVICE_EXE) $(STARTABLE)),) ifeq ($(strip $(SPK_COMMANDS) $(SPK_USR_LOCAL_LINKS)),) From a19b24f019ef68d45692a4a76077945442f806a5 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Thu, 15 Apr 2021 22:22:37 +0200 Subject: [PATCH 2/7] Use resource definitions for DSM6 - resource workers for ports/links/shares are supported from DSM>=6.0 - keep the /usr/local/{package} link in DSM 6 for now, as not all dependent packages are redesigned --- mk/spksrc.service.mk | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mk/spksrc.service.mk b/mk/spksrc.service.mk index 413e8ed0a57..3a4b7600140 100644 --- a/mk/spksrc.service.mk +++ b/mk/spksrc.service.mk @@ -60,12 +60,6 @@ else ifeq ($(call version_ge, ${TCVERSION}, 7.0),1) SPK_USER = $(SPK_NAME) endif -ifeq ($(strip $(STARTABLE)),yes) -# we only evaluate for STARTABLE=no -# STARTABLE=yes is default (same as STARTABLE not defined) -STARTABLE= -endif - # Recommend explicit STARTABLE=no ifeq ($(strip $(SSS_SCRIPT) $(SERVICE_COMMAND) $(SERVICE_EXE) $(STARTABLE)),) ifeq ($(strip $(SPK_COMMANDS) $(SPK_USR_LOCAL_LINKS)),) @@ -183,9 +177,16 @@ ifneq ($(strip $(SERVICE_WIZARD_SHARE)),) '."data-share" = {"shares": [{"name": $$share, "permission":{"rw":[$$user]}} ] }' $@ 1<>$@ endif SERVICE_FILES += $(DSM_CONF_DIR)/resource +else +ifneq ($(strip $(SPK_COMMANDS) $(SPK_USR_LOCAL_LINKS)),) + @echo "# List of commands to create links for" >> $@ + @echo "SPK_COMMANDS=\"${SPK_COMMANDS}\"" >> $@ + @echo "SPK_USR_LOCAL_LINKS=\"${SPK_USR_LOCAL_LINKS}\"" >> $@ + @cat $(SPKSRC_MK)spksrc.service.create_links >> $@ ifneq ($(findstring conf,$(SPK_CONTENT)),conf) SPK_CONTENT += conf endif +endif # Less than DSM 6.0 else From 3a46eb0219cd169a2fe92badc6ae3f200d52927b Mon Sep 17 00:00:00 2001 From: hgy59 Date: Fri, 16 Apr 2021 17:46:17 +0200 Subject: [PATCH 3/7] Update mk/spksrc.service.mk yes, here we can Co-authored-by: Sebastian Schmidt --- mk/spksrc.service.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/spksrc.service.mk b/mk/spksrc.service.mk index 3a4b7600140..0abf130bc52 100644 --- a/mk/spksrc.service.mk +++ b/mk/spksrc.service.mk @@ -177,6 +177,8 @@ ifneq ($(strip $(SERVICE_WIZARD_SHARE)),) '."data-share" = {"shares": [{"name": $$share, "permission":{"rw":[$$user]}} ] }' $@ 1<>$@ endif SERVICE_FILES += $(DSM_CONF_DIR)/resource + +# Less than DSM 6.0 else ifneq ($(strip $(SPK_COMMANDS) $(SPK_USR_LOCAL_LINKS)),) @echo "# List of commands to create links for" >> $@ From 48dfd067a9070aabbf48014855c2d9196afefd96 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sun, 21 Feb 2021 17:05:18 +1100 Subject: [PATCH 4/7] [Transmission] Acquire Shared folder resource/permissions set using SERVICE_WIZARD_SHARE only disadvantage is that this does not support sub-folders currently [Transmission] fix empty volume, consistency with naming --- spk/transmission/src/service-setup.sh | 6 +- spk/transmission/src/wizard/install_uifile | 188 +++++++++++++-------- 2 files changed, 125 insertions(+), 69 deletions(-) diff --git a/spk/transmission/src/service-setup.sh b/spk/transmission/src/service-setup.sh index a965b0bac3e..f3faa68ab62 100644 --- a/spk/transmission/src/service-setup.sh +++ b/spk/transmission/src/service-setup.sh @@ -2,12 +2,12 @@ # This gives tranmission the power to execute python scripts on completion (like TorrentToMedia). PYTHON_DIR="/usr/local/python" PATH="${SYNOPKG_PKGDEST}/bin:${PYTHON_DIR}/bin:${PATH}" -CFG_FILE="${SYNOPKG_PKGDEST}/var/settings.json" +CFG_FILE="${SYNOPKG_PKGVAR}/settings.json" TRANSMISSION="${SYNOPKG_PKGDEST}/bin/transmission-daemon" GROUP="sc-download" -SERVICE_COMMAND="${TRANSMISSION} -g ${SYNOPKG_PKGDEST}/var/ -x ${PID_FILE} -e ${LOG_FILE}" +SERVICE_COMMAND="${TRANSMISSION} -g ${SYNOPKG_PKGVAR} -x ${PID_FILE} -e ${LOG_FILE}" service_preinst () { @@ -30,7 +30,7 @@ service_postinst () { if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then # Edit the configuration according to the wizard - sed -i -e "s|@download_dir@|${wizard_download_dir:=/volume1/downloads}|g" ${CFG_FILE} + sed -i -e "s|@download_dir@|${wizard_volume}/${wizard_download_dir:=downloads}|g" ${CFG_FILE} sed -i -e "s|@username@|${wizard_username:=admin}|g" ${CFG_FILE} sed -i -e "s|@password@|${wizard_password:=admin}|g" ${CFG_FILE} if [ -d "${wizard_watch_dir}" ]; then diff --git a/spk/transmission/src/wizard/install_uifile b/spk/transmission/src/wizard/install_uifile index d6023c2bca1..ccd4e394fae 100644 --- a/spk/transmission/src/wizard/install_uifile +++ b/spk/transmission/src/wizard/install_uifile @@ -1,69 +1,125 @@ -[{ - "step_title": "Basic configuration", - "items": [{ - "type": "textfield", - "desc": "Download directory", - "subitems": [{ - "key": "wizard_download_dir", - "desc": "Download directory", - "defaultValue": "/volume1/downloads", - "validator": { - "allowBlank": false, - "regex": { - "expr": "/^\\\/volume\\w*[0-9]{1,2}\\\/[^<>: */?\"]*/", - "errorText": "Path should begin with /volumename?/ where volumename can be 'volume' or also 'volumeUSB' and ? is the volume number (1-99)." - } +[ + { + "step_title": "Basic configuration", + "items": [ + { + "type": "combobox", + "desc": "Please select a volume to use for the download folder", + "subitems": [ + { + "key": "wizard_volume", + "desc": "volume name", + "displayField": "display_name", + "valueField": "volume_path", + "editable": false, + "mode": "remote", + "api_store": { + "api": "SYNO.Core.Storage.Volume", + "method": "list", + "version": 1, + "baseParams": { + "limit": -1, + "offset": 0, + "location": "internal" + }, + "root": "volumes", + "idProperty": "volume_path", + "fields": [ + "display_name", + "volume_path" + ] + }, + "validator": { + "fn": "{console.log(arguments);return true;}" + } + } + ] + }, + { + "type": "textfield", + "desc": "Download shared folder (using the volume chosen above)", + "subitems": [ + { + "key": "wizard_download_dir", + "desc": "Download shared folder", + "defaultValue": "downloads", + "validator": { + "allowBlank": false, + "regex": { + "expr": "/^[\\w _-]+$/", + "errorText": "Subdirectories are not supported." + } + } + } + ] + }, + { + "type": "textfield", + "desc": "Watch a directory for torrent files and add them to transmission. Leave empty to disable", + "subitems": [ + { + "key": "wizard_watch_dir", + "desc": "Watch directory", + "validator": { + "allowBlank": true, + "regex": { + "expr": "/^\\\/volume\\w*[0-9]{1,2}\\\/[^<>: */?\"]*/", + "errorText": "Path should begin with /volumename?/ where volumename can be 'volume' or also 'volumeUSB' and ? is the volume number (1-99)." + } + } + } + ] + }, + { + "type": "textfield", + "desc": "Directory to keep files in until torrent is complete. Leave empty to disable", + "subitems": [ + { + "key": "wizard_incomplete_dir", + "desc": "Incomplete directory", + "validator": { + "allowBlank": true, + "regex": { + "expr": "/^\\\/volume\\w*[0-9]{1,2}\\\/[^<>: */?\"]*/", + "errorText": "Path should begin with /volumename?/ where volumename can be 'volume' or also 'volumeUSB' and ? is the volume number (1-99)." + } + } + } + ] } - }] - }, { - "type": "textfield", - "desc": "Watch a directory for torrent files and add them to transmission. Leave empty to disable", - "subitems": [{ - "key": "wizard_watch_dir", - "desc": "Watch directory", - "validator": { - "allowBlank": true, - "regex": { - "expr": "/^\\\/volume\\w*[0-9]{1,2}\\\/[^<>: */?\"]*/", - "errorText": "Path should begin with /volumename?/ where volumename can be 'volume' or also 'volumeUSB' and ? is the volume number (1-99)." - } + ] + }, + { + "step_title": "Basic configuration", + "items": [ + { + "type": "textfield", + "desc": "Web interface username. Defaults to admin", + "subitems": [ + { + "key": "wizard_username", + "desc": "Username" + } + ] + }, + { + "type": "password", + "desc": "Web interface password. Defaults to admin", + "subitems": [ + { + "key": "wizard_password", + "desc": "Password" + } + ] } - }] - }, { - "type": "textfield", - "desc": "Directory to keep files in until torrent is complete. Leave empty to disable", - "subitems": [{ - "key": "wizard_incomplete_dir", - "desc": "Incomplete directory", - "validator": { - "allowBlank": true, - "regex": { - "expr": "/^\\\/volume\\w*[0-9]{1,2}\\\/[^<>: */?\"]*/", - "errorText": "Path should begin with /volumename?/ where volumename can be 'volume' or also 'volumeUSB' and ? is the volume number (1-99)." - } + ] + }, + { + "step_title": "DSM Permissions", + "items": [ + { + "desc": "Permissions for all download-related packages of SynoCommunity are managed with the group 'sc-download' in DSM.
The group 'users' is no longer used as of DSM 6.
Package user will not appear on most UI settings.
Please read Permission Management for details." } - }] - }] -}, { - "step_title": "Basic configuration", - "items": [{ - "type": "textfield", - "desc": "Web interface username. Defaults to admin", - "subitems": [{ - "key": "wizard_username", - "desc": "Username" - }] - }, { - "type": "password", - "desc": "Web interface password. Defaults to admin", - "subitems": [{ - "key": "wizard_password", - "desc": "Password" - }] - }] -}, { - "step_title": "DSM Permissions", - "items": [{ - "desc": "Permissions for all download-related packages of SynoCommunity are managed with the group 'sc-download' in DSM.
The group 'users' is no longer used as of DSM 6.
Package user will not appear on most UI settings.
Please read Permission Management for details." - }] -}] + ] + } +] From 8a8e621b0dad3bf89ad7cb3d109d065b0f959f0d Mon Sep 17 00:00:00 2001 From: pkleinejaeger Date: Wed, 13 Jan 2021 02:39:38 +0100 Subject: [PATCH 5/7] Transmission: Remove busybox from deps (#4373) * Remove busybox dep * transmission: remove unnecessary GROUP setting from service-setup.sh * transmission: set GROUP for backwards compatibility * Undo SPK_REV/CHANGELOG * Adjust wizard text * Remove now superfluous busybox configs --- spk/transmission/Makefile | 7 +------ spk/transmission/src/service-setup.sh | 6 ------ spk/transmission/src/wizard/install_uifile | 2 +- spk/transmission/src/wizard/install_uifile_fre | 2 +- spk/transmission/src/wizard/upgrade_uifile | 4 ++-- spk/transmission/src/wizard/upgrade_uifile_fre | 4 ++-- 6 files changed, 7 insertions(+), 18 deletions(-) diff --git a/spk/transmission/Makefile b/spk/transmission/Makefile index ab526c5f624..a10ab7c2594 100644 --- a/spk/transmission/Makefile +++ b/spk/transmission/Makefile @@ -3,7 +3,7 @@ SPK_VERS = 3.00 SPK_REV = 19 SPK_ICON = src/transmission.png -DEPENDS = cross/busybox cross/$(SPK_NAME) +DEPENDS = cross/$(SPK_NAME) MAINTAINER = SynoCommunity DESCRIPTION = Transmission is an easy and fast BitTorrent client. You can control it remotely with its web interface or dedicated applications. @@ -30,13 +30,8 @@ ADMIN_PORT = $(SERVICE_PORT) POST_STRIP_TARGET = transmission_extra_install -BUSYBOX_CONFIG = usrmng -ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)" - - include ../../mk/spksrc.spk.mk - .PHONY: transmission_extra_install transmission_extra_install: install -m 755 -d $(STAGING_DIR)/var diff --git a/spk/transmission/src/service-setup.sh b/spk/transmission/src/service-setup.sh index f3faa68ab62..a065d5a5b1d 100644 --- a/spk/transmission/src/service-setup.sh +++ b/spk/transmission/src/service-setup.sh @@ -56,12 +56,6 @@ service_postinst () set_syno_permissions "${wizard_incomplete_dir}" "${GROUP}" fi fi - - # 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} } diff --git a/spk/transmission/src/wizard/install_uifile b/spk/transmission/src/wizard/install_uifile index ccd4e394fae..a8f3b66a800 100644 --- a/spk/transmission/src/wizard/install_uifile +++ b/spk/transmission/src/wizard/install_uifile @@ -118,7 +118,7 @@ "step_title": "DSM Permissions", "items": [ { - "desc": "Permissions for all download-related packages of SynoCommunity are managed with the group 'sc-download' in DSM.
The group 'users' is no longer used as of DSM 6.
Package user will not appear on most UI settings.
Please read Permission Management for details." + "desc": "Please read Permission Management for details." } ] } diff --git a/spk/transmission/src/wizard/install_uifile_fre b/spk/transmission/src/wizard/install_uifile_fre index 052ae3fd288..bea3414cbc4 100644 --- a/spk/transmission/src/wizard/install_uifile_fre +++ b/spk/transmission/src/wizard/install_uifile_fre @@ -64,6 +64,6 @@ }, { "step_title": "Permissions DSM", "items": [{ - "desc": "Les permissions de toutes les applications de SynoCommunity liés au téléchargement sont gérées par le groupe 'sc-download' dans DSM.
Le groupe 'users' n'est plus utilisé depuis DSM 6.
L'utilisateur spécifique à l'application n'apparaît plus dans la plupart des interfaces de configuration.
Merci de lire Permission Management pour plus de détails." + "desc": "Merci de lire Permission Management pour plus de détails." }] }] diff --git a/spk/transmission/src/wizard/upgrade_uifile b/spk/transmission/src/wizard/upgrade_uifile index bb14f409692..434a171a9bc 100644 --- a/spk/transmission/src/wizard/upgrade_uifile +++ b/spk/transmission/src/wizard/upgrade_uifile @@ -1,9 +1,9 @@ [{ "step_title": "DSM Permissions", "items": [{ - "desc": "Permissions for all download-related packages of SynoCommunity are managed with the group 'sc-download' in DSM.
The group 'users' is no longer used as of DSM 6.
Package user will not appear on most UI settings.
Please read Permission Management for details." + "desc": "Please read Permission Management for details." }, { - "desc": "NOTE: The package upgrade will try to set the correct permissions on your folders. If you get permission errors within Transmission, manually set Read/Write permissions for the 'sc-download' group on the reported folders using File Station." + "desc": "NOTE: The package upgrade will try to set the correct permissions on your folders. If you get permission errors within Transmission, manually set Read/Write permissions on the reported folders using File Station." }] }] \ No newline at end of file diff --git a/spk/transmission/src/wizard/upgrade_uifile_fre b/spk/transmission/src/wizard/upgrade_uifile_fre index 916e1d81e3d..b7892f9449c 100644 --- a/spk/transmission/src/wizard/upgrade_uifile_fre +++ b/spk/transmission/src/wizard/upgrade_uifile_fre @@ -1,9 +1,9 @@ [{ "step_title": "Permissions DSM", "items": [{ - "desc": "Les permissions de toutes les applications de SynoCommunity liés au téléchargement sont gérées par le groupe 'sc-download' dans DSM.
Le groupe 'users' n'est plus utilisé depuis DSM 6.
L'utilisateur spécifique à l'application n'apparaît plus dans la plupart des interfaces de configuration.
Merci de lire Permission Management pour plus de détails." + "desc": "Merci de lire Permission Management pour plus de détails." }, { - "desc": "NOTE: La mise à jour de l'application va tenter de corriger les permissions des répertoires. En cas d'erreur de permission dans Transmission, donner les droits de Lecture/Ecriture au groupe 'sc-download' sur les répertoires mentionnés depuis File Station." + "desc": "En cas d'erreur de permission dans Transmission, donner les droits de Lecture/Ecriture sur les repertoires mentionnès depuis File Station." }] }] \ No newline at end of file From e05045c587fd984512f88e28ef2b0a155d5b73a5 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 19 Jan 2021 21:12:36 +1100 Subject: [PATCH 6/7] =?UTF-8?q?Transmission:=20mentionn=C3=A8s=20->=20ment?= =?UTF-8?q?ionn=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spk/transmission/src/wizard/upgrade_uifile_fre | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spk/transmission/src/wizard/upgrade_uifile_fre b/spk/transmission/src/wizard/upgrade_uifile_fre index b7892f9449c..54c8894dd89 100644 --- a/spk/transmission/src/wizard/upgrade_uifile_fre +++ b/spk/transmission/src/wizard/upgrade_uifile_fre @@ -4,6 +4,6 @@ "desc": "Merci de lire Permission Management pour plus de détails." }, { - "desc": "En cas d'erreur de permission dans Transmission, donner les droits de Lecture/Ecriture sur les repertoires mentionnès depuis File Station." + "desc": "En cas d'erreur de permission dans Transmission, donner les droits de Lecture/Ecriture sur les repertoires mentionnés depuis File Station." }] -}] \ No newline at end of file +}] From ed82109b4da2210716381fb636de9f75dd024916 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sun, 18 Apr 2021 09:55:56 +1000 Subject: [PATCH 7/7] Transmission fix upgrade from dsm6 --- spk/transmission/src/wizard/upgrade_uifile | 53 +++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/spk/transmission/src/wizard/upgrade_uifile b/spk/transmission/src/wizard/upgrade_uifile index 434a171a9bc..bf6e12ad1cc 100644 --- a/spk/transmission/src/wizard/upgrade_uifile +++ b/spk/transmission/src/wizard/upgrade_uifile @@ -5,5 +5,56 @@ }, { "desc": "NOTE: The package upgrade will try to set the correct permissions on your folders. If you get permission errors within Transmission, manually set Read/Write permissions on the reported folders using File Station." + }, + { + "type": "combobox", + "desc": "Please select a volume to use for the download folder", + "subitems": [ + { + "key": "wizard_volume", + "desc": "volume name", + "displayField": "display_name", + "valueField": "volume_path", + "editable": false, + "mode": "remote", + "api_store": { + "api": "SYNO.Core.Storage.Volume", + "method": "list", + "version": 1, + "baseParams": { + "limit": -1, + "offset": 0, + "location": "internal" + }, + "root": "volumes", + "idProperty": "volume_path", + "fields": [ + "display_name", + "volume_path" + ] + }, + "validator": { + "fn": "{console.log(arguments);return true;}" + } + } + ] + }, + { + "type": "textfield", + "desc": "Download shared folder (using the volume chosen above)", + "subitems": [ + { + "key": "wizard_download_dir", + "desc": "Download shared folder", + "defaultValue": "downloads", + "validator": { + "allowBlank": false, + "regex": { + "expr": "/^[\\w _-]+$/", + "errorText": "Subdirectories are not supported." + } + } + } + ] }] -}] \ No newline at end of file +}]