You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.
This is already kind of possible by using kernel command line arguments (--append and __SYSCALL.getCommandLine()), but it's neither officially supported nor elegant.
Why?
Well, servers need a way to use hidden variables, especially with open source server code
Also, it allows to quickly change a value when starting up a VM, instead of digging in to the code
How to pass them in?
Maybe another argument for runtime-cli
...or maybe this could be another use for runtime.json
Problems with each implementation:
As an argument: there's no way to make it persistent (unless you script the running)
As a property in runtime.json: if you .gitignore it so that you don't accidentally leak the variables, you're also gitignoring a file that might contain settings you do want to commit (e.g. v8.flags)
Possible solution:
Implement both? That way, you can make unimportant variables persistent by adding them to runtime.json, while keeping ultimately secret variables as arguments.
How to get them?
Well, process.env!
The text was updated successfully, but these errors were encountered:
I think passing env variables through command line is the best option. So the same initrd bundle can be used in different environments (development/production etc). runtime.js should probably not expose raw command line to the app, and we can remove --append option as well.
This was brought to my attention by @aafrey on Gitter.
This is already kind of possible by using kernel command line arguments (
--append
and__SYSCALL.getCommandLine()
), but it's neither officially supported nor elegant.Why?
How to pass them in?
runtime-cli
runtime.json
Problems with each implementation:
runtime.json
: if you.gitignore
it so that you don't accidentally leak the variables, you're also gitignoring a file that might contain settings you do want to commit (e.g. v8.flags)Possible solution:
Implement both? That way, you can make unimportant variables persistent by adding them to
runtime.json
, while keeping ultimately secret variables as arguments.How to get them?
Well,
process.env
!The text was updated successfully, but these errors were encountered: