Skip to content

Configuration

PushPort is configured entirely through environment variables, with no config file. Only two variables are required; the rest have defaults.

By default nothing is rate-limited: push, self-registration, and subscribe limits are all unlimited until you set usage plans.

Reference

Core

VariableDefaultDescription
PUSHPORT_ADDR:8080Listen address for the HTTP server.
PUSHPORT_BASE_URLhttp://localhost:8080Public base URL, baked into push endpoint URLs.
PUSHPORT_DATABASE_URIsqlite://./data/pushport.dbSQLite database URI.
PUSHPORT_ADMIN_TOKENrequiredBearer token for admin API calls and CLI management.
PUSHPORT_SECRETrequiredMaster secret: base64 of exactly 32 bytes.

Networking & Proxy

VariableDefaultDescription
PUSHPORT_CORS_ORIGINemptyComma-separated allowlist of browser origins permitted to call the API cross-origin.
PUSHPORT_CLIENT_IP_HEADERemptyHeader to read the client IP from for per-IP limits, e.g. CF-Connecting-IP. Trusted from any peer, so set it only when all traffic passes through a proxy that sets it.

Push Endpoints

VariableDefaultDescription
PUSHPORT_PUSH_ENDPOINT_TTL360h (15 days)Default lifetime of a sealed push endpoint.
PUSHPORT_MAX_PAYLOAD_BYTES3000Maximum request body size for a push send.

Endpoint TTLs requested by clients are clamped to a fixed window of 12 hours to 45 days, regardless of configuration.

Self-Registration and Subscribe Limits

These limits start at 0 (unlimited), so unless you set up a usage plan nothing throttles sign-ups or device subscribes. Retry and auth-failure limits keep their protective defaults either way.

You set them through a usage plan, either over the API (POST/PATCH /usage-plans) or with the CLI:

sh
pushport usage-plan app update <plan_id> \
  --register-per-min 10 --register-burst 5 \
  --register-ip-per-min 5 --register-ip-burst 3 \
  --subscribe-per-min 30 --subscribe-burst 15

Upstream Delivery

Retry and auth-failure limits are stored in the database and can be adjusted at runtime without restarting via PATCH /settings or the CLI:

sh
pushport settings get
pushport settings set --auth-fail-ip-per-min 5 --auth-fail-ip-burst 5 \
  --retry-max-attempts 3 --retry-base-backoff 200ms --retry-max-backoff 5s
VariableDefaultDescription
PUSHPORT_QUOTA_FLUSH_INTERVAL30sHow often quota counts flush to SQLite.

Secret Rotation

PUSHPORT_SECRET accepts a comma-separated list of 32-byte base64 keys. The first key is the primary (it seals all new data); the remaining keys are kept only to open existing blobs:

sh
# 1. generate a new key once, and store it in your secret manager
openssl rand -base64 32

# 2. rotate: new key first, current key second
export PUSHPORT_SECRET="<new-key>,<current-key>"

Restart with the new list and everything is re-sealed transparently as data is rewritten. Once you are confident no stale blobs remain, drop the old key.

Push endpoints additionally have their own per-app endpoint key with a grace window, so endpoint rotation does not require touching PUSHPORT_SECRET at all.