Closed aahnik closed 3 years ago
Hi @aahnik 👋🏼
Multi line env var values are supported but you will have to paste them in with the newlines. So you can prepare the value in a text editor and then copy it over to the UI.
I'll also bring this up internally so we can look into updating the text fields to support entering newlines. I'll close this ticket for now but please feel free to re-open if this still doesn't work for you.
Hi @kamaln7
So you can prepare the value in a text editor and then copy it over to the UI.
I did that earlier. I was not confident, so tried again after you said. But does not work.
I have tested my application locally, as well as in Heroku(supports multi-lines in config vars). Works fine.
When running locally, I use a .env
file. My program uses python-dotenv
module, and that supports multi-line env vars. When running locally the export
command also works. I can export env vars having a multi-line value.
Note: But I don't know how to pass multi-line env vars to docker run. the
--env-file
option takes a.env
file, but docker does not support multi-line env vars. I use a workaround of mounting my.env
file.
The env var had multiple lines (I copied from the text editor to DO UI), but DO treats it as a single line. My program expects multiple lines and raises errors.
Hi @aahnik, sorry for the delay. We deployed a fix earlier this week and you are now able to enter multiline strings using the browser. Please let me know if it's working for you now.
Also, feel free to take advantage of the Q&A platform in the future. We closely monitor incoming questions and make sure to answer them all: https://www.digitalocean.com/community/questions/new?tags=Digitalocean%20App%20Platform (make sure to add the DigitalOcean App Platform tag).
Thanks a lot @kamaln7 ! I now deployed my application https://github.com/aahnik/tgcf, which had a multi line env var TGCF_CONFIG
Everything worked perfectly fine.
But one last request. The text box is not expandable. People still need to prepare the value in a text editor, and paste it. This is not an issue for me, as my VS Code stays open all the time. But for many of normal users (non devs, who want to just deploy), who are planning to write the env var on the browser, it would be great, if the text box is expandible.
Thanks for the update @aahnik! I'm glad to hear everything is working fine now. I'll pass that feedback along 👍🏼
In the digital ocean app platform deployment flow,
There is a step of editing environment variables.
We can set the key value pairs there.
But the value of some environment variables contain multiple lines. But digital ocean does not support that
How can I put such env vars ?