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

[Fix] Using the correct env prefix for env settings #2617

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

AnomalRoil
Copy link
Member

Currently our config options can be set using the GOPASS_CONFIG__CONFIG_COUNT option followed by GOPASS_CONFIG__CONFIG_KEY_0 and same for values, but this seems to be a bug.

It should be GOPASS_CONFIG_CONFIG_KEY_0 without 2 underscores according to our documentation.

This PR fixes it.

@AnomalRoil AnomalRoil added the bug Defects label Jul 11, 2023
@AnomalRoil
Copy link
Member Author

We might consider to rename GOPASS_CONFIG_CONFIG_KEY_0 into GOPASS_CONFIG_OVERRIDE_KEY_0 and same for the rest too. WDYT?

@dominikschulz
Copy link
Member

This change looks good. Thanks for taking care.

Let me think about the proposed rename for a bit.

@dominikschulz
Copy link
Member

The rename should be fine, but we can do that in another PR.

@dominikschulz dominikschulz merged commit 5b7e558 into master Jul 30, 2023
8 checks passed
@dominikschulz dominikschulz deleted the fix/envconfig branch July 30, 2023 09:17
AnomalRoil added a commit that referenced this pull request Nov 2, 2023
…o GOPASS_CONFIG_KEY_i

As discussed in #2617, this actually reflects the way GIT_CONFIG works
AnomalRoil added a commit that referenced this pull request Nov 2, 2023
…o GOPASS_CONFIG_KEY_i

As discussed in #2617, this actually reflects the way GIT_CONFIG works

Signed-off-by: Yolan Romailler <[email protected]>
AnomalRoil added a commit that referenced this pull request Nov 2, 2023
…o GOPASS_CONFIG_KEY_i

As discussed in #2617, this actually reflects the way GIT_CONFIG works.

It also fixes a potential Panic in our codebase when IsSet was called
without any Preset config on a non-existing key.

Signed-off-by: Yolan Romailler <[email protected]>
dominikschulz pushed a commit that referenced this pull request Nov 3, 2023
* [CLEANUP] Moving options to the correct config section

This adds an easy migration path to our config handling, which should
allow us to migrate option names around much more easily in the future.

Any system level config or env variables options are not migrated.

This also fixes a bug in our test code, where the root mount path was
not properly set in our config, because we used "path:" instead of
"path=" to set it.

Signed-off-by: Yolan Romailler <[email protected]>

* [DOCUMENTATION] Document legacy options and their migration path

This also makes sure that legacy options aren't used in the code anymore using the docs test and its regexp

Signed-off-by: Yolan Romailler <[email protected]>

* [n/a] Removing weird spaces from changelog

Signed-off-by: Yolan Romailler <[email protected]>

* [DOCUMENTATION] Reformatting our Markdown tables properly

Signed-off-by: Yolan Romailler <[email protected]>

* [TESTING] Patching a timezone bug in tests

This is a fun one where if your Timezone isn't UTC and you are past midnight but it's not past midnight UTC, the tests would fail because you're not using the right date to validate it.

Signed-off-by: Yolan Romailler <[email protected]>

* [n/a] Fix a typo and use the correct Env variables in the doc about the custom Env variables

Signed-off-by: Yolan Romailler <[email protected]>

* [BREAKING] Custom Env options moved from GOPASS_CONFIG_CONFIG_KEY_i to GOPASS_CONFIG_KEY_i

As discussed in #2617, this actually reflects the way GIT_CONFIG works.

It also fixes a potential Panic in our codebase when IsSet was called
without any Preset config on a non-existing key.

Signed-off-by: Yolan Romailler <[email protected]>

* [CLEANUP] Patching all of the new linter complaints

Signed-off-by: Yolan Romailler <[email protected]>

* [CLEANUP] Use Go1.21 everywhere

Signed-off-by: Yolan Romailler <[email protected]>

* [n/a] Increase our Golangci timeout

Signed-off-by: Yolan Romailler <[email protected]>

* [n/a] code review comment and extra regression test

Signed-off-by: Yolan Romailler <[email protected]>

---------

Signed-off-by: Yolan Romailler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants