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

Set OpenDAL secrects via environment variables #1073

Closed
HaleTom opened this issue Feb 19, 2024 · 2 comments · Fixed by #1081
Closed

Set OpenDAL secrects via environment variables #1073

HaleTom opened this issue Feb 19, 2024 · 2 comments · Fixed by #1081
Labels
A-backends Area: Related to backends in `rustic-core` A-config Area: Related to the config file functionality and format C-enhancement Category: New feature or request

Comments

@HaleTom
Copy link
Contributor

HaleTom commented Feb 19, 2024

There are several B2 variables listed in this OpenDAL .env example:

OPENDAL_B2_ROOT=/path/to/dir
OPENDAL_B2_BUCKET=<bucket>
OPENDAL_B2_BUCKET_ID=<bucket_id>
OPENDAL_B2_APPLICATION_KEY_ID=<key_id>
OPENDAL_B2_APPLICATION_KEY=<application_key>

OpenDAL asserts that they are working correctly.

But with these set, I get:

08:23:27 [DEBUG] (1) opendal::services::b2::backend: backend build started: B2Builder { config: B2Config { root: Some("/"), application_key_id: None, bucket_id: "", bucket: "", .. }, .. }

Do these need to be accessed and/or passed on to OpenDAL?


Prior art:

opendal: Do OPENDAL_B2_* environment variables work? #4199
apache/opendal#4199

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

Xuanwo commented Feb 19, 2024

Hi, the OPENDAL_ prefix is used internally within the opendal project and isn't part of its public API. This means applications like rustic cannot initialize storage using this method unless they decided to implement the same env loading logic.

@HaleTom HaleTom changed the title OPENDAL_B2_* variables don't work Set OpenDAL secrects via environment variables Feb 19, 2024
@aawsome aawsome added C-enhancement Category: New feature or request A-backends Area: Related to backends in `rustic-core` A-config Area: Related to the config file functionality and format and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Feb 19, 2024
@HaleTom
Copy link
Contributor Author

HaleTom commented Feb 21, 2024

To not force secrets being stored in config files, it would be great to support reading secrets from environment variables, (like is available in restic).

aawsome added a commit that referenced this issue Feb 28, 2024
Reads the env variables `RUSTIC_REPO_OPT_*`, `RUSTIC_REPO_OPTCOLD_*`,
`RUSTIC_REPO_OPTHOT_*` to set repository options. Also reads `OPENDAL_*`
variables which may be used to explicitly set opendal options (as they
are in snake and not kebab case).

closes #1073
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backends Area: Related to backends in `rustic-core` A-config Area: Related to the config file functionality and format C-enhancement Category: New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants