1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

[enh] Enable sharing of the Home's external storage

This commit is contained in:
Jérôme Lebleu 2016-10-10 15:00:34 +02:00
parent feb5ac0ebc
commit fa25e50052
4 changed files with 15 additions and 5 deletions

View file

@ -16,7 +16,8 @@ this package:
* Integrate with YunoHost users and SSO - i.e. logout button
* Allow one user to be the administrator (set at the installation)
* Optionally access the user home folder from Nextcloud files (set at the installation)
* Optionally access the user home folder from Nextcloud files (set at the
installation, the sharing is enabled by default)
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's
not already served - i.e. by Baïkal

View file

@ -72,6 +72,17 @@ exec_occ() {
php occ --no-interaction --no-ansi "$@")
}
# Create the external storage for the home folders and enable sharing
# usage: create_home_external_storage OCC_COMMAND
create_home_external_storage() {
local OCC=$1
local mount_id=`$OCC files_external:create --output=json \
'Home' 'local' 'null::null' -c 'datadir=/home/$user' || true`
! [[ $mount_id =~ ^[0-9]+$ ]] \
&& echo "Unable to create external storage" 1>&2 \
|| $OCC files_external:option "$mount_id" enable_sharing true
}
# Check if an URL is already handled
# usage: is_url_handled URL
is_url_handled() {

View file

@ -122,8 +122,7 @@ _exec_occ ldap:test-config \'\' \
# Enable External Storage and create local mount to home folder
if [[ $user_home -eq 1 ]]; then
_exec_occ app:enable files_external
_exec_occ files_external:create \
'Home' 'local' 'null::null' -c 'datadir=/home/$user'
create_home_external_storage '_exec_occ'
fi
# Add dynamic logout URL to the config

View file

@ -196,8 +196,7 @@ if [[ ${user_home} -eq 1 ]]; then
_exec_occ app:enable files_external
_exec_occ files_external:list --output=json \
| grep -q '"storage":"\\\\OC\\\\Files\\\\Storage\\\\Local"' \
|| _exec_occ files_external:create \
'Home' 'local' 'null::null' -c 'datadir=/home/$user'
|| create_home_external_storage '_exec_occ'
fi
# Add dynamic logout URL to the config