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

read meta-url from variable #5226

Open
sedlund opened this issue Oct 12, 2024 · 5 comments
Open

read meta-url from variable #5226

sedlund opened this issue Oct 12, 2024 · 5 comments
Labels
kind/feature New feature or request

Comments

@sedlund
Copy link

sedlund commented Oct 12, 2024

What would you like to be added:

juicefs cli should read meta-url from an environment variable by if set.
I suggest JFS_URL

If the meta-url is specified on the command line, it should take precedence.

Why is this needed:

it makes the cli nicer to use not having to specify the url each time it is required.

@sedlund sedlund added the kind/feature New feature or request label Oct 12, 2024
@solracsf
Copy link
Contributor

solracsf commented Oct 13, 2024

Agree, but it would make more sense to be META_URL, as META_PASSWORD already exists.

@sedlund
Copy link
Author

sedlund commented Oct 13, 2024

agree, would like to see all juicefs variables prefixed as is common elsewhere -- JFS_ or JUICEFS_

@suzaku
Copy link
Contributor

suzaku commented Oct 18, 2024

So if I run juicefs mount xxx, xxx would be interpreted as the mount point while the URL is read from the environment variable?
What if I only specify the URL and miss the mount point?

@sedlund
Copy link
Author

sedlund commented Oct 18, 2024

So if I run juicefs mount xxx, xxx would be interpreted as the mount point while the URL is read from the environment variable?

Yes. If $JUICEFS_META_URL is set, it fits a validation schema and xxx is a directory.

What if I only specify the URL and miss the mount point?

Following the same steps above, the URL fits validation URL schema then it will error on no mount point specified.

@davies
Copy link
Contributor

davies commented Oct 23, 2024

It's better to keep the command arguments consistent.

The sync command read the meta-url from environment variable, which use the volume name as the name, for example,

myfs=redis://localhost/  juicefs sync jfs://myfs/prefix s3://mybucket/prefix

It support multiple volumes in the same time, maybe we can do the same thing here:

myjfs=redis://localhost/  juicefs mount myjfs /mnt

But, we use redis:// as the default schema, and the myjfs will be treated as hostname rather than a variable name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants