Doorboy proxy exports door access information from MongoDB to door Raspberry Pi controllers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.7 KiB

# 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}` for high availability.
To connect from door controllers use round robin record ``
# Testing endpoints
For manually testing something like this might help:
source .env
curl -f -H "KEY: $DOORBOY_SECRET" | md5sum
# Test scenarios
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
* Opening door via buttons at works and has effect
* Opening door via `/open-ground-door`, `/open-front-door` and `/open-back-door` commands in Slack channel #members works
* TODO: Keep door open via members site works and has effect
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 up --build
On kdoorpi override `KDOORPI_API_ALLOWED`, `KDOORPI_API_LONGPOLL` environment variables
to redirect requests to your dev instance.
# Deploying
Images are built and pushed to Docker Hub by Jenkins.
To deploy in prod adjust `DOORBOY_SECRET`, `MONGO_URI` in `.env` and proceed to launch:
overnode pull
overnode up