diff --git a/mk/spksrc.service.installer b/mk/spksrc.service.installer index fcde26135dc..1ac8bb673d9 100644 --- a/mk/spksrc.service.installer +++ b/mk/spksrc.service.installer @@ -71,6 +71,9 @@ save_wizard_variables () if [ -n "${SHARE_PATH}" ]; then echo "SHARE_PATH=${SHARE_PATH}" >> ${INST_VARIABLES} fi + # Restriction permissions to protect sensitive options + chmod go-rwx ${INST_VARIABLES} + chown ${EFF_USER} ${INST_VARIABLES} } # Remove user from system and from groups it is member of diff --git a/spk/demoservice/Makefile b/spk/demoservice/Makefile index 205fee2c466..273c4b6ad06 100644 --- a/spk/demoservice/Makefile +++ b/spk/demoservice/Makefile @@ -1,6 +1,6 @@ SPK_NAME = demoservice -SPK_VERS = 1.2 -SPK_REV = 6 +SPK_VERS = 1.3 +SPK_REV = 10 SPK_ICON = src/demoservice.png override ARCH= diff --git a/spk/demoservice/PLIST b/spk/demoservice/PLIST index a7ac9e4c865..2f4b57d2738 100644 --- a/spk/demoservice/PLIST +++ b/spk/demoservice/PLIST @@ -1 +1 @@ -bin:README \ No newline at end of file +rsc:README \ No newline at end of file diff --git a/spk/demoservice/src/service-setup.sh b/spk/demoservice/src/service-setup.sh index 13cf0f58ea7..2bdbbf2844e 100644 --- a/spk/demoservice/src/service-setup.sh +++ b/spk/demoservice/src/service-setup.sh @@ -18,6 +18,7 @@ service_preinst () service_postinst () { echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG + echo "CUSTOM_OPTION=${wizard_custom_option}" >> ${INST_VARIABLES} } service_preuninst () @@ -25,7 +26,7 @@ service_preuninst () echo "service_preuninst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG } -service_postinst () +service_postuninst () { echo "service_postuninst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG } diff --git a/spk/demoservice/src/wizard/install_uifile b/spk/demoservice/src/wizard/install_uifile index 83cc56f0f13..7cfa5a4d881 100644 --- a/spk/demoservice/src/wizard/install_uifile +++ b/spk/demoservice/src/wizard/install_uifile @@ -29,6 +29,10 @@ "errorText": "Not allowed character in group name" } } + }, + { + "key": "wizard_custom_option", + "desc": "Demoservice custom option", } ] } diff --git a/spk/demoservice/src/wizard/upgrade_uifile.sh b/spk/demoservice/src/wizard/upgrade_uifile.sh new file mode 100644 index 00000000000..f309341e3e2 --- /dev/null +++ b/spk/demoservice/src/wizard/upgrade_uifile.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +INST_ETC="/var/packages/${SYNOPKG_PKGNAME}/etc" +INST_VARIABLES="${INST_ETC}/installer-variables" + +# Reload wizard variables stored by postinst +if [ -r "${INST_VARIABLES}" ]; then + . "${INST_VARIABLES}" +fi + +cat < $SYNOPKG_TEMP_LOGFILE +[ + { + "step_title": "Example configuration for demoservice", + "items": [ + { + "type": "textfield", + "desc": "Download configuration", + "subitems": [ + { + "key": "wizard_download_dir", + "desc": "Download location", + "defaultValue": "${SHARE_PATH}", + "validator": { + "allowBlank": false, + "regex": { + "expr": "/^\\\/volume[0-9]{1,2}\\\/[^<>: */?\"]*/", + "errorText": "Path should begin with /volume?/ where ? is volume number (1-99)" + } + } + }, + { + "key": "wizard_group", + "desc": "DSM group", + "defaultValue": "${GROUP}", + "validator": { + "allowBlank": false, + "regex": { + "expr": "/^[^<>:*/?\"]*$/", + "errorText": "Not allowed character in group name" + } + } + }, + { + "key": "wizard_custom_option", + "desc": "Demoservice custom option", + "defaultValue": "${CUSTOM_OPTION}", + } + ] + } + ] + }, + { + "step_title": "Attention! DSM Permissions", + "items": [ + { + "desc": "Permissions are managed with the group 'sc-download' in DSM." + } + ] + } +] +EOF +exit 0