Heroku "oauth-private.key" 不存在或不可读 - Laravel 5

Heroku "oauth-private.key" does not exist or is not readable - Laravel 5

在 Heroku 平台上部署 Laravel 5.4 应用程序时出现以下错误。

Key path "file:///app/storage/oauth-private.key" does not exist or is not readable

这是因为我安装了需要私钥的passport包,它存储在Laravel App的Storage文件夹中。

我可以简单地从 .gitignore 中删除这一行 /storage/*.key 来解决问题

但我更喜欢永久且安全的解决方案。如何安全地将私钥放入heroku。

您似乎必须对存储目录进行一些权限更改。使用以下命令获得适当的权限。

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

分配 www-data 正确目录和写入权限后,您的密钥必须有效。