在AWS上设置Strapi -Docs没有显示所有内容

发布于 2025-02-03 03:31:18 字数 820 浏览 2 评论 0 原文

我正在尝试在AWS上设置Strapi,并且AM一直在关注Strapi文档在这里。但是,当我开始启动EC2实例时,我遇到了一些文档中未解决的错误。应用程序密钥,JWT Secrets和其他Env Config变量。还有其他人尝试过并遇到类似问题吗?你是怎么解决事情的?我在EC2实例中一直在运行 pm2 log 以获取错误。

我会发布我的配置,但所有内容都遵循Strapi Docs到字母上,并且现在已经贯穿了几个步骤,并且我不想再次将文档复制并粘贴到这里。我的最后一步是让Strapi在EC2实例上运行,但是我一直遇到这样的错误,

error: Missing jwtSecret. Please, set configuration variable "jwtSecret" for the users-permissions plugin in config/plugins.js (ex: you can generate one using Node with `crypto.randomBytes(16).toString('base64')`).

这些错误似乎在任何地方都无法解决。

I am trying to setup Strapi on AWS and am have been following the Strapi documentation here. But when I get to starting the EC2 instance, I have run into a few errors that were not addressed in in the docs. App keys, jwt secrets, and other env config variables. Has anyone else tried this and run into similar issues? And how did you get around things? I have been running pm2 log in my EC2 instance to get the errors.

I would post my config and everything but I have followed the strapi docs to the letter, and have run through every single step a dozen times now, and I don't want to basically copy and paste the docs in here again. My last step is to get Strapi to run on the EC2 instance, but I keep running into errors like this

error: Missing jwtSecret. Please, set configuration variable "jwtSecret" for the users-permissions plugin in config/plugins.js (ex: you can generate one using Node with `crypto.randomBytes(16).toString('base64')`).

which don't seem to be addressed in the docs anywhere.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心清如水 2025-02-10 03:31:18

这是因为您需要公开 jwt_secret (和 admin_jwt_secret )环境变量。您可以通过添加(您可以添加这样的行: jwt_secret = a_random_string_here )来执行此操作( jwt_secret = a_random_string_here )。

您可以在此处找到更多详细信息:

This is because you need to expose the JWT_SECRET (and ADMIN_JWT_SECRET) environment variable. You can do it by adding (you can add a line like this: JWT_SECRET=A_RANDOM_STRING_HERE) it to the .env file located at the root of your Strapi project.

You can find more details here: https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#jwt-configuration

不弃不离 2025-02-10 03:31:18

您可以生成JWT

node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"

You can generate jwt

node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文