The offline gateway
A small program at the venue keeps the doors working when the internet does not. It decides with the same rules as the cloud, and tells the cloud everything it decided once the connection is back.
How you set it up
- Create a key for the gateway A service key that holds only the gateway permission. It never leaves the venue.
- Run the gateway at the venue Tell it the cloud address, the key, your project, and which local reader belongs to which area. It is one program with no database.
- It keeps a signed bundle Every minute it fetches everyone who could pass, with their public keys and rules, signed by your project and good for 14 days by default. It saves it to disk and checks the signature again on every start.
- Readers ask the gateway The request and the answer are the same as the cloud’s, so a reader only needs another address. Online or offline, the gateway answers; offline it decides alone and reports every decision when the connection returns.
What you can change
- How long a bundle lasts From one hour to thirty days, fourteen by default. When it runs out the gateway says it is unavailable instead of guessing, so a reader can fall back.
- How often it checks in Shorter means a removed person stops passing sooner. A minute is the default.
- One secret per reader Each reader on the venue’s network has its own secret and stands for one area. Keep that network your own.
- The same rules Hours, areas, entry limits, passing-back and single-use codes all apply, and an area the bundle does not know opens for no one.
- Reports that count Each decision reaches the log at the time it was made, marked with the gateway’s name, and each entry counts towards the person’s limit. A report sent twice counts once.
- Survives a restart The bundle and the decisions not yet reported are kept on disk, so a power cut during an outage loses nothing.
Good to know
Know the trade-off: someone you remove keeps passing at an offline gateway until its next sync. Keep the sync short and the bundle’s life as short as an outage allows.