profile
viewpoint

Ask questionsStoring complex secrets

Solution: https://github.com/zeit/now/issues/749#issuecomment-533873759

Hello, I can't figure out how to store my Google API private key for use in a now deployment. The key looks something like:

-----BEGIN PRIVATE KEY-----
lines
lines
lines
-----END PRIVATE KEY-----

What I've tried:

  • now secret add google-private-key "<full key>"
    • Not possible because of dashes, https://github.com/zeit/now-cli/issues/80
  • now secret add google-private-key -b $(echo "<full key>" | base64)
    • Only gives me "[object Object]" in js, see https://github.com/zeit/now-cli/issues/80
  • Adding the key to a .env-file and then run with now --dotenv=.env
    • This seems to replace all newlines with whitespace making the auth with the key fail.
    • When running locally using the dotenv node package to set env vars from .env it works, it preserves newlines

How should it be done?

zeit/now

Answer questions ScreamZ

See also https://github.com/kuzzleio/kuzzle-vault

useful!

Related questions

Custom lambda memory size hot 1
Unable to use "alias" field in now.json the first time we deploy hot 1
Now dev Error: Unknown file type: undefined hot 1
Download secrets from now hot 1
Now dev Error: Unknown file type: undefined hot 1
Now dev Error: Unknown file type: undefined hot 1
`now dev` not ignoring built files, sometimes rebuilding hot 1
Now dev Error: Unknown file type: undefined hot 1
Question: Are there any plans to support HTTP2 server push? hot 1
`libjpeg` and `libpng` are not installed with `@now/node` hot 1
Can I access node_modules after the Zeit npm build process ends ? hot 1
NextJS with golang functions hot 1
Now dev doesn't install all packages I specified in package.json hot 1
Now + Next.js: "Please install typescript" error with --prod deployment hot 1
Ruby serverless API are not working anymore hot 1
Github User Rank List