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

Example b2.toml issues #1068

Closed
HaleTom opened this issue Feb 18, 2024 · 4 comments · Fixed by #1072
Closed

Example b2.toml issues #1068

HaleTom opened this issue Feb 18, 2024 · 4 comments · Fixed by #1072
Labels
A-config Area: Related to the config file functionality and format A-docs Area: Improvements or additions to documentation C-bug Category: Something isn't working as expected

Comments

@HaleTom
Copy link
Contributor

HaleTom commented Feb 18, 2024

https://github.com/rustic-rs/rustic/blob/main/config/services/b2.toml

What's the difference between application_key and application_key_id?

Both are required:

error: backend openDAL Backend cannot be loaded: ConfigInvalid (permanent) at Builder::build, context: { service: b2 } => application_key_id is empty

error: backend openDAL Backend cannot be loaded: ConfigInvalid (permanent) at Builder::build, context: { service: b2 } => application_key is empty

However, application_key_id is not provided in the example.

".my_key" is given as an example value for the application_key field. Is the intent that the value of this key is a filename?

If so, what is the directory name that .my_key is relative to?

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Feb 18, 2024
@aawsome
Copy link
Member

aawsome commented Feb 18, 2024

The opendal docu https://opendal.apache.org/docs/rust/opendal/services/struct.B2.html is a bit irritating here.

I think it should be

root = "repo-path" # Set the work directory for backend
application_key_id = "my_id" # B2 application key keyID
application_key = "my_key" # B2 application key applicationKey
bucket = "bucket_name" # B2 bucket name
bucket_id = "bucket_id" # B2 bucket_id

All are just strings, no filenames. Please report once you have a working config, we'll change the b2.toml then.

@aawsome aawsome added A-docs Area: Improvements or additions to documentation A-config Area: Related to the config file functionality and format labels Feb 18, 2024
@aawsome
Copy link
Member

aawsome commented Feb 18, 2024

Actually I tested b2 myself successfully (using application_key_id), but I think I copy&pasted from the the opendal docu instead of from my working config.

@HaleTom
Copy link
Contributor Author

HaleTom commented Feb 18, 2024

The required fields are:

# These are required either here or set by config variables
# https://github.com/apache/opendal/blob/main/.env.example
#
# application_key_id = "" # B2 application key keyID
# application_key = "" # B2 application key applicationKey
# bucket_id = "" # B2 bucket_id
# bucket = "" # B2 bucket name

So, basically: s/key_id/application_key_id/.

I'd recommend that you put the above URL and comment in the config file to help people with options for security.

Also password-file vs password :)

@HaleTom
Copy link
Contributor Author

HaleTom commented Feb 19, 2024

I created a PR:
#1072

@aawsome aawsome added C-bug Category: Something isn't working as expected and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Feb 19, 2024
aawsome added a commit that referenced this issue Feb 25, 2024
closes #1068 

- s/key_id/application_key_id/
- Remove generic opendal comment
- Add comment for password file

---------

Co-authored-by: Alexander Weiss <[email protected]>
@github-project-automation github-project-automation bot moved this from Todo to Done in Documentation Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: Related to the config file functionality and format A-docs Area: Improvements or additions to documentation C-bug Category: Something isn't working as expected
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants