diff --git a/.travis.yml b/.travis.yml index 56e1f71cad..6678f29e51 100755 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ git: language: node_js node_js: - - "8" + - "9" before_install: - export CHROME_BIN=chromium-browser diff --git a/docs/3.x.x/en/advanced/customize-admin.md b/docs/3.x.x/en/advanced/customize-admin.md index 9c0da89c1a..420527e6e0 100644 --- a/docs/3.x.x/en/advanced/customize-admin.md +++ b/docs/3.x.x/en/advanced/customize-admin.md @@ -111,51 +111,73 @@ This will replace the folder's content located at `./admin/admin/build`. Visit h ## Deployment -There is three cases to deploy the administration panel: -1. On the same server as the API. -2. Without the plugins on another server (AWS S3, Azure, etc) as the API. -3. With the plugins on different servers as the API. +The administration is nothing more than a React front-end application calling an API. The front-end and the back-end are independent and can be deployed on different servers which brings us to different scenarios: -Let's dive into the build configurations. The file should look like this: +1. Deploy the entire project on the same server. +2. Deploy the administration panel on another server (AWS S3, Azure, etc) than the API. +3. Deploy the administration panel and the plugins on another server than the API. + +Let's dive into the build configurations for each case. + +#### Deploy the entire project on the same server. + +You don't need to touch anything in your configuration file. This is the default behaviour and the build configurations will be automatically set. The server will start on the defined port and the administration panel will be accessible through http://yourdomain.com:1337/dashboard. + +You might want to change the path to access to the administration panel. Here the required configurations to change the path: **Path —** `./config/environment/**/server.json`. -```json +```js { + "host": "localhost", + "port": 1337, + "autoReload": { + "enabled": false + }, + "cron": { + "enabled": false + }, "admin": { + "path": "/dashboard" // We change the path to access to the admin (highly recommended for security reasons). + } +} +``` + +**You have to rebuild the administration panel to make this work.** Please follow the [step #2 of the deployment guide](../guides/deployment.md). + +#### Deploy the administration panel on another server (AWS S3, Azure, etc) than the API. + +It's very common to deploy the front-end and the back-end on different servers. Here the required configurations to handle this case: + +**Path —** `./config/environment/**/server.json`. +```js +{ + "host": "localhost", + "port": 1337, + "autoReload": { + "enabled": false + }, + "cron": { + "enabled": false + }, + "admin": { + "path": "/dashboard", "build": { - "host": "https://admin.myapp.com", - "backend": "https://api.myapp.com:8080", + "host": "/", // Note: The administration will be accessible from the root of the domain (ex: http//yourfrontend.com/) + "backend": "http://yourbackend.com", "plugins": { - "source": "host", - "folder": "/plugins" + "source": "backend" // What does it means? The script tags in the index.html will use the backend value to load the plugins (ex: http://yourbackend.com/dashboard/content-manager/main.js). } } } } ``` -#### On the same server as the API +The administration URL will be http://yourfrontend.com and every request from the panel will hit the backend at http://yourbackend.com. The plugins will be injected through the `origin` (means the API itself). In other words, the plugins URLs will be `http://yourbackend.com/dashboard/content-manager/main.js`. -You don't need to touch anything in your configuration file. This is the default behaviour and the build configurations will be automatically set. +> Note: How it is possible? The API (the Strapi server) owns the plugin and these plugins are exposed through `http://yourbackend.com/admin/**/main.js` -#### Without the plugins on another server -**Path —** `./config/environment/**/server.json`. -```json -{ - "admin": { - "build": { - "host": "https://admin.myapp.com", - "backend": "https://api.myapp.com:8080", - "plugins": { - "source": "origin" - } - } - } -} -``` - -The administration URL will be https://admin.myapp.com and every request from the panel will hit the backend at https://api.myapp.com:8080. The plugins will be injected through the `origin` (means the API itself). In other words, the plugins URLs will be `https://api.myapp.com:8080/admin/content-manager/main.js`. +The DOM should look like this: **Path —** `./admin/admin/build/index.html`. ```html @@ -163,38 +185,46 @@ The administration URL will be https://admin.myapp.com and every request from th
- - - - - + + + + +