[arch-commits] Commit in nextcloud/trunk (PKGBUILD nextcloud.install nextcloud.occ.sh)
David Runge
dvzrv at archlinux.org
Sun Feb 21 09:47:53 UTC 2021
Date: Sunday, February 21, 2021 @ 09:47:53
Author: dvzrv
Revision: 867619
upgpkg: nextcloud 21.0.0-6: Rebuild to make file installation more generic.
Make the find call to install files of the web app more generic.
Change the group ownership of directories below /usr/share/webapps/nextcloud
back to root in the .install file (with nextcloud < 21.0.0 the files were
recursively assigned to the http group, but this is not necessary).
Install writable app and data dir with 770 file mode.
Amend the .install message to not reference the previous (wrongly introduced)
location of the configuration file.
Amend the /usr/bin/occ command to allow overrides with NEXTCLOUD_USER,
NEXTCLOUD_PHP and NEXTCLOUD_PHP_CONFIG (for user, php and php config
respectively).
Modified:
nextcloud/trunk/PKGBUILD
nextcloud/trunk/nextcloud.install
nextcloud/trunk/nextcloud.occ.sh
-------------------+
PKGBUILD | 6 +++---
nextcloud.install | 3 ++-
nextcloud.occ.sh | 19 ++++++++++++++-----
3 files changed, 19 insertions(+), 9 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-02-21 09:41:25 UTC (rev 867618)
+++ PKGBUILD 2021-02-21 09:47:53 UTC (rev 867619)
@@ -54,7 +54,7 @@
'6f9f284d78d414a3bb7c159a812b105e31e8cd2393afee44465701e6f18169709f6d492d790e403e1e66f308c51b6b6496d29ddce29e4fac2c73a3c84a10c7fe'
'92592f9a76ee534d0ae6d3aedf2257c147337debe7e2d6dbec1daff66a682e3abc74611e08662058de314bf3ea6ff1c85efd678674b782d71251c38786e446f9'
'7b18b73ee369607b8ee3d00d2a054262a7b8f3033fc4873eb333c9b9333d7338870c035910ae123b564a65d7d245730178137311048f0713d5bc524de3654923'
- '23f963f17dd760825417644fdd1a24ef04109a30daf601771ea94c480d5ae9190c37227f0de6779f6876bcd22f41eaa3a96e9d5127cc0472e1ad744526e97c36'
+ '32d88eafe9725db7eed7b5d47ad302b24d8e5bbbf9cff6100b4b1185b40e8a61b6b25ce5364986f0cc7ff3e74b6256c81380ec980956a0779fee8d5c8085615f'
'1d06f339c43d57e5f5406c2698b815241fd9e39039a9e55f777face510c9a5ddae5ccd4e051393e8f16f391301a6aa03fff2462837a2d3441d969ea7195e7d84'
'220837083fe6ea19f506642d7bc465f4ad8c4daa7d374875f6f9026cc2e893d5a077d161b6e6e8f335718c6b8f488378649273218db19c30fa48e391afb5fb5e'
'a3ebcabcdb8c2d2653f44a248abd213bc4dbb317766b82c8f3e93b31e72ace350d7e8037bd4e22a632ab33f739e1941467b0e9d2cf7d0a7433227b4169030051')
@@ -63,7 +63,7 @@
'a7e1aa1d8cb2b0ff7832bb7d6d857987733253317c0f3727e744502aeaa3b2008351b47ecc24e348fe7b252cefaffe2418797523ee288dfd55e128917e8fbe2c'
'4ad061efbc20b4d0e9f8cfd01c5e8e612fa5af29bce754b77f90c1835b98ee445ef4de3d8c83da91461053622620af14d880eb9014b51f2383c75f1860d479f4'
'772a9571fe7d88dbcbeb46351a188354e237dfe8e020131f2752b3a36cff0ff177423b4cfd6a1a5f28946f86a8581f3e24ee06ebda7260c5f862ca4071908e43'
- 'eb0ff4fbcc95cbd1463d53fedb1e30bba08f62c0f2684899fa75286bfac74eb0ec5358a9488cbc6385d048a4f4b42292202d54f628c6358548cd02e032693e24'
+ '054eab4d46cbd9f7436eb2d7e5b3e979477890a12f84b09ee61002e76249d91e4efb77baa5546c82042ea3205ebb617df94066748acce330b2f59b6fba16f3e0'
'1a61a89531636b65dade03cd7edca8747b3e1e880f9bbd4d5a53cffa452d70fe17e345cfed739ae92e99e336d4c1f2633c84a5c84a4ee6da518762bf1396b1db'
'30e5f0e67ce8004cc3a1d08009c452549c65041b0da4d8f5d630b62ea7cc77a028907c388144f37774b839ca449d0977afb95145501ef620bface8e714754e38'
'd3c66e22c3cc1b8de1c0b60cd32701080d599dc9853af41d9d9d493ffe3a8d9a2573455d80dd0de019dfe9992187cb23b9df90c18f0ca5962912566014c6779c')
@@ -83,7 +83,7 @@
"${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
# state dir for data and writable apps
install -vdm 750 "${pkgdir}/var/lib/${pkgname}/"
- install -vdm 755 "${pkgdir}/var/lib/${pkgname}/"{apps,data}
+ install -vdm 770 "${pkgdir}/var/lib/${pkgname}/"{apps,data}
# log dir
install -vdm 755 "${pkgdir}/var/log/${pkgname}/"
# uwsgi integration
Modified: nextcloud.install
===================================================================
--- nextcloud.install 2021-02-21 09:41:25 UTC (rev 867618)
+++ nextcloud.install 2021-02-21 09:47:53 UTC (rev 867619)
@@ -5,8 +5,9 @@
printf "WARNING: Major changes introduced to package!\n"
printf " The application is now run as its own user - nextcloud.\n"
printf " Default directories for runtime, state and log files are provided.\n"
- printf " The configuration file is now in /etc/webapps/nextcloud/config.php.\n"
printf " A convenience wrapper around occ is provided in /usr/bin/occ.\n"
fi
+ # directories below /usr/share/webapps/nextcloud are still group-owned by the
+ # nextcloud user due to nextcloud < 21.0.0
find /usr/share/webapps/nextcloud -type d -exec chgrp root {} \;
}
Modified: nextcloud.occ.sh
===================================================================
--- nextcloud.occ.sh 2021-02-21 09:41:25 UTC (rev 867618)
+++ nextcloud.occ.sh 2021-02-21 09:47:53 UTC (rev 867619)
@@ -2,9 +2,11 @@
readonly default_config="/etc/php/php.ini"
readonly default_php_command="/usr/bin/php"
+readonly default_user="nextcloud"
config=""
php_command=""
+user=""
check_sudo() {
if ! command -v sudo > /dev/null; then
@@ -16,17 +18,24 @@
check_sudo
# allow overriding the php.ini
-if [[ -n "${PHP_CONFIG}" ]] && [[ -f "${PHP_CONFIG}" ]]; then
- config="${PHP_CONFIG}"
+if [[ -n "${NEXTCLOUD_PHP_CONFIG}" ]] && [[ -f "${NEXTCLOUD_PHP_CONFIG}" ]]; then
+ config="${NEXTCLOUD_PHP_CONFIG}"
else
config="${default_config}"
fi
# allow overriding the php executable
-if [[ -n "${PHP}" ]] && command -v "${PHP}" > /dev/null; then
- php_command="${PHP}"
+if [[ -n "${NEXTCLOUD_PHP}" ]] && command -v "${NEXTCLOUD_PHP}" > /dev/null; then
+ php_command="${NEXTCLOUD_PHP}"
else
php_command="${default_php_command}"
fi
-sudo -u nextcloud "$php_command" -c "${config}" /usr/share/webapps/nextcloud/occ "$@"
+# allow overriding the user to run as
+if [[ -n "${NEXTCLOUD_USER}" ]] && uid "${NEXTCLOUD_USER}" > /dev/null 2>&1; then
+ user="${NEXTCLOUD_USER}"
+else
+ user="${default_user}"
+fi
+
+sudo -u "$user" "$php_command" -c "${config}" /usr/share/webapps/nextcloud/occ "$@"
More information about the arch-commits
mailing list