Skip to content

Commit

Permalink
Fix for DSM6 priv cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Mar 11, 2023
1 parent 222145c commit 556773e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
6 changes: 2 additions & 4 deletions spk/owncloud/src/conf/privilege
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@
"run-as": "root"
}
],
"tool": {
"executable": {
"relpath": "bin/occ-cmd.sh",
"user": "package",
"group": "package",
"permission": "4755"
"run-as": "package"
},
"join-groupname": "http"
}
9 changes: 8 additions & 1 deletion spk/owncloud/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,27 @@ service_postuninst ()
${MKDIR} ${TEMPDIR}
WS_CFG_PATH="/usr/syno/etc/packages/WebStation"
PHP_CFG_FILE="PHPSettings.json"
CFG_UPDATE="no"
# Check for ownCloud PHP profile
if ${JQ} -e '.["com-synocommunity-packages-owncloud"]' "${WS_CFG_PATH}/${PHP_CFG_FILE}" >/dev/null; then
echo "Removing PHP profile for ownCloud"
${JQ} 'del(.["com-synocommunity-packages-owncloud"])' ${WS_CFG_PATH}/${PHP_CFG_FILE} > ${TEMPDIR}/${PHP_CFG_FILE}
${MV} ${WS_CFG_PATH}/${PHP_CFG_FILE} ${WS_CFG_PATH}/${PHP_CFG_FILE}.bak
rsync -aX ${TEMPDIR}/${PHP_CFG_FILE} ${WS_CFG_PATH}/ 2>&1
${RM} ${TEMPDIR}/${PHP_CFG_FILE}
CFG_UPDATE="yes"
fi
# Check for ownCloud Apache config
if [ -f "/usr/local/etc/apache24/sites-enabled/owncloud.conf" ]; then
echo "Removing Apache config for ownCloud"
${RM} /usr/local/etc/apache24/sites-enabled/owncloud.conf
CFG_UPDATE="yes"
fi
# Restart Apache if configs have changed
if [ "$CFG_UPDATE" = "yes" ]; then
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
fi
${SYNOSVC} --restart pkgctl-Apache2.4
fi
}

Expand Down
4 changes: 2 additions & 2 deletions spk/owncloud/src/wizard/install_uifile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

WEB_DIR="/var/services/web_packages"
# for backwards compatability
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ];then
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ]; then
WEB_DIR="/var/services/web"
fi
OCROOT="${WEB_DIR}/${SYNOPKG_PKGNAME}"
DATADIR="/volume1/@appdata/owncloud/data"
# for backwards compatability
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ];then
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ]; then
DATADIR="$(realpath ${WEB_DIR})/${SYNOPKG_PKGNAME}/data"
fi

Expand Down
8 changes: 7 additions & 1 deletion spk/owncloud/src/wizard/uninstall_uifile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

WEB_DIR="/var/services/web_packages"
# for backwards compatability
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ];then
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ]; then
WEB_DIR="/var/services/web"
if [ -z ${SYNOPKG_PKGDEST_VOL} ]; then
SYNOPKG_PKGDEST_VOL="/volume1"
fi
if [ -z ${SYNOPKG_PKGDEST} ]; then
SYNOPKG_PKGDEST="/var/packages/owncloud/target"
fi
fi
OCC="${SYNOPKG_PKGDEST}/bin/occ-cmd.sh"
DATADIR="$(${OCC} config:system:get datadirectory)"
Expand Down
2 changes: 1 addition & 1 deletion spk/owncloud/src/wizard/upgrade_uifile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

WEB_DIR="/var/services/web_packages"
# for backwards compatability
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ];then
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ]; then
WEB_DIR="/var/services/web"
fi
OCROOT="${WEB_DIR}/${SYNOPKG_PKGNAME}"
Expand Down

0 comments on commit 556773e

Please sign in to comment.