|
|
|
@ -1,7 +1,10 @@ |
|
|
|
|
# Backgruond |
|
|
|
|
# Background |
|
|
|
|
|
|
|
|
|
This component serves allowed list of keyfob UID hashes from MongoDB and |
|
|
|
|
pushes open door commands to door controllers. |
|
|
|
|
We run three instances `replica{1..3}.doorboy.infra.k-space.ee` for high availability. |
|
|
|
|
To connect from door controllers use round robin record `doorboy.infra.k-space.ee` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Testing endpoints |
|
|
|
|
|
|
|
|
@ -14,8 +17,7 @@ curl -f http://doorboy.infra.k-space.ee:5000/allowed -H "KEY: $DOORBOY_SECRET" | |
|
|
|
|
|
|
|
|
|
# Test scenarios |
|
|
|
|
|
|
|
|
|
When updating doorboy proxy, members site or kdoorpi. |
|
|
|
|
Verify follwing: |
|
|
|
|
When updating doorboy proxy, members site or kdoorpi verify follwing: |
|
|
|
|
|
|
|
|
|
* Swiping unknown card shows up as unknown, it can be claimed on members site and it immediately can be used after claiming |
|
|
|
|
* Card enable/disable on members site works and has effect |
|
|
|
@ -27,8 +29,22 @@ When testing changes prefer using the *back* door and |
|
|
|
|
use a brick or something to keep it open to prevent |
|
|
|
|
interfering with other members entering and exiting. |
|
|
|
|
|
|
|
|
|
# Development |
|
|
|
|
|
|
|
|
|
The easiest is to obtain VM from Proxmox cluster with public IP address. |
|
|
|
|
To run development instance: |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
docker-compose -f docker-compose.dev.yml up --build |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
On kdoorpi override `KDOORPI_API_ALLOWED`, `KDOORPI_API_LONGPOLL` environment variables |
|
|
|
|
to redirect requests to your dev instance. |
|
|
|
|
|
|
|
|
|
# Deploying |
|
|
|
|
|
|
|
|
|
To deploy in prod adjust `DOORBOY_SECRET`, `MONGO_URI` in `.env` and proceed to launch: |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
docker build -t 172.20.40.1:5000/doorboy:latest . |
|
|
|
|
docker push 172.20.40.1:5000/doorboy:latest |
|
|
|
|