Multi-line config variables in Heroku

前端 未结 6 1083
别那么骄傲
别那么骄傲 2020-12-08 00:29

I\'ve have a Rails app that loads a number of RSA certificates before a transaction is made with Paypal. On my development machine, these certificates are read from files in

6条回答
  •  不知归路
    2020-12-08 00:49

    If you want to set Heroku config values from your file contents, you can use the following shell trick:

    $ heroku config:set SECRET_KEY="$(cat path/to/secret.key)"
    

    Multi-line values can be set directly by putting quotes around the value:

    $ heroku config:set SECRET_KEY='first line
    > second line'
    

    If you're using Foreman to run locally (now heroku local), it doesn't support multi-line variables. You must use something to inject them into the environment first, such as envdir:

    $ envdir my-env-dir heroku local
    

提交回复
热议问题