I have many services written in Node and loading secrets on startup has always been a problem for me.
I believe that when a service starts up, it should have every piece of configuration/secret ready for it beforehand.
.env file).Luckily, I've found that in Node, whatever script we add to the package.json file can have pre and/or post scripts as well.
So it comes in very handy, as I can:
The difficulty is that I'm unable to persist environment variables and have them available on the next process.
I wonder if that's a limitation (in Linux) or there's some way that I have missed.
Writing the secrets to a file to be read by the main process is unacceptable.