1

I have installed Nextcloud via snaps, and it stores its files under /var/snap/nextcloud/common/nextcloud/data/FriedRose/files, owned by root. I like to give my normal user access to read and write to /var/snap/nextcloud/common/nextcloud/data/FriedRose/files/downloads.

How can I achieve this without creating a security risk or breaking the snap package? Is giving all directories in this path the executable permission, and giving the downloads directors read and write permission, a good solution? (chmod a+x ...). If this is a good solution, then is there a way to automatically do it or should I write a little function to break up a path into all its directories?

HappyFace
  • 325
  • Here is one possible solution: https://askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct. – pa4080 Jan 10 '19 at 09:36

1 Answers1

2

You shouldn't access directly to this data folder, and file modification will break your nextcloud instance as it store many meta data (file size, file hash, etc...) into a database.

If you need to share a folder between Nextcloud and a local user, you should use External Storage which is a Nextcloud module.

https://docs.nextcloud.com/server/14/admin_manual/configuration_files/external_storage_configuration_gui.html

With this module, you will be able to add an external storage as folder (choose Local as Storage) and choose any folder on your hard drive where you will store your data.

ob2
  • 3,553
  • No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated. – HappyFace Jan 10 '19 at 09:27
  • Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap. – ob2 Jan 10 '19 at 09:37