How to get access to TN share from Nextcloud

profwalken

Patron
Joined
Nov 19, 2013
Messages
410
Hi,
my goal is to give some remote users access in read only mode to a dataset shared with SMB, to give more details,
  • I have set a dataset A
  • Rights are default to root and wheel + a group A
  • I have set rights to full acess for a group A with 2 members
  • I have a nextcloud plugin in jail running on TN13
Now all what I tried since now failed to get a working access to folders and files, I'm out of ideas and probably not doing the good things.
  1. I added a mount point from where my data are in Dataset A and pointing to jail in \media and set in read only mode
  2. in Nextcloud Admin I enabled external storage
  3. I set the link in Nexcloud to be able to view external ressource (in my case dataset A)

  4. All this is not working on TN side with TN user i'm able to do everything on Dataset A folders but nothing is visible on nextcloud side.
What is my missing or bad action? is there a bug in TN13 on permissions ?

Any expert idea is a gift , thanks in advance for your time
 

EtienneB

Explorer
Joined
Feb 19, 2018
Messages
78
You probably already tried/done is and I give you my noob take.
SMB won't allow root/wheel as far as I know.
For nextcloud to access a folder you need to add www group to its permissions, at least that is what I did to share folders between my mac and TN using nextcloud.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The www group etc. is only needed for write permissions. I have a share named "Medien" located in "/mnt/hdd/share/medien" (that's "media" in German) and did this mount into my Nextcloud jail:
Bildschirmfoto 2022-05-19 um 21.46.06.png

Then I added an external storage connection in Nextcloud:
Bildschirmfoto 2022-05-19 um 21.48.39.png

Note that the path to configure in the Nextcloud settings is relative to the jail's root. So when the share is mounted in /mnt/ssd/iocage/jails/cloud/root/var/medien, then the path is /var/medien inside that jail.
Also you need to create that folder inside the jail before doing the first step.
 
Last edited:

profwalken

Patron
Joined
Nov 19, 2013
Messages
410
Well thanks , both of you for answers and now without knowing exactly why all is working fine. I get what I wanted, in local one user is feeding a shared folder (SMB) and from nextcloud connections users are in read only mode . That's really good when it works:wink:.

Other details, I wanted to understand where it could be changed :
  • Synchronisation timeout seems to be delayed almost 10 or more minutes between content updated in source folder and what is displayed in nextcloud. Do you know where this can be changed to reduce time to wait to see same on both ends?
  • How to access admin DB from Truenas ?
Do you manage Certs and Domains in TN to be able to access nextcloud from everywhere? if so, are you able to explain how to set this on TN as this is a nightmare for me.
 

EtienneB

Explorer
Joined
Feb 19, 2018
Messages
78
Good to see that you got it working.
I have not seen a syncing delay (nor a setting for it), it happens immediately on my end by default. I use the nextcloud desktop app on my macbook. Perhaps a slow upload speed?

I have registered a domain, connected that to Cloudflare and use a subdomain (e.g. nextcloud.mydomain.com) to connect to the nextcloud plugin from everywhere I want.
I have a separate jail running a nginx reverse proxy. So the only port open on my router is 443 that forwards to nginx jail and from there it goes to the different jails/plugins e.g. nextcloud.
Cloudflare also takes care of the ssl certificates.
Networkchuck on youtube has a good video on cloudflare setup: https://youtu.be/LlbTSfc4biw

People like Traefik too as a reverse proxy, I might switch to that as it is a default app in TN Scale.
 

profwalken

Patron
Joined
Nov 19, 2013
Messages
410
Hi Etienne,
Sync delay is not in the way NC to TN Share (as this for me, is impossible because I want nextcloud folders to be in read only mode) so I have set the jail in read only mode and this works like I want. No one from NC users can modify or delete content.

Delay is occurring when on TN13 SMB share, the user granted for folders update add or remove content or rename and these update are not real time visible from nextcloud side. it takes almost 10 minutes to see the updated content.
 
Top