Skip to content
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

feat: Introduce remote scheme #1152

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat: Introduce remote scheme #1152

wants to merge 7 commits into from

Conversation

Xuanwo
Copy link

@Xuanwo Xuanwo commented Jun 13, 2024

This PR intends to introduce the new remote scheme concept in yazi. After this new feature introduced, users can use yazi to visit and manage files store in remote storage services like s3, gcs, webdav, dropbox and so on.

This PR just a start of this PR and not integrate with file operations yet.

@Xuanwo Xuanwo marked this pull request as ready for review June 13, 2024 13:16
@Xuanwo
Copy link
Author

Xuanwo commented Jun 13, 2024

cc @sxyazi, I'm not sure if this PR is the right size for merging. Could you first review the overall design?

@sxyazi
Copy link
Owner

sxyazi commented Jun 14, 2024

Thanks for the PR!

I think we should create a new crate yazi-fs and move yazi-shared/src/fs/ into this new crate - all integration work can be done within this new crate.

As for the scheme configuration, I don't think it's reasonable to keep it in yazi.toml because people often host their ~/.config directory on Git services, which could lead to sensitive information (like usernames and passwords) being leaked. I think the state directory (~/.local/state) would be a better location for it.

@sxyazi
Copy link
Owner

sxyazi commented Jun 14, 2024

I'm not sure if this PR is the right size for merging

Typically, I expect a complete feature to be merged. Perhaps we can create a separate branch for ongoing work, or you could just give me write access to your fork so I can participate in the development?

@Xuanwo
Copy link
Author

Xuanwo commented Jun 14, 2024

Perhaps we can create a separate branch for ongoing work, or you could just give me write access to your fork so I can participate in the development?

Yes, I have enabled Allow edits and access to secrets by maintainers. You can push to this branch directly.

I think we should create a new crate yazi-fs and move yazi-shared/src/fs/ into this new crate - all integration work can be done within this new crate.

Nice idea, I will do this.

@Xuanwo
Copy link
Author

Xuanwo commented Jun 14, 2024

As for the scheme configuration, I don't think it's reasonable to keep it in yazi.toml because people often host their ~/.config directory on Git services, which could lead to sensitive information (like usernames and passwords) being leaked. I think the state directory (~/.local/state) would be a better location for it.

DONE, please take a look.

I think we should create a new crate yazi-fs and move yazi-shared/src/fs/ into this new crate

I tried but failed. yazi-shared and yazi-fs will depend on each other.

@Xuanwo
Copy link
Author

Xuanwo commented Jun 14, 2024

I'm trying to make yazi mys3://path/to/file works but find that there are many places need to hack with:

  • boot: takes a PathBuf, we need to adapt expand_path to work with remote path well.
  • from_dir: takes Url but need to handle remote

My current progress:

image

@sxyazi
Copy link
Owner

sxyazi commented Jun 14, 2024

DONE, please take a look.

Thanks, the config for remote services should be lazily initialized on use – I'll refactor it.

I tried but failed. yazi-shared and yazi-fs will depend on each other.

Why does yazi-shared need to depend on yazi-fs?

I'm trying to make yazi mys3://path/to/file works but find that there are many places need to hack with:

Yeah currently Yazi's filesystem isn't abstracted and is full of local fs API calls. I think the first step should be to abstract the common APIs into the yazi-fs crate and implement it in a cross-scheme way, so it can be used everywhere uniformly.

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.

None yet

2 participants