Heroku, Netlify and many other PaaS are stateless so files don't stick around permanently. And because ejson look up private key from EJSON_KEYDIR file, this can pose a bit of challenge to adopt ejson.
What we know that these platforms uses environment variables as the 1st class citizen, so why don't we look up from environment variable for private key instead?
Here is one example:
Private Key: 123
Public Key: abcdef
The ejson app would try to look for environment variable abcdef before falling back to reading $EJSON_KEYDIR/abcdef file. Alternatively, we could let user define which environment variable to lookup:
Heroku, Netlify and many other PaaS are stateless so files don't stick around permanently. And because ejson look up private key from
EJSON_KEYDIR
file, this can pose a bit of challenge to adopt ejson.What we know that these platforms uses environment variables as the 1st class citizen, so why don't we look up from environment variable for private key instead?
Here is one example:
Private Key: 123 Public Key: abcdef
The ejson app would try to look for environment variable
abcdef
before falling back to reading$EJSON_KEYDIR/abcdef
file. Alternatively, we could let user define which environment variable to lookup: