Recycle Bin Samba NS8

The bug fix is under development, it will be released with the selective file/folder restore feature. Custom Samba recycle setting breaks the share list · Issue #7154 · NethServer/dev · GitHub

1 Like

We are talking about Windows ffrom Microsoft?

It DOES matter !!!

My 2 cents
Andy

@davidep Thanks for the info and the link to the issue.

Hi @davidep The update has been released in the meantime, but unfortunately I am experiencing the same problems again.
Regardless of whether I use include.conf or set the parameters via net conf setparm, the authorizations of my shares are being destroyed again.

With the parameter

net conf setparm share “spotlight backend” elasticsearch

even all shares disappear.

I have now managed to restore the permissions, but I don’t dare to do any more tests until the error has really been fixed.

Can you confirm the error?

Best, Erwin

In this case, elasticsearch and fscrawler needs to be installed, see also Spotlight with Elasticsearch Backend - SambaWiki
I think it didn’t work because of these missing packages.

Why do you need it? I need to check but maybe we could install it in the container for testing…

EDIT:

Another thing to consider is that

vfs objects = fruit streams_xattr

may overwrite the old default vfs objects settings that may be also be needed to make it work.

1 Like

Hi @mrmarkuz It was recommended to me by Apple Support to optimize the search for shares on the Mac. I don’t know whether these settings would really help and therefore wanted to test them. The whole thing feels very complicated to me now, I’m glad that my shares are working again and I don’t really have the confidence to try it.

The setting for

vfs objects = fruit streams_xattr

I also did this, but it still didn’t work.

I have also only tried the following settings.

net conf setparm testfolder “vfs objects” recycle
net conf setparm testfolder recycle:exclude_dir /tmp,/Temp,/temp,/cache
net conf setparm testfolder recycle:repository “Recycle Bin”
net conf setparm testfolder recycle:versions True
net conf setparm testfolder recycle:keeptree True
net conf setparm testfolder recycle:touch True
net conf setparm testfolder recycle:directory_mode 0770
net conf setparm testfolder recycle:exclude .tmp,.temp,.o,.obj,~$

But that also ruined my shares again.

These settings did not work either.

net conf setparm Global “vfs objects” “fruit streams_xattr”
net conf setparm Global “fruit:metadata” stream
net conf setparm Global “fruit:model” MacSamba
net conf setparm Global “fruit:veto_appledouble” no
net conf setparm Global “fruit:nfs_aces” no
net conf setparm Global “fruit:wipe_intentionally_left_blank_rfork” yes
net conf setparm Global “fruit:delete_empty_adfiles” yes
net conf setparm Global “fruit:posix_rename” yes

And these settings in include.conf did not work either.

vfs objects = fruit streams_xattr
fruit:metadata = stream
fruit:model = MacSamba
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:posix_rename = yes

In the end, I was just happy when I got my shares back.

1 Like

I’m going to check that this weekend and report as soon as I got it working on server side. I don’t have a running Mac system/VM so I’m not able to really test the client side.

@mrmarkuz Many thanks for your help.

1 Like

I think it’s the best way (less work) to include all the options except the vfs objects in the global section.
For example for the recycle bin I added the following to include.conf.

To edit the include.conf enter the samba environment:

runagent -m samba1

Edit the include.conf file using nano editor:

podman unshare nano $(podman volume inspect config --format={{.Mountpoint}})/include.conf

Add following content:

[global]
recycle:exclude_dir = /tmp,/temp,/cache
recycle:repository = Recycle Bin
recycle:versions = True
recycle:keeptree = True
recycle:touch = True
recycle:directory_mode = 0770
recycle:exclude = *.tmp,*.temp,*.o,*.obj,~$*

Then you can enable the recycle bin for specific shares by defining the vfs objects for the share. This way you can test your settings on a test share without affecting all other shares.
Enabling it on all shares isn’t good as for example a backup share will grow unnecessarily because of deleted backups kept in the Recycle Bin.
The vfs objects “dfs_samba4 acl_xattr” are needed for the NethServer samba settings to work so one needs to append “recycle” to the other vfs objects instead of defining just “recycle”.

In this example the vfs objects are added to the share “testfolder”:

podman exec samba-dc net conf setparm testfolder "vfs objects" "dfs_samba4 acl_xattr recycle"

This way the global vfs objects are overridden by the vfs objects of the share.
It’s also possible to override the global recycle options like using a different name for the testfolder recycle bin:

podman exec samba-dc net conf setparm testfolder recycle:repository "Trash Bin"

Check samba registry:

podman exec samba-dc net conf list

Restart service to apply config:

systemctl --user restart samba-dc

I need to think about the Mac spotlight elasticsearch thing. I guess an elasticsearch app is needed to provide it in NS8 style. This may take some time…
The other Mac options should work.

3 Likes

Hi @mrmarkuz Thanks for your help, you are the best. I just tried it and it works great.

I had already tried the other Mac options, but that led to problems with the shares again.

What I tried was

net conf setparm Global “vfs objects” “fruit streams_xattr”
net conf setparm Global “fruit:metadata” stream
net conf setparm Global “fruit:model” MacSamba
net conf setparm Global “fruit:veto_appledouble” no
net conf setparm Global “fruit:nfs_aces” no
net conf setparm Global “fruit:wipe_intentionally_left_blank_rfork” yes
net conf setparm Global “fruit:delete_empty_adfiles” yes
net conf setparm Global “fruit:posix_rename” yes

and in include.conf

vfs objects = fruit streams_xattr
fruit:metadata = stream
fruit:model = MacSamba
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:posix_rename = yes

Each time, it has ruined my shares, what else am I doing wrong here? I don’t dare to try it again, not that it will ruin my shares again.

If there was an extra app for Elasticsearch in the future, that would certainly be great, maybe other Mac users would benefit from it.

Best, Erwin

2 Likes

Thanks for testing!

You could try it the same way as for recycle bin.

Add the following to include.conf:

fruit:metadata = stream
fruit:model = MacSamba
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:posix_rename = yes

Then it should be possible to enable it for a specific testshare by adding the vfs objects “fruit streams_xattr”.

podman exec samba-dc net conf setparm testfolder "vfs objects" "dfs_samba4 acl_xattr fruit streams_xattr"

If you like recycle bin and Mac options the following should work:

podman exec samba-dc net conf setparm testfolder "vfs objects" "dfs_samba4 acl_xattr fruit streams_xattr recycle"

After restarting samba-dc service the Mac options should be enabled for the testshare.

It’s because of defining just vfs objects “fruit streams_xattr” without adding “dfs_samba4 acl_xattr” which is needed for working NS8 samba settings.

Yes and maybe we could also use it with other apps for example for the Nextcloud fulltext search.

3 Likes

@mrmarkuz Thank you very much, this has now worked, great support.

Yes and maybe we could also use it with other apps for example for the Nextcloud fulltext search.

That sounds very good, then we would have several advantages at once.

Best, Erwin

1 Like