web storm environmental variable with newlines
i was trying to follow this tutorial https://blogs.aws.amazon.com/javascript/post/Tx75VET0CC4XML/Creating-Amazon-CloudFront-Signed-URLs-in-Node-js and am using webstorm. however, i can not get a private rsa key set as an environmental var in webstorm. webstorm truncates my variable at the first newline. is there a way to do this?
Please sign in to leave a comment.
is your PRIVATE_KEY environment variable a multiline string? How do you set it - via 'Environment variables' field in Node.js run configuration? It only accepts single-line values. You can try using
instead of process.env.PRIVATE_KEY as suggested in https://blogs.aws.amazon.com/javascript/post/Tx75VET0CC4XML/Creating-Amazon-CloudFront-Signed-URLs-in
Or, create a shell script that would export the variables first and then start Node.js with needed parameters, and specify this shell script as 'Node interpreter' in your run configuration
thanks. yes, mutliple lilnes and via run configurations
i know my aws elastic bean stalk interface supports setting environemental vars with multiple lines so it would make sense to me that webstorm would too, otherwise, i need custom code for the ide setting opposed to my real production setting. (i dont want a file with my private key sitting around on my server or s3.)
can i add this as a feature request?
Sure, please log a request for multi-line valiables support to youtrack,https://youtrack.jetbrains.com/issues/IDEA
Issue exists: https://youtrack.jetbrains.com/issue/IDEA-185315
There is a workaround for this by creating a .env file and then load that file using dotenv-cli.
Your package.json command would look something like this:
but i agree, proper multiline env support in webstorm/intellij would be very helpful