Skip to content

Commit

Permalink
ownCloud: Fix bug in wizard scripts (SynoCommunity#5953)
Browse files Browse the repository at this point in the history
* Fix shared folder regex
* Fix export path regex
* Fix wizard logic
* Version bump
  • Loading branch information
mreid-tt authored Dec 9, 2023
1 parent 0c4fe12 commit af94cfc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spk/owncloud/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = owncloud
SPK_VERS = 10.13.3
SPK_REV = 14
SPK_REV = 15
SPK_ICON = src/owncloud.png

DEPENDS = cross/owncloud
Expand Down
14 changes: 6 additions & 8 deletions spk/owncloud/src/wizard_templates/install_uifile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ if [ -z ${SYNOPKG_PKGDEST_VOL} ]; then
SYNOPKG_PKGDEST_VOL="/volume1"
fi
SHAREDIR="${SYNOPKG_PKGNAME}"
DIR_VALID="/^[\\w _-]+$/"

quote_json ()
{
Expand Down Expand Up @@ -144,12 +143,11 @@ EOF
check_php_profiles ()
{
PHP_CFG_PATH="/usr/syno/etc/packages/WebStation/PHPSettings.json"
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
if jq -e 'to_entries | map(select((.key | startswith("com-synocommunity-packages-")) and .key != "com-synocommunity-packages-owncloud")) | length > 0' "${PHP_CFG_PATH}" >/dev/null; then
return 0 # true
else
return 1 # false
fi
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ] && \
jq -e 'to_entries | map(select((.key | startswith("com-synocommunity-packages-")) and .key != "com-synocommunity-packages-owncloud")) | length > 0' "${PHP_CFG_PATH}" >/dev/null; then
return 0 # true
else
return 1 # false
fi
}

Expand Down Expand Up @@ -195,7 +193,7 @@ PAGE_ADMIN_CONFIG=$(/bin/cat<<EOF
"validator": {
"allowBlank": false,
"regex": {
"expr": "$(echo ${DIR_VALID} | quote_json)",
"expr": "/^[\\\w.][\\\w. -]{0,30}[\\\w.-][\\\\$]?$|^[\\\w][\\\\$]?$/",
"errorText": "{{{OWNCLOUD_DATA_DIRECTORY_VALIDATION_ERROR_TEXT}}}"
}
}
Expand Down
2 changes: 1 addition & 1 deletion spk/owncloud/src/wizard_templates/uninstall_uifile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ getValidPath()
VALID_PATH=$(/bin/cat<<EOF
{
var exportPath = arguments[0];
const pattern = /^\/volume[0-9]+\//;
const pattern = /^\/(volume|volumeUSB)[0-9]+\//;
if (exportPath === "") {
return true;
} else if (pattern.test(exportPath)) {
Expand Down

0 comments on commit af94cfc

Please sign in to comment.