-
Notifications
You must be signed in to change notification settings - Fork 41
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
Make API Keys & Access Keys out of serverConfig or ProxyAuthConfig configurable via Env Vars #148
Comments
An idea, what about something like |
@zoran995 Thanks for the suggestion and it might be a good idea 👍 terriajs-server/lib/options.js Line 106 in d96739c
either manually or as you suggested simply using dotenv-expand .
|
dotenv-expand was just a reference how they implemented it as their function already does the job of interpolating value, not sure if it is exported from dotenv-expand but we can take that function entirely in our codebase and maintain it for our needs (with referencing the original implementation) Yeah that would be that 😀 I have implemented same thing here zoran995/geoportal-server@2dd9090 in zoran995/geoportal-server#14. Project is basically a rewrite of terriajs-server using NestJs architecture, I can try to get some time to create a PR here also |
For anyone reading this today and thinking about k8s deployment: We use an initContainer with envsubst which writes the secrets into the config file which is in a mounted volume that we then mount to the main container. This way the actual TerriaJS image doesn't need to be cluttered or modified in any way. |
Make API Keys & Access Keys out of serverConfig or ProxyAuthConfig configurable via Env Vars
It's a good practice that separate API Keys & Access Keys config from other non-credential configs and make them configurable via environment variables.
This also allows those credential configs to be stored in specialised storage designed for credentials.
e.g. on k8s cluster, it's a good practice to store credentials in k8s secrets.
this can be done with the
yargs
(or thedotenv-expand
solution @zoran995 suggested) we used at this moment:terriajs-server/lib/options.js
Line 54 in d96739c
e.g.
Acceptance Criteria
ServerConfig
andProxyAuthConfig
The text was updated successfully, but these errors were encountered: