Heroku 中的多行配置变量 [英] Multi-line config variables in Heroku

查看:20
本文介绍了Heroku 中的多行配置变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Rails 应用程序,它在使用 Paypal 进行交易之前加载了许多 RSA 证书.在我的开发机器上,这些证书是从文件系统中的文件中读取的,但因为 Heroku(我用于 delpoyment)主要是只读的,我无法上传这些文件,所以我猜我必须从配置变量中读取证书(参见 Heroku 配置变量).

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 the file system but because Heroku (which I'm using for delpoyment) is largely read-only, I can't upload these files so I'm guessing I'll have to read the certificates from config variables (see Heroku Config Vars).

因为证书由多行数据组成,我不确定如何将它们设置为变量,或者即使这是可能的.有谁知道我该怎么做或能够提出替代方法?

Because the certificates consist of multiple lines of data, I'm not sure how to set them as variables or even if this is possible. Does anyone know how I could do this or be able to suggest an alternative approach?

非常感谢,埃迪

推荐答案

我发现添加多行配置的一种简单方法是将它们双引号,然后从我的本地环境中回显它们

I found that a easy way to add multi-line configs is to double quote them and then echo them from my local environment

heroku config:add EC2_PRIVATE_KEY="$EC2_PRIVATE_KEY"

这篇关于Heroku 中的多行配置变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆