proper env modifiers support #391

Merged
decentral1se merged 1 commits from p4u1/abra:env-modifiers into main 2023-12-01 11:03:53 +00:00
Member

This implements proper modifier support in the env file using this new fork of the godotenv library. The modifier implementation is quite basic for but can be improved later if needed. See this commit for the actual implementation.

Because we are now using proper modifer parsing, it does not affect the parsing of value, so this is possible again:

MY_VAR="#foo"

Closes coop-cloud/organising#535

This implements proper modifier support in the env file using [this new fork](https://git.coopcloud.tech/coop-cloud/godotenv/) of the `godotenv` library. The modifier implementation is quite basic for but can be improved later if needed. See [this commit](https://git.coopcloud.tech/coop-cloud/godotenv/commit/e396573785a74f9955aa6c1c4df2b6410deaaa22) for the actual implementation. Because we are now using proper modifer parsing, it does not affect the parsing of value, so this is possible again: ``` MY_VAR="#foo" ``` Closes https://git.coopcloud.tech/coop-cloud/organising/issues/535
p4u1 added 3 commits 2023-11-29 19:04:44 +00:00
p4u1 changed title from WIP: env modifiers to env modifiers 2023-11-29 19:08:26 +00:00
p4u1 reviewed 2023-11-29 19:09:37 +00:00
p4u1 changed title from env modifiers to WIP: env modifiers 2023-11-29 19:09:49 +00:00
p4u1 added 1 commit 2023-11-29 20:34:42 +00:00
continuous-integration/drone/pr Build is failing Details
899909b2ed
a little less hacky
p4u1 force-pushed env-modifiers from 899909b2ed to d09aedb5fe 2023-11-29 20:41:42 +00:00 Compare
Author
Member

As noted in chat, maybe it's better to not inline the library, but instead fork the library into the coopcloud organization and add my patch there. Then it would be easier to apply upstream patches.

Edit: I created the fork instead of copying the files here

As noted in chat, maybe it's better to not inline the library, but instead fork the library into the coopcloud organization and add my patch there. Then it would be easier to apply upstream patches. Edit: I created the fork instead of copying the files here
p4u1 force-pushed env-modifiers from d09aedb5fe to 574e0b257b 2023-11-30 10:08:10 +00:00 Compare
p4u1 added 2 commits 2023-12-01 08:46:01 +00:00
continuous-integration/drone/pr Build is passing Details
1879cccef4
cleanup
p4u1 added 1 commit 2023-12-01 08:58:27 +00:00
continuous-integration/drone/pr Build is passing Details
6c3863668e
more cleanup
p4u1 changed title from WIP: env modifiers to proper env modifiers support 2023-12-01 09:05:25 +00:00
p4u1 reviewed 2023-12-01 09:09:41 +00:00
@ -83,1 +79,3 @@
return secretConfigs, err
return nil, err
}
configWithoutEnv, err := loader.LoadComposefile(opts, map[string]string{}, loader.SkipInterpolation)
Author
Member

@decentral1se This is how I get the raw compose file. The secret Name will then be like this:

${STACK_NAME}_test_pass_two_${SECRET_TEST_PASS_TWO_VERSION}

I need this, to properly map the secretId to the secret version env var where the modifer is defined.

This might help you with coop-cloud/organising#464

@decentral1se This is how I get the raw compose file. The secret `Name` will then be like this: ``` ${STACK_NAME}_test_pass_two_${SECRET_TEST_PASS_TWO_VERSION} ``` I need this, to properly map the secretId to the secret version env var where the modifer is defined. This might help you with https://git.coopcloud.tech/coop-cloud/organising/issues/464
p4u1 force-pushed env-modifiers from 6c3863668e to ea0c052c1e 2023-12-01 09:15:50 +00:00 Compare
decentral1se approved these changes 2023-12-01 11:03:46 +00:00
decentral1se left a comment
Owner

Looking great @p4u1, i'm merging this 💯

Looking great @p4u1, i'm merging this 💯
decentral1se merged commit 3957b7c965 into main 2023-12-01 11:03:53 +00:00
decentral1se referenced this issue from a commit 2023-12-02 12:01:39 +00:00
Sign in to join this conversation.
No description provided.