External storage user and permissions

Hi there,
I set up a nextcloud installation on my fileserver in my local LAN:

  • Debian 10 (running in proxmox VM)
  • Apache
  • MariaDb

Basically, eveything is working as intentended.
However, the files (Photos, Documents…) are shared in my LAN by sshfs, smb or by directly moving files in the fileserver. All files belong to my Linux user “lugge”.
Basically, I want my nextcloud to only sit on-top of an already-existing infrastructure. For example, to upload photos from my phone via folder synchronisation.

I added the existing fileserver filesystem into nextcloud as local share with the external storage App.
Then, I added the www-data user (under which apache/php is running) to group lugge.
By this, nextcloud is able to write to the local folder.

However, every file created by nextcloud belongs to user www-data.
This is a problem for me. I want nextcloud to be an additional interface for accessing my files, but I don’t want my filesystem littered with files belonging to some strange www-data user.

Quick and dirty, I could set up a cronjob for changing file owner every 10 minutes.
But this would be only a workaround. Any solution for this?

Quick and dirty answer… I think Nextcloud is not the right product for your usecase. Maybe someting like https://filerun.com/ is better suited for you. Or maybe have a look at this list…

https://github.com/awesome-selfhosted/awesome-selfhosted#web-based-file-managers

In addition to my previous post…

Have you ever tried to mount the smb share directly with the smb option in the External storage app instead of mounting it to the filessystem of your server and add it as local storage? That way it should save the files with the user who logs in to the smb server and not with www-data

Other than that I still think Nextloud is probably not the right solution if you primarily want a web frontend / file manager for existing filessystems. It is simply not designd for that usecase…

Hi bb77, including the folder via samba is a good idea, will try.
The folder is stored in the server’s internal disk, thus, my first thought was including it via local option.

filerun looks good btw, however, I don’t like that it is encrypted and not open source.
Nextcloud does also provide other useful stuff, thus, nextcloud might not be the 100% solution for my current task, but the best solution overall.
Thanks for your reply.

1 Like