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

feat: add ENV_FILE var #5399

Merged
merged 1 commit into from
Jun 7, 2023
Merged

feat: add ENV_FILE var #5399

merged 1 commit into from
Jun 7, 2023

Conversation

abeizn
Copy link
Contributor

@abeizn abeizn commented Jun 7, 2023

Summary

feat: add ENV_FILE var

Does this close any open issues?

Closes #5235

Screenshots

Include any relevant screenshots here.

Other Information

Any other information that is important to this PR.

Copy link
Contributor

@mindlesscloud mindlesscloud left a comment

Choose a reason for hiding this comment

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

LGTM

@mindlesscloud mindlesscloud merged commit ee50c27 into apache:main Jun 7, 2023
if envFile := os.Getenv("ENV_FILE"); envFile != "" {
v.SetConfigFile(envFile)
} else {
v.SetConfigFile("./.env")
Copy link
Contributor

@keon94 keon94 Jun 7, 2023

Choose a reason for hiding this comment

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

@abeizn Is there a reason to just default to the current dir? I'd have kept the list of parent paths as before:
i.e.

v.AddConfigPath("./../../.env")
v.AddConfigPath("./../.env")
//etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keon94 You are right, according to klesh’s opinion, delete all other paths and only keep the current path, but it seems that it cannot be used so easily

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated by #5410

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.

[Feature][installation] Make .env file readonly to fix the encKey ENCODE_KEY complication once and for all
3 participants