A solution for connecting the Fanvil i31s (or compatible) line of door phones to LDAP for access control. Also supports the MemberMatters door controller protocol, with optional fallback to LDAP.
Required:
- python 3.9+
Suggested:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependancies
pip install -r requirements.txt
# Edit configuration template:
cp envrc.example .envrc
# Pre-commit hooks (for development)
pip install pre-commit && pre-commit install
FLASK_APP=doorman FLASK_ENV=development flask run --host=0.0.0.0# 1. Build the image:
docker build -t doorman .
# 2. Put the environment variables from envrc.example in .env
cp envrc.example .env
# 3. Edit your config to suit
# 4. Run the webserver with:
docker run -d -p 5000:80 --name=doorman --env-file=.env -v ./mm-doorman.json:/tmp/mm-doorman.json doorman:latest
# 5. For use with Member Matters, run the websocket client:
docker run -d --name=doorman_ws --env-file=.env -v ./mm-doorman.json:/tmp/mm-doorman.json doorman:latest python3 websocket_client.py- In the MemberMatters Django Admin (
/adminURL), navigate to Access > API Key for Access Controlled Devices, and click Add. - Give your connector an unique name less than 50 characters. Set that same name for
DOORMAN_MM_DEVICE_NAMEvariable for doorman. - Optionally set an expiration date for the key. Click Save.
- The API key will be flashed at the top of the screen in an orange box. Use that value for
DOORMAN_MM_API_KEY.
- Run
websocket_client.py. Doorman will try to register with the server, but the server will disconnect the connector until it is authorized. - In the Django Admin, click on Access > Doors, then click
New Device (doorman)(the value in perens will matchDOORMAN_MM_DEVICE_NAMEfrom earlier). - Check
Is this device authorised to access the system?, and set any of the option checkboxes according to your setup, and click Save.
