I am trying to pass the contents of my pem file as a string in my
nf run nodemon app.js
CF_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n
-----END RSA PRIVATE KEY-----"
case '"': return /^"([^"]*)"/.exec(val);
TypeError: Cannot read property '1' of null
at parseValue (/Users/user/.nvm/versions/node/v4.3.2/lib/node_modules/foreman/lib/envs.js:38:46)
I don't think that it can work like that. It seems that node foreman scans the file line by line and it is trying to create key-value pairs and seems that is not aware of \n or other methods that can split the line. I don't think that you have to put it on more lines, though. Possibly you can do something like that:
CF_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAm7NA57......\n...."
and it is quite possible that will not work. Why don't you put just the filename in the env vars? Something like:
and when you boot the application:
var id_rsa_contents = fs.readFileSync(__dirname + proces.env.CF_PRIVATE_KEY_FILENAME);