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

[enh] Create as needed local home mount with External Storage

This commit is contained in:
Jérôme Lebleu 2016-05-10 22:59:03 +02:00
parent 2dfd4b482c
commit c02d6c39dd
3 changed files with 12 additions and 4 deletions

View file

@ -41,8 +41,6 @@ Again, upgrading from the current official package should be used for testing on
## TODO
* Update the external storage plugin configuration - see
[here](https://doc.owncloud.org/server/9.0/admin_manual/configuration_server/occ_command.html#files-external-label)
* Add a *clean* argument to the remove script to delete data folder?
* ...

View file

@ -104,7 +104,6 @@ _exec_occ maintenance:install \
|| die "Unable to install ownCloud"
# Enable plugins and set ownCloud configuration
_exec_occ app:enable files_external
_exec_occ app:enable user_ldap
_exec_occ ldap:create-empty-config
_exec_occ config:import "$oc_conf"
@ -114,6 +113,11 @@ sudo rm -f "$oc_conf"
_exec_occ ldap:test-config \'\' \
|| die "An error occured during LDAP configuration"
# Enable External Storage and create local mount
_exec_occ app:enable files_external
_exec_occ files_external:create \
'Home' 'local' 'null::null' -c 'datadir=/home/$user'
# Add dynamic logout URL to the config
_exec_occ config:system:get logout_url >/dev/null 2>&1 \
|| sudo su -c "echo \"

View file

@ -98,11 +98,17 @@ _exec_occ upgrade \
|| ([[ $? -eq 3 ]] || die "Unable to upgrade ownCloud")
# Enable plugins and set ownCloud configuration
_exec_occ app:enable files_external
_exec_occ app:enable user_ldap
_exec_occ config:import "$oc_conf"
sudo rm -f "$oc_conf"
# Enable External Storage and create local mount as needed
_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'
# Add dynamic logout URL to the config
# TODO: if changes are made to this section, replace it with new one.
_exec_occ config:system:get logout_url >/dev/null 2>&1 \