diff --git a/docs/.vuepress/config/sidebar-developer.js b/docs/.vuepress/config/sidebar-developer.js index c89b61847c..46757528c0 100644 --- a/docs/.vuepress/config/sidebar-developer.js +++ b/docs/.vuepress/config/sidebar-developer.js @@ -107,6 +107,11 @@ const developer = [ collapsable: true, initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded children: [ + { + title: "Strapi Cloud", + path: '/developer-docs/latest/setup-deployment-guides/deployment/strapi-cloud.md', + collapsable: true, + }, { title: 'Hosting Provider Guides', path: diff --git a/docs/.vuepress/styles/branding.styl b/docs/.vuepress/styles/branding.styl index 0aa4860b30..77a92b4b31 100644 --- a/docs/.vuepress/styles/branding.styl +++ b/docs/.vuepress/styles/branding.styl @@ -163,6 +163,12 @@ h2 .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after border-left-color $primary600 !important +// Give the bottom of TOC more room to breathe +.sidebar-box > .sidebar-links >li:last-child + margin-bottom: 30px +.sidebar .sidebar-box + padding-bottom: 10px + .nav-links a .nav-links a.router-link-active font-weight 600 diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md index 488a908a9f..24199612b0 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md @@ -8,6 +8,18 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/d The [Entity Service API](/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md) is built on top of the the [Query Engine API](/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md) and uses it to perform CRUD operations on entities. + +The `uid` parameter used in function calls for this API is a `string` built with the following format: `[category]::[content-type]` where `category` is one of: `admin`, `plugin` or `api`. + +Examples: +- A correct `uid` to get users of the Strapi admin panel is `admin::user`. +- A possible `uid` for the Upload plugin could be `plugin::upload.file`. +- As the `uid`s for user-defined custom content-types follow the `api::[content-type]` syntax, if a content-type `article` exists, it is referenced by `api::article.article`. + +::: tip +Run the [`strapi content-types:list`](/developer-docs/latest/developer-resources/cli/CLI.md#strapi-content-types-list) command in a terminal to display all possible content-types' `uid`s for a specific Strapi instance. +::: + ## findOne() Finds the first entry matching the parameters. diff --git a/docs/developer-docs/latest/guides/unit-testing.md b/docs/developer-docs/latest/guides/unit-testing.md index 3b4b071901..b8d47ad983 100644 --- a/docs/developer-docs/latest/guides/unit-testing.md +++ b/docs/developer-docs/latest/guides/unit-testing.md @@ -135,6 +135,9 @@ async function cleanupStrapi() { //close server to release the db-file await strapi.server.httpServer.close(); + // close the connection to the database before deletion + await strapi.db.connection.destroy(); + //delete test database after all tests have completed if (dbSettings && dbSettings.filename) { const tmpDbFile = `${__dirname}/../${dbSettings.filename}`; @@ -142,8 +145,6 @@ async function cleanupStrapi() { fs.unlinkSync(tmpDbFile); } } - // close the connection to the database - await strapi.db.connection.destroy(); } module.exports = { setupStrapi, cleanupStrapi }; @@ -296,7 +297,7 @@ it("should login user and return jwt token", async () => { it('should return users data for authenticated user', async () => { /** Gets the default user role */ - const defaultRole = await strapi.query('role', 'users-permissions').findOne({}, []); + const defaultRole = await strapi.query('plugin::users-permissions.role').findOne({}, []); const role = defaultRole ? defaultRole.id : null; diff --git a/docs/developer-docs/latest/plugins/i18n.md b/docs/developer-docs/latest/plugins/i18n.md index 2494c7b42c..3267fea562 100644 --- a/docs/developer-docs/latest/plugins/i18n.md +++ b/docs/developer-docs/latest/plugins/i18n.md @@ -215,7 +215,7 @@ To create a localized entry for a locale different from the default one, add the "createdAt": "2021-10-28T17:01:47.089Z", "updatedAt": "2021-10-28T17:01:47.089Z", "publishedAt": "2021-10-28T17:01:47.082Z", - "locale": "en" + "locale": "fr" } }, "meta": {} diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/advanced.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/advanced.png new file mode 100644 index 0000000000..44439c93cc Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/advanced.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/deploys.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/deploys.png new file mode 100644 index 0000000000..b26c8a340c Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/deploys.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/import.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/import.png new file mode 100644 index 0000000000..30b157b8e4 Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/import.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/login.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/login.png new file mode 100644 index 0000000000..2bad89db93 Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/login.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/project_list.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/project_list.png new file mode 100644 index 0000000000..502ddfd697 Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/project_list.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/projects_empty.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/projects_empty.png new file mode 100644 index 0000000000..00d9f570f3 Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/projects_empty.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/settings.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/settings.png new file mode 100644 index 0000000000..d184165867 Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/settings.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/setup.png b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/setup.png new file mode 100644 index 0000000000..1a1279ee3d Binary files /dev/null and b/docs/developer-docs/latest/setup-deployment-guides/assets/deployment/cloud/setup.png differ diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md index 12ba11a2ce..cde00eaaf6 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md @@ -467,7 +467,7 @@ The security middleware is based on [koa-helmet](https://helmetjs.github.io/). I |-----------------------------|-----------------------------------------------------------------------------------------------|-----------------------|---------------| | `crossOriginEmbedderPolicy` | Set the `Cross-Origin-Embedder-Policy` header to `require-corp` | `Boolean` | `false` | | `crossOriginOpenerPolicy` | Set the `Cross-Origin-Opener-Policy` header | `Boolean` | `false` | -| `crossOriginOpenerPolicy` | Set the `Cross-Origin-Resource-Policy` header | `Boolean` | `false` | +| `crossOriginResourcePolicy` | Set the `Cross-Origin-Resource-Policy` header | `Boolean` | `false` | | `originAgentCluster` | Set the `Origin-Agent-Cluster` header | `Boolean` | `false` | | `contentSecurityPolicy` | Set the `Content-Security-Policy` header | `Boolean` | `false` | | `xssFilter` | Disable browsers' cross-site scripting filter by setting the `X-XSS-Protection` header to `0` | `Boolean` | `false` | diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/strapi-cloud.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/strapi-cloud.md new file mode 100644 index 0000000000..5dce8d6e92 --- /dev/null +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/strapi-cloud.md @@ -0,0 +1,131 @@ +--- +title: Strapi Cloud Deployment - Strapi Developer Docs +description: Learn how to deploy your Strapi application on Strapi Cloud. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/strapi-cloud.html +--- + +# Strapi Cloud + +::: warning +Strapi Cloud is currently in Closed Beta release. Features and functionality may change prior to General Availability. +::: + +This is a step-by-step guide for deploying your Strapi application on Strapi Cloud. Before you are able to access Strapi Cloud, you must first [request access](#requesting-access) to the Beta release. + +## Requesting access + +To request access you must sign up for the waitlist [here](https://strapi.io/cloud). Be sure to enter your correct GitHub username and Discord ID as these are used to grant access to the Strapi Cloud Beta. + +Onboarding of users will be done in batches. You will be notified via email when you have been granted access to Strapi Cloud. + +## Prerequisites + +Before you can deploy your Strapi application on Strapi Cloud, you need to have the following prerequisites: + +* A [GitHub](https://github.com) account +* GitHub repository for your Strapi application(s) +* Strapi version 4.1+ + +::: tip +The connected repository can contain multiple Strapi applications. Each Strapi app must be in a separate directory. +::: + +## Getting started + +1. Navigate to the [Strapi Cloud](https://cloud.strapi.io) login page. + +![Strapi Cloud login page](../assets/deployment/cloud/login.png) + +2. You are prompted to **Log In with GitHub**. Your Strapi Cloud account is created during this initial login. + +3. Once logged in, you will be redirected to the Strapi Cloud **Projects** page. From here you can create your first Strapi Cloud project. + +![Strapi Cloud Projects page](../assets/deployment/cloud/projects_empty.png) + +### Create a project + +1. From the **Projects** page, click the **Create Project** button. You are prompted to **Connect with GitHub**. + +::: tip +Connect the GitHub account and/or Organizations that own the repository or repositories you want to deploy. This can be different from the account that owns the Strapi Cloud account. + +You will be redirected to GitHub to authorize Strapi Cloud to access your repository. +::: + +2. After granting the required access from GitHub, from the **Projects** page select your desired repository to install Strapi Cloud. + +![Project Import - Select Repository](../assets/deployment/cloud/import.png) + +3. Click **Next** to proceed to the Project Set up page and enter the following information: + * **Project name**: The name of your Strapi app, this is fetched from the repository name but can be edited. It is automatically converted to slug format (`my-strapi-app`). + * **GitHub branch**: The default branch to use for this deployment. This uses the [default branch](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch) of the repository but can be changed via the drop-down. + * **Deploy on push**: When enabled, this will automatically deploy the latest changes from the selected branch. When disabled, you will need to manually deploy the latest changes. + +![Project Setup](../assets/deployment/cloud/setup.png) + +4. (**Optional**) Select **Show Advanced Settings** to configure the following options: + * [**Environment variables**](../configurations/optional/environment.md): Environment variables are used to configure your Strapi app. + * **Base directory**: The directory where your Strapi app is located in the repository. This is useful if you have multiple Strapi apps in the same repository or if you have a monorepo. + +![Advanced Setup](../assets/deployment/cloud/advanced.png) + +5. Click **Create** to finalize the project creation. An initial deployment is triggered and you are redirected to the **Projects** page. + +## Managing projects + +The **Projects** page displays a list of all your Strapi Cloud projects. From here you can manage your projects and access the corresponding applications. + +![Projects page - List](../assets/deployment/cloud/project_list.png) + +Each project card displays the following information: + +* **Project name** +* **Status**: Displays a **Disconnected** warning if the project repository is not connected to Strapi Cloud. +* **Last deployment date**: Timestamp of the last deployment. + +## Project details + +From the **Projects** page, click on any project card to access that project's details page. + +The project details page displays the following tabs: **Deploys** and **Settings**. + +### Deploys + +The **Deploys** tab displays a chronological list of cards with the details of all historical deployments for the project. + +![Project deploys](../assets/deployment/cloud/deploys.png) + +Each card displays the following information: + +* **Commit SHA** +* **Commit message** +* **Deployment status**: Whether the project is + * **Deploying** + * **Done** + * **Cancelled** + * **Build failed** + * **Deploy failed** +* **Last deployment time**: When the deployment was triggered and the duration. +* **Production branch** +* **Options** menu (`...`): The available options vary depending on the deployment status. + * For **Done** status: No further options. + * For **Deploying** status, you can: + * **Cancel deploy** + * For **Build failed** status, you can: + * **Download error logs** + * For **Deploy failed** status, you can: + * **Download error logs** + +From this page you can also trigger a new deployment and access the application using the corresponding buttons. + +## Settings + +The **Settings** enables you to edit the following details for the project: + +* **Project name**: The name of your Strapi app, used to identify the project on the Cloud Dashboard, Strapi CLI, and deployment URLs. +* **Production branch**: The branch of the linked repository to use for production deployments. +* **Environment variables**: Environment variables are used to configure the environment of your Strapi app. +* **Connected GitHub repository**: The Git repository linked to the project. +* **Delete project**: This will ***permanently and irreversibly*** delete the project and all its associated data. + +![Project settings](../assets/deployment/cloud/settings.png) diff --git a/docs/user-docs/latest/assets/content-manager/content-manager_list-view.png b/docs/user-docs/latest/assets/content-manager/content-manager_list-view.png index 66f0ac3082..9d98523d54 100644 Binary files a/docs/user-docs/latest/assets/content-manager/content-manager_list-view.png and b/docs/user-docs/latest/assets/content-manager/content-manager_list-view.png differ