Skip to main content

Module server

Module server 

Source
Expand description

The push server: registrations, wake requests, and delivery through APNs, FCM and relay announcements. Run it with the weirdnet-push binary, or embed router.

It keeps per registration only: the SHA-256 of the handle (the key), the SHA-256 of the control secret, the transport (the APNs or FCM token, or “relay”), and the creation time. It never sees what a wake is about, and it logs no handles or tokens.

Structs§

Apns
An APNs sender.
ApnsConfig
APNs with token-based (.p8) authentication.
Config
The server config (TOML).
Fcm
An FCM sender.
FcmConfig
FCM HTTP v1 with a service account.
Registration
One device registration.
RelayConfig
The relay wake path: relays that follow this server get every relay-path wake and pass it on when the device with that handle is connected to them.
RelayHub
Fans relay-path wakes out to the following relays.
Service
The running service.
Store
Registrations by handle digest, in a JSON file written atomically on every change.

Functions§

router
The HTTP routes.
serve
Serves until shutdown resolves.
token_digest
The digest a relay token is listed by.