Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to have multiline environment variables ? #9

Closed
aahnik opened this issue Jun 12, 2021 · 5 comments
Closed

How to have multiline environment variables ? #9

aahnik opened this issue Jun 12, 2021 · 5 comments

Comments

@aahnik
Copy link

aahnik commented Jun 12, 2021

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 ?

@aahnik aahnik changed the title How to have multiline environment variables ) How to have multiline environment variables ? Jun 12, 2021
@kamaln7
Copy link
Contributor

kamaln7 commented Jun 12, 2021

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.

@kamaln7 kamaln7 closed this as completed Jun 12, 2021
@aahnik
Copy link
Author

aahnik commented Jun 13, 2021

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.

image

@kamaln7
Copy link
Contributor

kamaln7 commented Jun 25, 2021

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).

@aahnik
Copy link
Author

aahnik commented Jun 26, 2021

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.

@aahnik aahnik closed this as completed Jun 26, 2021
@kamaln7
Copy link
Contributor

kamaln7 commented Jun 26, 2021

Thanks for the update @aahnik! I'm glad to hear everything is working fine now. I'll pass that feedback along 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants