Skip to content

Conversation

@MahdiBaghbani
Copy link
Member

@MahdiBaghbani MahdiBaghbani commented Nov 18, 2025

Add optional VirtualHomeTemplate config to expose localhome paths in a virtual namespace (e.g., /home/user/) while storing files in the existing flat layout. When empty, preserves original behavior for EOS and other deployments.

Fixes PathToSpaceID() encoding issues where localhome returned paths like /file.txt instead of /home/user/file.txt, causing each file to be treated as its own space.

Add optional VirtualHomeTemplate config to expose localhome paths in a
virtual namespace (e.g., /home/<user>/) while storing files in the
existing flat layout. When empty, preserves original behavior for EOS
and other deployments.

Fixes PathToSpaceID() encoding issues where localhome returned paths
like '/file.txt' instead of '/home/<user>/file.txt', causing each file
to be treated as its own space.
fix(localfs): handle gateway-stripped paths in virtual namespace
Also handle the webdav storage accessing pattern
moved the logic from unwrap() to normalize, to handle
different requirements for Path and OpaqueId construction
@MahdiBaghbani MahdiBaghbani force-pushed the feature/multi-reva-setup-with-localhome branch from e5b1215 to 3465648 Compare November 19, 2025 15:00
@MahdiBaghbani MahdiBaghbani force-pushed the feature/multi-reva-setup-with-localhome branch from 6ad0c55 to 6582ad2 Compare November 19, 2025 15:30
@glpatcern
Copy link
Member

This looks good and makes the localfs "demo" storage more usable. @MahdiBaghbani if this is ready for review please mark it as such!

@MahdiBaghbani
Copy link
Member Author

This is unfortunately not ready yet.

I'm kind of struggling on the UI right now :-), but I'll definitely do some extra test and clean the debugs for the review.

@MahdiBaghbani MahdiBaghbani self-assigned this Nov 30, 2025
@MahdiBaghbani
Copy link
Member Author

I've decided to keep a selection of debugs in the code, but overall, I've cleaned the feature branch for review

@MahdiBaghbani MahdiBaghbani marked this pull request as ready for review December 1, 2025 09:14
@MahdiBaghbani
Copy link
Member Author

I've also cherrypicked the two fixes into this since I need all of them to rebuild my docker image

@MahdiBaghbani
Copy link
Member Author

I feel like a bit of context here is necessary as well

this is the config I use with this driver on my docker image:
https://github.com/MahdiBaghbani/containers/blob/8499da7feb089f46fbc9443e313ab477ecebe1dd/services/revad-base/configs/dataprovider-localhome.toml#L1-L46

And also I have to "manually" create some directories beforehand:
https://github.com/MahdiBaghbani/containers/blob/8499da7feb089f46fbc9443e313ab477ecebe1dd/services/cernbox-revad/Dockerfile.development#L135-L150

@glpatcern the manual part about the .shadow directories makes me wonder that if this supposed to be done by Reva? is it still incomplete and needs more work in separate PRs?

@glpatcern
Copy link
Member

@MahdiBaghbani the .shadow directories are gone from the core Reva code base and anything you found is left overs that can be dropped.

Otherwise, for the configurations I invite you to push them to https://github.com/cs3org/reva-configs

@MahdiBaghbani
Copy link
Member Author

LocalFS needs to have shadow, it cannot operate without it at all.

The related PRs are #4977 and #4984

My understanding is that create_home_hook is beneficial for the localfs as well, but since EOS driver no longer owns a separate, Reva managed metadata namespace while localfs would need it, the script should also create .shadow directories for users as well (on first login)

This helps to avoid manually creating directories on dockerfiles and be locked into a static set of users.

The code in this PR works with the dockerfile and configs I currently have so it is a good baseline and working example, I'll make a follow up PR for more refactors and aligning LocalFS with EOS implementation in Reva

@glpatcern
Copy link
Member

LocalFS needs to have shadow, it cannot operate without it at all.

All right Mahdi, true that we ripped off the .shadow folders from EOS, but LocalFS is special on its own. And yes, we can use the create_home_hook to create the shadow tree when implemented for LocalFS, so that this remains a storage-driver-specific implementation detail.

@MahdiBaghbani
Copy link
Member Author

I just realized (during testing) that the user can create files and folder, cannot rename or delete

Doesn't affect the sharing tests, but better to be fixed later

@glpatcern
Copy link
Member

I just realized (during testing) that the user can create files and folder, cannot rename or delete

Shouldn't this be fixed in this PR, so we can merge it without regressions?

@MahdiBaghbani
Copy link
Member Author

I wanted this for the STA milestone completion, it is just to fix the sharing as described in M4.
Also, I think this patch this did not introduce the regression, it only revealed them, since before this patch the UI paths couldn't be translated to the actual path on disk and operations couldn't be completed anyway.

Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right then, there are just a few things I'd remove, all changes on the localfs driver look OK

@MahdiBaghbani MahdiBaghbani force-pushed the feature/multi-reva-setup-with-localhome branch from 9fa234f to 046d615 Compare December 18, 2025 08:04
@glpatcern glpatcern self-requested a review December 18, 2025 09:08
@glpatcern glpatcern merged commit 9f654f8 into cs3org:master Dec 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants