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

CLI: Allow setting secrets path via env var #2426

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

pinpox
Copy link
Contributor

@pinpox pinpox commented Jul 11, 2024

Description

Adds a new enviroment variable ENTE_CLI_SECRETS_PATH, that allows specifying the path to a secrets.txt like the one used in the dockerized version. If no path is provided, the old behaviour is maintained.

The configuration variable and behaviour is analog to the already present ENTE_CONFIG_PATH variable, which allows specifying a configuration.

This provides a solution for people running without gnome-keyring (#722 and #1328)

Adds a new enviroment variable `ENTE_CLI_SECRETS_PATH`, that allows
specifying the path to a `secrets.txt` like the one used in the
dockerized version. If no path is provided, the old behaviour is maintained.
@CLAassistant
Copy link

CLAassistant commented Jul 11, 2024

CLA assistant check
All committers have signed the CLA.

Comment on lines +33 to +35
if secretsFile := os.Getenv("ENTE_CLI_SECRETS_PATH"); secretsFile != "" {
return GetSecretFromSecretText(secretsFile)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change.
Should we put this change inside the else block.
is isRunningContainser() {
} else {
if secretsFile := os.Getenv("ENTE_CLI_SECRETS_PATH"); secretsFile != "" {
return GetSecretFromSecretText(secretsFile)
}
log.Fatal(fmt.Errorf("error getting password from keyring: %w", err))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then it only works if it is running inside a container. I want to use this env var outside of a container aswell.

@pinpox pinpox requested a review from ua741 July 18, 2024 09:32
@ua741 ua741 merged commit 7c7299a into ente-io:main Jul 24, 2024
1 check passed
@pinpox pinpox deleted the cli-secrets-env branch August 20, 2024 05:51
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.

3 participants