You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "knight42 (via GitHub)" <gi...@apache.org> on 2023/03/16 15:50:30 UTC
[GitHub] [incubator-opendal] knight42 commented on issue #422: Tracking issues of RFC-0423: Command Line Interface
knight42 commented on issue #422:
URL: https://github.com/apache/incubator-opendal/issues/422#issuecomment-1472237222
@Xuanwo Hi, `oli` seems to be an awesome tool 🚀 I would like to get involved in the development!
Before I can start, I would like to introduce a config to `oli`. IMHO a single config file is easier to manage than a handful of env vars.
The config file is consist of multiple `profile`, each `profile` represents a service users want to access. Users are able to specify the endpoint, credentials and other necessary parameters in each `profile`. The config file might look like this(the format doesn't matters, I just prefer toml now):
```toml
# ~/.oli/config.toml
[[profiles]]
name = "mys3" # required
service = "s3" # required
endpoint = "" # optional
access-key = "<redacted>"
secret-key = "<redacted>"
[[profiles]]
name = "myaz" # required
service = "azblob" # required
endpoint = "" # optional
access-key = "<redacted>"
secret-key = "<redacted>"
```
When users want to interact with multiple services, like copying objects across services, they need to run
```
oli cp mys3://bucket/1.txt myaz://bucket2/1.txt
```
Please note that the profile name is used as scheme to distinguish different services here.
I think the advantages of the config file over env vars including but not limited to:
1. it is easier to manage a config file than exporting a lot of env vars in a shell rc file
2. the config file can be strongly typed(like toml), it is easier to validate the config
3. it is more straightforward to see which service has been configured with a config file
@Xuanwo WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org