How to store RSA key in env var?

I’m having trouble storing an RSA key in an environment variable.

I have a local .env file that contains:

export MYSECRET="hello\nworld"

With docker-compose, I spin up my image and when I run env I see:

$ env
MYSECRET=hello
world

With render, when I set MYSECRET="hello\world" in the dashboard then on my VM I get:

$ env
MYSECRET=hello\nworld

I’m trying to store an RSA key in an environment variable on render but I can’t get it to work properly. The exact same docker image is working locally with docker compose and passing the exact environment variable value.

Is there a way to pass an RSA key as an environment variable in the dashboard? Or is there a way to use files as secrets?

I’ve just seen the “secrets file” section in the dashboard. I’ll try uploading my own ENV file

1 Like

Is it possible to declare a secrets file in a yaml so that the user is prompted for the file when they first deploy? Similar to sync: false

Hi @Oliver_Laslett,

This is not currently supported, the only way to add a secrets file is through the dashboard. Feel free to submit a feature request to feedback.render.com and upvote it so you can be notified of the progress.