Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0592d1c
Use beta logo
pwizla Mar 15, 2022
a09b7f2
Merge branch 'main' into next
derrickmehaffy Mar 15, 2022
f34d15c
[beta] Add TS command (#800)
soupette Mar 16, 2022
a1073a7
[beta] Dark mode: Updates user guide + dev docs (#795)
pwizla Mar 16, 2022
744d54a
Slightly update wording for TS flag
pwizla Mar 16, 2022
97b5f52
Update core store migration
pwizla Mar 16, 2022
825fbe2
(WIP) Add permissions mapping tables
pwizla Mar 22, 2022
9b5f373
Fix typo
dsiddy Apr 3, 2022
893fbc6
Merge pull request #827 from dsiddy/patch-1
stb13579 Apr 4, 2022
9efaeae
Updated the telemetry opt-out method
stb13579 Apr 5, 2022
1ad52cf
Update amazon-aws.md: Wrong package mentioned (#830)
spreadcharm Apr 5, 2022
9d662c5
Missing information for plugin creation #834
DimitriGilbert Apr 6, 2022
2d9e138
Include APP_KEYS in Heroku Deployment Guide
dsfaccini Apr 6, 2022
4ec63fc
Added caution callout and small text + formatting revisions
stb13579 Apr 8, 2022
906fb5d
Apply suggestions from code review
DimitriGilbert Apr 8, 2022
929c019
Merge pull request #831 from strapi/dev/telemetry-opt-out
stb13579 Apr 8, 2022
0c33ecd
Merge pull request #838 from dsfaccini/patch-1
stb13579 Apr 8, 2022
f2876ff
docs: improve the Laravel Documentation
Apr 8, 2022
12b3105
Merge pull request #836 from DimitriGilbert/patch-1
stb13579 Apr 8, 2022
e5651f5
docs: fix typo in code section
Apr 8, 2022
04c356b
Update azure.md
kulahad Apr 11, 2022
3b71421
Merge pull request #846 from kulahad/patch-1
stb13579 Apr 11, 2022
9f3c8ec
Merge pull request #843 from danielsum/patch-1
stb13579 Apr 11, 2022
58d8eb6
Finish adding permission mapping tables
pwizla Apr 12, 2022
a36afe7
Merge branch 'dev/next-sql-migration-updates'
pwizla Apr 12, 2022
4bf83e3
Merge branch 'production' into main
derrickmehaffy Apr 13, 2022
c5eb7e4
Remove typescript from production release
derrickmehaffy Apr 13, 2022
87a7001
Added migration guide
stb13579 Apr 19, 2022
f37dc7d
Added link to 4.1.8 migration guide
stb13579 Apr 19, 2022
208830a
add comments for Shaun
derrickmehaffy Apr 20, 2022
9e1198a
updated with Derrick's suggestions
stb13579 Apr 21, 2022
f949b2f
fixed spelling and phrasing
stb13579 Apr 21, 2022
1fea391
add JWT_SECRET code snippet
stb13579 Apr 21, 2022
b10d121
Fixed code for config/plugins
stb13579 Apr 21, 2022
48e9617
Update docs/developer-docs/latest/update-migration-guides/migration-g…
stb13579 Apr 21, 2022
ca702d0
Update docs/developer-docs/latest/update-migration-guides/migration-g…
stb13579 Apr 21, 2022
751757b
docs: fix typo (#853)
inc-ali Apr 21, 2022
8eeb915
Merge pull request #851 from strapi/dev/v4.1.8-migration
stb13579 Apr 21, 2022
44ea262
make render.com hosting guide work with strapi version >= v4.0.6 (#832)
NicoHof Apr 21, 2022
463e820
Add additional commands for Heroku environment variables config (#850)
derrickmehaffy Apr 21, 2022
491c601
Merge branch 'production' into main
derrickmehaffy Apr 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gridsome is a [Static Site Generator](https://www.staticgen.com/) and will fetch
yarn add @gridsome/source-strapi
```

- Add the `@gridsome/source-strapi` to the plugins section in the `gridsome-config.js` file:
- Add the `@gridsome/source-strapi` to the plugins section in the `gridsome.config.js` file:

```js
module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,25 @@ module.exports = ({ env }) => ({
})
```

You will also need to set the environment variable in Heroku for the `MY_HEROKU_URL` and `APP_KEYS`. This will populate the variables with something like `https://your-app.herokuapp.com/` and `dsfhasbvvfwfcerterzer+n1w==,afjdsagfsauzuwzref6==,kjdbgjerhgh6wireg==,jkssdhgjaksdgkjbsdg==` respectively.
You will also need to set the environment variables in Heroku for the `MY_HEROKU_URL`, `APP_KEYS`, `API_TOKEN_SALT`, `ADMIN_JWT_SECRET`, and `JWT_SECRET`. This will populate the variables with something like `https://your-app.herokuapp.com/` and various random keys from the `.env` file locally. In some cases it is recommended to create new random secrets instead and there are various methods to do so.

To copy existing secrets from your environment config locally use the following:

```bash
heroku config:set MY_HEROKU_URL=$(heroku info -s | grep web_url | cut -d= -f2)
heroku config:set APP_KEYS=$(cat .env | grep APP_KEYS | cut -d= -f2-)
heroku config:set API_TOKEN_SALT=$(cat .env | grep API_TOKEN_SALT | cut -d= -f2)
heroku config:set ADMIN_JWT_SECRET=$(cat .env | grep ADMIN_JWT_SECRET | cut -d= -f2)
heroku config:set JWT_SECRET=$(cat .env | grep -w JWT_SECRET | cut -d= -f2)
```

The following `openssl` commands will generate random new secrets (Mac and Linux only):

```bash
heroku config:set APP_KEYS=$(openssl rand -base64 32)
heroku config:set API_TOKEN_SALT=$(openssl rand -base64 32)
heroku config:set ADMIN_JWT_SECRET=$(openssl rand -base64 32)
heroku config:set JWT_SECRET=$(openssl rand -base64 32)
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guid

# Render

!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!!

This guide explains how to update an existing Strapi project so it can be deployed on [Render](https://render.com).

With persistent disks and managed PostgreSQL databases, Render gives you multiple different ways to store your content. Render services come with fully managed SSL, so it's no longer necessary to set up a proxy server to secure your Strapi app. Since Render services are automatically restarted if they become unresponsive, you don't need to use a process manager like `pm2` either.
Expand Down Expand Up @@ -53,7 +51,7 @@ services:
sizeGB: 1
envVars:
- key: NODE_VERSION
value: 12.18.4
value: 12.22.0
- key: NODE_ENV
value: production
- key: DATABASE_FILENAME
Expand All @@ -62,6 +60,10 @@ services:
generateValue: true
- key: ADMIN_JWT_SECRET
generateValue: true
- key: APP_KEYS
generateValue: true
- key: API_TOKEN_SALT
generateValue: true
```

:::
Expand All @@ -79,7 +81,7 @@ services:
healthCheckPath: /_health
envVars:
- key: NODE_VERSION
value: 12.18.4
value: 12.22.0
- key: NODE_ENV
value: production
- key: CLOUDINARY_NAME
Expand All @@ -96,6 +98,10 @@ services:
generateValue: true
- key: ADMIN_JWT_SECRET
generateValue: true
- key: APP_KEYS
generateValue: true
- key: API_TOKEN_SALT
generateValue: true

databases:
- name: strapi
Expand All @@ -121,7 +127,7 @@ services:
sizeGB: 1
envVars:
- key: NODE_VERSION
value: 12.18.4
value: 12.22.0
- key: NODE_ENV
value: production
- key: DATABASE_URL
Expand All @@ -132,6 +138,10 @@ services:
generateValue: true
- key: ADMIN_JWT_SECRET
generateValue: true
- key: APP_KEYS
generateValue: true
- key: API_TOKEN_SALT
generateValue: true

databases:
- name: strapi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Migrations are necessary when upgrades to Strapi include breaking changes. The m
## v4 migration guides

- [Migration guide from 4.0.x to 4.0.6](migration-guides/v4/migration-guide-4.0.x-to4.0.6.md)
- [Migration guide from 4.0.6 to 4.1.8](migration-guides/v4/migration-guide-4.0.x-to-4.1.8.md)

## v3 to v4 migration guides

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: Migrate from 4.1.7 to 4.1.8 - Strapi Developer Docs
description: Learn how you can migrate your Strapi application from 4.1.7 to 4.1.8.
canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.0.x-to-4.1.8.html
---

# v4.0.x to v4.1.8 migration guide

The Strapi v4.0.x to v4.1.8 migration guide upgrades versions of v4.0.6 through v4.1.7 to v4.1.8. The minimum configuration for `config/admin` now includes the API token `API_TOKEN_SALT`. Strapi no longer populates default values for the admin JWT in `config/admin`. Initial values are generated and stored in the .env file during project creation. Strapi no longer passes secrets to non-development environments, requiring users to set the secrets purposefully. The migration to v4.1.8 consists of 4 steps:

- adding the API token to `config/admin`,
- removing the default `ADMIN_JWT_SECRET` (recommended for improved security),
- configuring `JWT_SECRET` in `config/plugins` (recommended),
- setting secrets for non-development environments.

## Modifying the `config/admin` file

Strapi, by default, creates the environmental variable `API_TOKEN_SALT` and populates a unique value, stored in `/.env` at project creation. In order to update `config/admin`:

- add the apiToken object,
- remove the comma and default value from the `ADMIN_JWT_SECRET` parenthetical.

<code-group>

<code-block title="JAVASCRIPT">

```jsx

//path: config/admin.js

module.exports = ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),
},
apiToken: {
salt: env('API_TOKEN_SALT'),
},
});

```

</code-block>

<code-block title="TYPESCRIPT">

```jsx
//path: config/admin.ts

export default ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),
},
apiToken: {
salt: env('API_TOKEN_SALT'),
},
});


```

</code-block>

</code-group>

## Configuring `JWT_SECRET`

`JWT_SECRET` is used by the Users and Permissions plugin, and populated in `/.env`. The property should be stored in `config/plugins.js` (or `config/plugins.ts` for a TypeScript project). The `plugins` file is not created by default in a Strapi application. If the file does not exist, users should create the file and add the follow code snippet.

<code-group>

<code-block title="JAVASCRIPT">

```jsx
// path: config/plugins.js

module.exports = ({ env }) => ({
// ...
'users-permissions': {
config: {
jwtSecret: env('JWT_SECRET')
},
},
// ...
});

```

</code-block>

<code-block title="TYPESCRIPT">

```jsx
// path: config/plugins.ts

export default ({ env }) => ({
// ...
'users-permissions': {
config: {
jwtSecret: env('JWT_SECRET')
},
},
// ...
});

```

</code-block>

</code-group>

## Setting secrets for non-development environments

Users are required to set secrets for each unique environment, such as a production environment deployment on a platform. Strapi no longer passes the following secrets to non-development environments:

- APP_KEYS
- JWT_SECRET
- API_TOKEN_SALT
- ADMIN_JWT_SECRET

There are multiple methods to generate secrets, for example running `openssl rand -base64 32` in the terminal (Mac and Linux OS). Generating unique secrets for each environment is recommended for increased security.

::: caution

The [Hosting Provider Guides](/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides.md) are being updated to reflect these changes. Community contributions updating the hosting guides are encouraged.

:::