diff --git a/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/00-overview.md b/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/00-overview.md index 66927b8b9c..4e4f786140 100644 --- a/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/00-overview.md +++ b/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/00-overview.md @@ -14,8 +14,8 @@ Remote Strapi providers connect to an instance of Strapi over a network using a Internally, the remote Strapi providers map websocket requests to a local Strapi provider of the instance it is running in. -## Websocket Server +In order to use remote transfer providers, the remote Strapi server must have a value for `transfer.token.salt` configured in `config/admin.js` and the remote transfer feature must not be disabled. -When the data transfer feature is enabled for a Strapi server (a transfer token salt has been set on the server and STRAPI_DISABLE_REMOTE_DATA_TRANSFER is not set to true), Strapi will create websocket servers available on the routes `/admin/transfer/runner/pull` and `/admin/transfer/runner/push`. +## Disabling Remote Transfers -Opening a websocket connection on those routes requires a valid transfer token as a bearer token in the Authorization header. +If desired, the remote transfer feature of a server can be completely disabled by setting the environment variable `STRAPI_DISABLE_REMOTE_DATA_TRANSFER` to true. diff --git a/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/01-websocket.md b/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/01-websocket.md index 2633b566fa..49fc2d37ee 100644 --- a/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/01-websocket.md +++ b/docs/docs/docs/01-core/data-transfer/04-remote-strapi-providers/01-websocket.md @@ -8,4 +8,30 @@ tags: # Remote Provider Websocket -**TODO** +When the data transfer feature is enabled for a Strapi server (an `admin.transfer.token.salt` config value has been set and STRAPI_DISABLE_REMOTE_DATA_TRANSFER is not set to true), Strapi will create websocket servers available on the routes `/admin/transfer/runner/pull` and `/admin/transfer/runner/push`. + +Opening a websocket connection on those routes requires a valid transfer token as a bearer token in the Authorization header. + +Please see the `bootstrap()` method of the remote providers for an example of how to make the initial connection to the Strapi websocket. + +## Websocket Messages + +After connecting to the websocket. + +### Initialization Messages + +** TODO ** + +### Pull Messages + +** TODO ** + +### Push Messages + +** TODO ** + +See `packages/core/data-transfer/dist/strapi/remote/handlers/push.d.ts` and `packages/core/data-transfer/dist/strapi/remote/handlers/push.d.ts` + +## Message Timeouts and Retries + +Because the transfer uses on a message->response protocol, if the websocket server is unable to send a reply, for example due to network instability, the connection would halt. For this reason, each provider's options includes `retryMessageOptions` which attempt to resend a message after a given timeout is reached and a max retry option to give up after a given number of failed retry attempts.