As a workaround for this problem that has cropped up in recent versions of Nextcloud, I needed to figure out how to configure external storage from the command line. This is a short list of commands I’ve found useful.
(I’m running the Docker image provided by Nextcloud, modified to support SMB. Samba runs in another container on the same host. Replace the italicized text with appropriate values for your installation.)
List external shares for a user: docker exec -u 82 nextcloud php occ files_external:list username
(The first column will list an ID that is needed for some commands.)
Create an external share:docker exec -u 82 nextcloud php occ files_external:create --user username share_name smb password::password -c host=samba_hostname -c share=samba_share_name -c root= -c domain=samba_domain -c user=samba_user -c password=samba_passord -c case_sensitive=true
Enable sharing:docker exec -u 82 nextcloud php occ files_external:option id enable_sharing true
Delete a share:docker exec -iu 82 nextcloud php occ files_external:delete id
(You’ll need to confirm that you want to do this…hence docker exec -i
.)
Scan for files within a share:docker exec -u 82 nextcloud php occ files:scan -p /username/files/share_name
username
(I haven’t needed to do this after creating a share, but YMMV.)