【问题标题】:Deploying Deployd to Heroku Dashboard Key部署 部署到 Heroku Dashboard Key
【发布时间】:2016-06-04 01:54:50
【问题描述】:

我有一个 Deployd 应用程序,我正在尝试部署到 Heroku。我已经成功地部署了应用程序,并且能够通过它的 url 访问它。我现在正在尝试访问仪表板。为了访问dashboard,它需要我有从服务器生成的密钥。我知道有两种方法可以做到这一点。

here 描述的第一种方法在本地生成密钥并将其推送到 heroku。我觉得这种方法在密钥发布到 VCS 的意义上是不安全的。

第二个method 是使用Procfile 并列出dpd keygendpd showkey。但是由于某种原因,这种方法对我不起作用。我看到命令在 heroku 日志中执行,但它没有打印出密钥,我无法通过执行 heroku run dpd showkey 看到它。

我想弄清楚为什么在我的 procfile 中列出命令不起作用。请在下面找到我的文件:

web: node app.js
cmd: dpd keygen
cmd: dpd showkey

我的日志文件如下:

2015-08-30T19:18:25.012474+00:00 heroku[api]: Starting process with command `dpd showkey` by [email]
2015-08-30T19:18:28.196008+00:00 heroku[run.5122]: Starting process with command `dpd showkey`
2015-08-30T19:18:28.168161+00:00 heroku[run.5122]: Awaiting client
2015-08-30T19:18:28.501367+00:00 heroku[run.5122]: State changed from starting to up
2015-08-30T19:18:31.023033+00:00 heroku[run.5122]: State changed from up to complete
2015-08-30T19:18:31.012416+00:00 heroku[run.5122]: Process exited with status 0
2015-08-30T19:19:36.935285+00:00 heroku[api]: Starting process with command `dpd keygen` by [email]
2015-08-30T19:19:39.794903+00:00 heroku[run.3022]: Starting process with command `dpd keygen`
2015-08-30T19:19:39.768225+00:00 heroku[run.3022]: Awaiting client
2015-08-30T19:19:40.128378+00:00 heroku[run.3022]: State changed from starting to up
2015-08-30T19:19:42.827722+00:00 heroku[run.3022]: State changed from up to complete
2015-08-30T19:19:42.813695+00:00 heroku[run.3022]: Process exited with status 0
2015-08-30T19:19:51.655953+00:00 heroku[api]: Starting process with command `dpd showkey` by [email]
2015-08-30T19:19:54.911082+00:00 heroku[run.9997]: Awaiting client
2015-08-30T19:19:54.946930+00:00 heroku[run.9997]: Starting process with command `dpd showkey`
2015-08-30T19:19:55.293222+00:00 heroku[run.9997]: State changed from starting to up
2015-08-30T19:19:58.397128+00:00 heroku[run.9997]: State changed from up to complete
2015-08-30T19:19:58.384885+00:00 heroku[run.9997]: Process exited with status 0
2015-08-30T19:29:11.578546+00:00 heroku[slug-compiler]: Slug compilation finished
2015-08-30T19:29:11.578526+00:00 heroku[slug-compiler]: Slug compilation started
2015-08-30T19:29:11.531233+00:00 heroku[api]: Release v22 created by [email]
2015-08-30T19:29:11.531111+00:00 heroku[api]: Deploy 27d1a9c by [email]

谢谢!

【问题讨论】:

    标签: node.js heroku procfile deployd


    【解决方案1】:

    我可以通过使用 npm 的 postinstall 来解决这个问题:

    "scripts": {
        "postinstall": "dpd keygen && dpd showkey",
        "start": "node server"
    },
    

    当推送到heroku repo时,密钥会在日志中输出,例如

    远程:> dpd keygen && dpd showkey 远程:远程:
    已创建密钥 1f89d0aa66b50fdd... 远程:复制此密钥以供使用 在远程仪表板远程:远程:
    1f89d0aa66b50fdd12c383bbdfcd2a9db7034c516e1353e11b3080faa5598a7944c91bca582b5e2c41f6164c9141e17edc5a994cf14c8d5d0aada7b8b1b4ac3d738b793c8597c8588898748729ef1abf9a24c86f11dfbdf19a152523f9633b83366a604db450ebea11f77e54ba7419d4d85af8f9a5b8fd079be382a08a32a5914dff3910e9c11770eff43d8ds0779bae0dd039c13b425b0a706bcaee5ca9c38afe2801495808b552f120daa50d244a7c8d80d06a126beb596b77ff47947b97ceecd9f63dd786b67a0bc6a765f27463cc6274e76804136eea6ae54bcd5b5d15537cf3da1c9b2cf3c6676327b95cbdd277ec1367274271814ab95e2d72b2a09ebc

    【讨论】:

    • 我不再处理这个问题,但我会根据输出将此答案标记为已接受的答案。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2011-10-16
    • 2018-05-21
    • 2012-01-09
    • 2021-09-23
    • 2019-03-20
    • 1970-01-01
    • 1970-01-01
    • 2011-12-18
    相关资源
    最近更新 更多