From a4cf29c7978efdd414cbb12578f1170793a11310 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Mon, 20 Apr 2020 18:41:24 +0300 Subject: [PATCH] Update README [skip ci] --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0de85ce..3fc740a 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ docker-compose up -d app true - MOJANG_TEXTURES_UUIDS_PROVIDER_DRIVER + MOJANG_TEXTURES_UUIDS_PROVIDER_DRIVER Specifies the preferred provider of the Mojang's UUIDs. Takes remote value. In any other case, the local queue will be used. @@ -308,7 +308,54 @@ response will be: } ``` -TODO: add notes about worker mode and healthcheck +### Worker mode + +The worker mode can be used in cooperation with the [remote server mode](#remote-mojang-uuids-provider) +to exchange Mojang usernames to UUIDs. This mode by itself doesn't solve the problem of +[extremely strict limits](https://github.com/elyby/chrly/issues/10) on the number of requests to the Mojang's API. +But with a proxying load balancer (e.g. HAProxy, Nginx, etc.) it's easy to build a cluster of workers, +which will multiply the bandwidth of the exchanging usernames to its UUIDs. + +The instructions for setting up a proxy load balancer are outside the context of this documentation, +but you get the idea ;) + +#### `GET /api/worker/mojang-uuid/{username}` + +Performs [batch usernames exchange to UUIDs](https://github.com/elyby/chrly/issues/1) and returns the result in the +[same format as it returns from the Mojang's API](https://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time): + +```json +{ + "id": "3e3ee6c35afa48abb61e8cd8c42fc0d9", + "name": "ErickSkrauch" +} +``` + +> **Note**: the results aren't cached. + +### Health check + +#### `GET /healthcheck` + +This endpoint can be used to programmatically check the status of the server. +If all internal checks are successful, the server will return `200` status code with the following body: + +```json +{ + "status": "OK" +} +``` + +If any of the checks fails, the server will return `503` status code with the following body: + +```json +{ + "status": "Service Unavailable", + "errors": { + "mojang-batch-uuids-provider-queue-length": "the maximum number of tasks in the queue has been exceeded" + } +} +``` ## Development