blind-push-gateway-cli
v0.1.1
Published
CLI for blind-push-gateway
Readme
blind-push-gateway-cli
POC - This is a proof-of-concept still. Breaking changes possible till the V1 release.
CLI to run the blind-push-gateway service. It listens on Hyperswarm, accepts forward-push RPC requests, and forwards them through Firebase Cloud Messaging.
Uses blind-push-gateway under the hood.
Install
npm install -g blind-push-gateway-cliUsage
blind-push-gateway run [options]Create a config file at ~/.blind-push-gateway/config.json:
{
"certPath": "./service-account.json",
"notification": {
"title": "Keet",
"body": "✉️"
},
"apnsTopic": "io.keet.app"
}Then run:
blind-push-gateway runThe service logs its public key on startup. Clients can connect to that swarm key and send forward-push RPC requests.
Config
certPath: path to a Firebase service account JSON file, relative to the config file. Required unless--dry-runis set.notification: default notification payload shown to users.apnsTopic: APNS topic, defaults toio.keet.app.
Example config for dry-run / local testing:
{
"notification": {
"title": "Keet",
"body": "✉️"
},
"apnsTopic": "io.keet.app"
}blind-push-gateway run --dry-run --bootstrap '[{"host":"127.0.0.1","port":49737}]'CLI Options
--config|-c [path]: config path, defaults to~/.blind-push-gateway/config.json--storage|-s [path]: storage path, defaults to~/.blind-push-gateway/storage--dry-run: dry-run mode without Firebase; log push payloads instead of sending them--bootstrap [bootstrap]: JSON array of HyperDHT bootstrap nodes. Use this to join a testnet or a custom DHT network--scraper-public-key [scraper-public-key]: public key of a dht-prometheus scraper. Can be hex or z32.--scraper-secret [scraper-secret]: secret of the dht-prometheus scraper. Can be hex or z32.--scraper-alias [scraper-alias]: optional alias with which to register to the scraper
How It Works
- The operator starts the gateway with Firebase service account credentials (or with
--dry-run). - The gateway listens on Hyperswarm and accepts RPC connections through
protomux-rpc-router. - A client sends a
forward-pushrequest encoded withblind-push/encodings. - The gateway encodes the request, derives Android/APNS fields, and forwards the message through the configured push service.
