-
-
Notifications
You must be signed in to change notification settings - Fork 884
Add subdirectory option to virtual folders #2037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for the contribution! This change needs to be tested carefully, and I don't think I have enough time to review it thoroughly at the moment. |
|
Thanks for the quick response!
This sounds completely reasonable to me. I would say that most of the "complexity" of this change is in the breadth, rather than the depth, which should make it somewhat easier at least (glancing at the diff around half of it looks like just adding a I've also paid some attention to the test suite, and have also added a few subdir-specific tests (a few more would probably be good). That said, I think there's a bit more to the testing environment/setup than what I currently have locally, because the FreeBSD CI is showing some issues on tests that aren't run locally by
I had a look at group-level placeholders before going to all this effort, but they don't quite fit the bill: while I use I think it's valuable to have something more flexible (not just for flexibility's sake, but because it makes it possible to integrate with more services), and not tied to groups. |
f2c3eb6 to
a2d3613
Compare
|
I think this would be immensely helpful for me for a number of reasons, but namely, only having to connect to each backend once. Right now, each user gets either a Azure Blob Storage backend of one container (or a folder in the container); if I have 10 users or 10 little IoT devices accessing their own data (but not others) thats the same key being pasted into SFTPGo 10 times. However, if this change is approved and merged into the product, then I can specify one "Virtual Folder" and then assign specific paths to specific users. I can have as many user accounts as I want which all utilize the same Azure Blob Storage connection (Virtual Folder), so when I cycle the key, I only have to cycle one. This would very likely have commercial value as well for the aforementioned reason. The %username% trick doesnt work for this use case as I may have 3 "users" accessing the same data (maybe even with varying rights) so the folder they access should be the same, but if I use the %username% trick, they don't overlap folders. Subscribed to the thread. Thanks for the work on SFTPGo as well as thanks to the author of this PR. |
|
I've gone ahead and resolved the merge conflicts, and while I'm at it, added a bunch of tests (with some help from Claude). This has ~doubled the size of the PR, but it seems worth it for the confidence that this feature is working as expected. It will be interesting to see how the FreeBSD tests go now, given that executes differently to At this stage, if anybody has the time, I'd say it's good for review. |
Allow virtual folders to map to subdirectories within shared storage, enabling better user isolation and multi-tenant setups. When configuring a virtual folder, users can now specify a 'virtual_subdirectory' that automatically isolates their access within a shared storage location. For example, multiple users can share the same base folder while each accessing their own subdirectory. Signed-off-by: TEC <[email protected]>
|
(I forgot to keep the sort order when downgrading the sqlite DB) |
|
One other thing: given that the |
|
This feature would be really useful for me also. I am planning to have multiple users that can setup their own media libraries and grab content from a shared library. There isn't a clean way to do this with existing SFTPgo. Being able to specify a virtual subdirectory on mass storage would make this usecase possible. I definitely think its worth investing the time to integrate this feature. |
Hello!
Thanks for all the work on SFTPGo, it's been difficult to find a good hobbyist solution for exposing some file storage on a NAS with my family. I've read your comments on the difficulty in getting fairly compensated, and I hope the open core model goes well!
Preamble
In my own usage, I've been trying to set up new-user creation with virtual folders to access content managed by other applications (photos, document uploads, etc.), I've found the inability to specify sub-directories of a virtual folder that should be mapped to a user's tree to be quite inconvenient.
Since this is just a small extension to the filesystem code and data model, I felt like I could give implementing this a shot myself with a bit of help from
grepand LLMs to make sure I don't miss anything in a codebase I'm unfamiliar with. This seems to have gone fairly well, and I've tested the database upgrade + functionality on my NAS.Feature description
Allow virtual folders to map to subdirectories within shared storage, enabling better user isolation and multi-tenant setups.
When configuring a virtual folder, users can now specify a 'virtual_subdirectory' that automatically isolates their access within a shared storage location. For example, multiple users can share the same base folder while each accessing their own subdirectory.
New UI demo
Checklist for Pull Requests