deis / deis/workflow-cli

.env file, and configuration variables with newlines

Open
#228 2 comments 0 reactions 1 assignee Claimed by @ultimateboy View on GitHub
bug in progress
Dominant language
Go
Stars
31
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Moving this on behalf of @JeanMertz from https://github.com/deis/controller/issues/891

---

I've seen this issue being tested in #268, except that that involves deis config:set, not deis config:push.

I have a .env file, that I want to contain a public key:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMF802GSVwt2ZsFlmYR6Yy4rzZR8A
o5XaElze2V5JBjeT4fUnGrK0mjvYK/CTaCVHTwq8QsC1osfN7OifH4R+fQ==
-----END PUBLIC KEY-----
The question is: how to I get this into a .env file, and have it loaded properly as an environment variable? My attempts so far have failed.

I tried:

PUBLIC_KEY="-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMF802GSVwt2ZsFlmYR6Yy4rzZR8A
o5XaElze2V5JBjeT4fUnGrK0mjvYK/CTaCVHTwq8QsC1osfN7OifH4R+fQ==
-----END PUBLIC KEY-----"
PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMF802GSVwt2ZsFlmYR6Yy4rzZR8A\no5XaElze2V5JBjeT4fUnGrK0mjvYK/CTaCVHTwq8QsC1osfN7OifH4R+fQ==\n-----END PUBLIC KEY-----"
and the same as above, but with single quotes.

None of these seem to do the trick.

I ended up base64 encoding the key, and decoding it on runtime, but that just seems like a workaround, not a proper solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.