-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
core/plugins: add per-plugin env vars #11526
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
f2df8f1
to
4741b2f
Compare
15a99a4
to
72459a5
Compare
72459a5
to
7278204
Compare
7278204
to
3b03976
Compare
|
||
// ParseEnvFile returns a slice of key/value pairs parsed from the file at filepath. | ||
// As a special case, empty filepath returns nil without error. | ||
func ParseEnvFile(filepath string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking through if this should live in chainlink-common
, but it's probably best here.
Ah, foiled by sonar. Will need to update. |
ff13151
30eb5f7
to
811d81e
Compare
811d81e
to
1aa66a1
Compare
1aa66a1
to
74f840e
Compare
defer func() { | ||
_ = f.Close() | ||
}() | ||
m, err := envparse.Parse(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any security considerations we are overlooking with this strategy? we have gone from a limited, specific set of env var to an unlimited set.
it seems like you might be able to use this as a hook into parts of the system that shouldn't be hooked into (like the db?) maybe nbd since whoever is running the software has full control over the env anyway.
in any case, it seems like we need a readme and some guidance about how to use the env file, or something in the changlelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the changelog. Does it need to say more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have gone from a limited, specific set of env var to an unlimited set.
The env was already controlled by the node op since the host env is inherited. This just gives them fine gained control, per-plugin.
it seems like you might be able to use this as a hook into parts of the system that shouldn't be hooked into (like the db?) maybe nbd since whoever is running the software has full control over the env anyway.
I don't fully grok the DB hook, but yeah that would already be possible before this change.
SonarQube Quality Gate |
https://smartcontract-it.atlassian.net/browse/BCF-2382