Deluge - cannot delete files from Download folder (jail)

uji

Cadet
Joined
Oct 14, 2023
Messages
4
Hello friends,

I have Deluge installed as a jail/application through the standard plugin installation.

I have two seperate SMB shares:
Downloads: /mnt/STZRAID/iocage/jails/Deluge/root/Download (For the deluge plugin/jail)
&
TrueNAS: /mnt/STZRAID/Storage (My regular NAS data share)

Once Deluge has finished downloading something to it's Download folder, I try to delete the files but it says permission denied. I tried to edit the ACL sharing options for the Deluge download folder share, but unfortunately it doesn't seem to allow me to change anything. The moment I try to save my changes it just says that the folder doesn't exist.

Here are some steps: I go to edit > Change filesystem ACL
System gives me this:

Screenshot from 2023-10-14 18-10-49.png

So I assume this means there isn't an ACL at all. I select anything at all, open/restricted, anything. Then I want to change the user permission:

Screenshot from 2023-10-14 18-12-16.png

I try changing from 'media' for both user and group, to my username. Then check 'change recursively'. But then I get this error:

Screenshot from 2023-10-14 18-13-30.png

If I try changing settings with the permission manager, it just says the folder does not exist.

I am fairly new to TrueNAS and my experience is rather limited. Here is a photo of my drive pools:

Screenshot from 2023-10-14 18-15-33.png

And here is a photo of my SMB shares:

Screenshot from 2023-10-14 18-16-15.png

So just to clarify, I'd like the ability to be able to delete files from my 'Downloads' share. If anyone can help I'd be very appreciative, thank you.
 
Joined
Oct 22, 2019
Messages
3,641
Don't download torrents and files directly into the jail's private filesystem. Create a "mountpoint" that points to your desired location, such as /mnt/STZRAID/Storage/Downloads

You can have a path, within the jail, let's say /mnt/downloads which points to /mnt/STZRAID/Storage/Downloads.

Configure Deluge to download to /mnt/downloads, and thus nothing will be download in the jail itself, since any references to /mnt/downloads (inside the jail/Deluge), will actually go to your host's location under /mnt/STZRAID/Storage/Downloads.

Don't make it complicated by trying to use TrueNAS to change the ACLs of the jail's paths (from outside of the jail). Don't further complicate things by creating SMB shares to navigate inside the jail. (That's the reason we use "mountpoints".)

EDIT: Do realize that after you create a mountpoint, you will not be able to access torrents that were already downloaded in the jail, since the mount will "overlay" that path. So make sure you copied everything to your desired location. Then you can use the command-line to delete the files inside the jail.
 
Last edited:

uji

Cadet
Joined
Oct 14, 2023
Messages
4
@winnielinnie I have created the mountpoint and it does seem to be directing perfectly. The Downloads folder in my Deluge jail now points to my STZRAID Downloads.

But there is a permissions issue, Deluge cannot write to my STZRAID Downloads. I tried to see if I could add 'Deluge' to my ACL for STZRAID, but no user is listed. I logged into the shell for the Deluge jail and did the following:
- id deluge
uid=8675309(deluge) gid=8675309(deluge) groups=8675309(deluge)

Would you kindly guide me a little further in how to add this user and/or permissions properly? Thank you again
 
Joined
Oct 22, 2019
Messages
3,641
but no user is listed
You need to create one in TrueNAS. (Accounts -> Users)

The UID/GID needs to match as the one used in the jail. I don't use Deluge, but my assumption is that the deluge daemon runs under the "deluge" user.

This means you need to find the UID/GID number for the user/group "deluge" in your jail. Then use this to create a new user/group in TrueNAS with the same UID/GID. (The username and group can also be "deluge" in the TrueNAS Users creation; just as long as you use the same UID/GID as in the jail.)

(In your case, that would be "8675309")

But that seems like a strangely high UID number. (Maybe Deluge is weird like that.)

Then just assign an entry for the new "deluge" user, to give it access to the downloads path.
 
Last edited:

uji

Cadet
Joined
Oct 14, 2023
Messages
4
Thanks @winnielinnie I learned some new stuff. Apparently on the TrueNAS side of things, UID/GID '8675309' is already given to a universal user called 'media' which did exist (sp I didn't need to add a deluge user) I think this is so that people can just add that generic UID/media to their permissions to support multiple applications a user might install that need access to their pool.

Anyhow I followed the following process:

I went to pools, right clicked on my main pool, selected 'edit permissions'

Screenshot from 2023-10-15 09-32-38.png

I then added the media user and groups to acl as shown:
Screenshot from 2023-10-15 09-34-18.png

I then checked 'change recursively'

Screenshot from 2023-10-15 09-34-56.png

And now Deluge can download to the main pool & I can delete / move files. The only concern I had while doing this was security related. I realised that I was giving the media user/group and any app that used that ID the ability to have full control over my entire drive, rather than just the Downloads folder. I didn't see another way to do it though. I'm not too concerned though since this is just my home server and it isn't on 24/7 either.

Thanks
 
Top