bolcom / unFTP

A FTP(S) server with a couple of twists written in Rust. Follow and talk to us on https://t.me/unftp. Docs on https://unftp.rs
Apache License 2.0
251 stars 19 forks source link

Move rooter to own crate #156

Closed kanongil closed 9 months ago

kanongil commented 9 months ago

I'm using libunftp and have developed a custom auth integration against Auth0. It authorises the user and returns the location of the user's dir on the local FS. However, there is no simple way to change the served dir.

I see that the unFTP storage/rooter.rs already handles this, and was wondering if you could move it to it's own crate that everyone can use?

FYI, the storage/restrict.rs module could probably be useful as an independent module as well, eg. to enable readonly access for the user.

hannesdejager commented 9 months ago

Hi @kanongil , this is super πŸ¦Έβ€β™‚οΈ and indeed in my mind I planned to move these 2 out to their own crates. Let me see if I can do this over the week-end for you.

Thank you for helping further our vision as described here. You came as if you were sent!

Screenshot 2023-09-08 at 08 44 56

The Auth0 authenticator is especially one that I'd love to see out there. If you plan to move it to its own crate consider using our naming convention described in the contribution guide here.

kanongil commented 9 months ago

Cool. This is my first real rust project, so I'm not sure how far I will take it, but creating a version that can be published for others to use is definitely in my thoughts. At least I'm used to publishing / supporting node.js modules, so that part won't be all new.

hannesdejager commented 9 months ago

Hi @kanongil, see here: https://crates.io/crates/unftp-sbe-rooter

Does it work for you?

kanongil commented 9 months ago

Awesome! Yes, it works as expected – thanks for the quick turnaround πŸ‘

hannesdejager commented 9 months ago

@kanongil great to hear! The documentation is lacking still

hannesdejager commented 9 months ago

I've split out the restrict.rs module to. See here: https://crates.io/crates/unftp-sbe-restrict