How to make TrueNAS home directory as Nextcloud users' data directory

Hi folks,

I’m planning to install Nextcloud on TrueNAS Scale OS.

The main goal in the installation process is to let Nextcloud work with TrueNAS users and have its data directory located there.

for example I have the user’s home directory structure in TrueNAS:

/mnt/tank/home
|_User1
|_User2
|_User3

I want these users to use their home directories in netxcloud instead of directory created elsewhere by Nextcloud installation.

So what steps do I have to complete in order to achieve this?

Thanks

AFAIK there is no way to integrate Nextcloud with underlying OS. You can use different single-sign-in sso options like oidc saml and ldap but is for login only. The data stored in Nextcloud remains separated and under the control of the application.

In general you should avoid tempering with NC storage from “outside” as the application obviously can not track changes and for this reason NC can not provide it’s added functionality over plain storage system like file versions, recycle bin etc…

I would ask this question at truenas forum as this is more related to their Nextcloud app.

As @wwe mentioned it’s not the best idea to have other applications accessing and modifying the NC home directory but nevertheless here’s my suggestion how to do it:

NC has a structure of /nc-data-directory/username
Your home users stay in /mnt/tank/home/username

  1. You could set your NC Data directory to /mnt/tank/home (but that’s a highly stupid idea)

  2. You could set a symlink from /mnt/tank/home/username to /nc-data-directory/username .

But one main problem I see is permissions: Webserver obviously needs permission to read and write to user’s directories. Therefore you must put all your users in the same group as your webserver and then tinker around with ACLs.

What is your reason to have home directory + NC home at the same place?

Well,

The main reason is that I want the users to be organized. Mainly, I was expecting from nextcloud to use user’s folders, because otherwise each user must then move their files uploaded to nextcloud folder to their “native” folder.

For example, using Nextcloud app, I want to free up my mobile phone storage by uploading files directly to my TrueNAS folder instead of Nextcloud user folder. Because otherwise, I have to then move all these files from nextcloud user folder to TrueNAS user folder.

I found “External Stogate Support” app in Nextcloud and activated it, then mounted my user folder in nextcloud app. I was kinda happy at the beginning but then I’ve discovered a whole bunch of errors in nextcloud.log like:

“Undefined array key "attributes" at /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php#155”
“Malformed state response from server”

WELL KNOWN BUG/ISSUE in nextcloud, that I can’t fix it TrueNAS environment.

Fighting continues…