Updated documentation

This commit is contained in:
Pünkösd Marcell 2020-05-14 22:26:14 +02:00
parent f01001d331
commit 16bdd3c22c
3 changed files with 22 additions and 18 deletions

View File

@ -55,9 +55,10 @@ Called URL::
Body::
{
"uuid" : "str: LOCAL_UUID"
}
{
"uuid" : "str: LOCAL_UUID",
"ip" : "str: optional: IP override"
}
IP update

4
app.py
View File

@ -50,9 +50,9 @@ def main():
logging.basicConfig(filename='', level=logging.DEBUG)
redis_storage = RedisSuperStorage(os.environ.get('REDIS_URL', "redis://localhost:6379/0"),
os.environ.get("CUSTOMER_TIMEOUT", 30))
int(os.environ.get("CUSTOMER_TIMEOUT", 30)))
consumer_communicator = ConsumerCommunicator(redis_storage)
consumer_communicator = ConsumerCommunicator(redis_storage, bool(os.environ.get('FORCE_IP_OVERRIDE', False)))
producer_communicator = ProducerCommunicator(redis_storage)
ip_watchdog = IPWatchdog(redis_storage)

View File

@ -4,16 +4,19 @@ Configuration
This software component can be configured via environmental variables, which are very useful in a containerized environment.
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable | Default | Description |
+====================+==========================+=====================================================================================================================================================================+
| `LOCAL_UUID` | **N/A** | The UUID of the consumer system. Must be the same as the API's |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `RUN_INTERVAL` | 10 | Interval between synchronizations, and local ip checks. |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `CUSTOMER_TIMEOUT` | 30 | Default timeout to be set for a consumer. If the timeout expires, the consumer will be considered invalid, and no further attempts will be made to contact with it. |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `REDIS_URL` | redis://localhost:6379/0 | URL of the Redis database shared with the consumer api |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `INITIAL_SERVERS` | **N/A** | A comma separated list of the initially known consumers (Can be empty, but must be specified) |
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable | Default | Description |
+=====================+==========================+====================================================================================================================================================================================================+
| `LOCAL_UUID` | **N/A** | The UUID of the consumer system. Must be the same as the API's |
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `RUN_INTERVAL` | 10 | Interval between synchronizations, and local ip checks. |
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `CUSTOMER_TIMEOUT` | 30 | Default timeout to be set for a consumer. If the timeout expires, the consumer will be considered invalid, and no further attempts will be made to contact with it. |
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `REDIS_URL` | redis://localhost:6379/0 | URL of the Redis database shared with the consumer api |
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `INITIAL_SERVERS` | **N/A** | A comma separated list of the initially known consumers (Can be empty, but must be specified) |
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `FORCE_IP_OVERRIDE` | False | Include the ip address of the consumer into the sync message, causing the other consumer to save this ip address instead of the one it recieved the request from (Useful for weird netowrk setups) |
+---------------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+