Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku deployment with APP_KEYS #807

Closed
stb13579 opened this issue Mar 18, 2022 · 6 comments · Fixed by #838
Closed

Heroku deployment with APP_KEYS #807

stb13579 opened this issue Mar 18, 2022 · 6 comments · Fixed by #838
Assignees
Labels
issue: quick fix Issues that could be fixed quickly, with small- to medium-sized PRs

Comments

@stb13579
Copy link
Contributor

Ya I just had the same problem. When following the deploy to Heroku with Postgres it has you set up the config and .envs for everything but does not mention setting the APP_KEYS. It should probably mention that you need to add the APP_KEYS to the Heroku config

Originally posted by @owen-duncan-snobel in #770 (comment)

@stb13579
Copy link
Contributor Author

see PR #811

@stb13579 stb13579 modified the milestone: #811 Mar 21, 2022
@stb13579 stb13579 linked a pull request Mar 21, 2022 that will close this issue
@stb13579 stb13579 self-assigned this Mar 23, 2022
@stb13579
Copy link
Contributor Author

We are working to fix the documentation for Heroku deployment. The short version is that you need to:

  1. add a production server.js file to your Strapi project in the following location: //Path: ./config/env/production/server.js. You will likely need to make both the env and production subdirectories if you have not done so previously.
  2. Only refer to the variables in the production .env file, do not add any default values (see example 1 below).
  3. Add the production app.keys to your project settings on Heroku (see example 2 below). The config vars and the app.keys string must match like the example APP_KEYS.

Example 1 production server.js file:

module.exports = ({ env }) => ({
  proxy: true,
  url: env('MY_HEROKU_URL'),
  app: { 
    keys: env.array('APP_KEYS')
  },
});

Example 2: Heroku settings
Screen Shot 2022-03-29 at 10 18 56

@NicoHof
Copy link
Contributor

NicoHof commented Apr 5, 2022

@stb13579
Copy link
Contributor Author

stb13579 commented Apr 5, 2022

@NicoHof, thanks! I think nearly every deployment guide will need to be updated for this reason. If you work out the solution for Render, please feel free to submit a PR to update the documentation. Thanks again for being an active contributor to the Strapi repo, the community is what makes Strapi such a great place to work.

@NicoHof
Copy link
Contributor

NicoHof commented Apr 5, 2022

@StrapiShaun I will have a look

@NicoHof
Copy link
Contributor

NicoHof commented Apr 5, 2022

@StrapiShaun create a PR #832

@stb13579 stb13579 linked a pull request Apr 7, 2022 that will close this issue
stb13579 added a commit that referenced this issue Apr 8, 2022
Include APP_KEYS in Heroku Deployment Guide - fix #807
@pwizla pwizla added the issue: quick fix Issues that could be fixed quickly, with small- to medium-sized PRs label Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: quick fix Issues that could be fixed quickly, with small- to medium-sized PRs
Projects
None yet
3 participants