This repository was archived by the owner on Jan 8, 2025. It is now read-only.
Add environment variables to context#100
Open
kx-chen wants to merge 1 commit intothanethomson:masterfrom
Open
Conversation
815455e to
afacc34
Compare
Add environment variables to context so they may be used in views. Closes thanethomson#72
afacc34 to
e0e3a99
Compare
Collaborator
|
I think it is necessary that the caller can prevent access to all environment variables, which may contain secrets. A cmdline flag turning on this feature? A cmdline flag listing the env vars which are allowed to be accessed? A prefix, so only a subset of env vars are visible inside statik? i.e. STATIK_ENV allows only STATIK_ENV_FOO to be seen. This is the 'safest' in a netlify context, as a PR might modify netlify.toml and alter command line variables. But worth keeping in mind everything is insecure in netlify deploy previews, as the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add environment variables to context so they
may be used in views.
Closes #72
Alternatively, instead of passing all env variables in, I think statik could use an environment variable (maybe
STATIK_ENV?) to determine the environment its running in, and only pass that variable to the context.