Only the push relay
Your own push address on your own hostname. Hosted apps and everything else keep working.
- One Go binary, or one Docker image
- The bundled community key covers the stock app — no Apple account needed
- About 15 minutes
Pick the option that matches what you want to control. The three are independent — you can start with one and add another later, and your web app never changes.
Your own push address on your own hostname. Hosted apps and everything else keep working.
A private app market: app identity, strong offline packages, and the native actions you declare.
Fully off the hosted services: your own push and your own app market, on one host or split across two.
Pick the runtime that matches your machine. The contract is identical either way, so you can move between them later.
| Shape | Stack | Best for | Needs a server? |
|---|---|---|---|
| Go binary + systemd | Go 1.23, static, 6 MB, push + gateway | Any machine — recommended for new deployments | Yes, one |
| Go binary + Docker | Same binary, scratch image | You want Compose but no dependencies | Yes, one |
| Cloudflare Worker | Workers + Durable Objects | Push only — no server at all | Only for the gateway |
/api/v1/gateway and /api/v1/html-apps are built in. The former Swift container was removed on 2026-11-28. A Cloudflare Worker can still host the push half — see infra/cloudflare/drel-api-proxy/.
# Prepare everything in one step: the signing key, the env file, # the exact start command and the verification command bash tools/prepare-drel-deployment.sh both --domain push.example.com
Self-hosting raises the question of which secret sits on which side. The short answer: every private key is generated once and stays where it was created. Nothing in the handshake below sends a private key over the wire.
.p8 never leaves your relay. The Ed25519 private key never leaves your gateway. The pairing ticket is single use and short lived. The relay stores only your public encryption key.| Fact | Consequence |
|---|---|
| Go serves both relay and gateway | The Go binary includes /api/v1/html-apps and /api/v1/gateway. A separate server is not required. |
| Go serves both roles from one process | Option C on one host uses one Go process. Split it only when different teams own the two jobs. |
You get an address like https://push.example.com/ that works in any Bark-compatible script. Keep the stock Drel app and pair it with your relay: notifications travel from your relay straight to Apple and never pass through the official push service. Hosted apps and the hosted gateway stay as they are.
# Build the static Linux binary on a development machine bash tools/build-drel-selfhosted-native.sh scp Server/native/dist/drel-selfhosted root@server:/usr/local/bin/ scp Server/native/drel-selfhosted.service root@server:/etc/systemd/system/ # /etc/drel-selfhosted/drel-selfhosted.env DREL_LISTEN_ADDR=127.0.0.1:8080 DREL_SELF_HOSTED_PUBLIC_BASE_URL=https://push.example.com DREL_DATA_DIR=/var/lib/drel-selfhosted APNS_ENVIRONMENT=production APNS_TOPIC=com.webbridgekit.superapp APNS_KEY_ID=4M53447M36 APNS_TEAM_ID=B45VZCNYU3 APNS_KEY_PATH=/etc/drel-selfhosted/secrets/AuthKey_4M53447M36.p8 # copy Server/community-apns/AuthKey_4M53447M36.p8 there, mode 0640 systemctl daemon-reload && systemctl enable --now drel-selfhosted curl https://push.example.com/health # apnsReady must be true
127.0.0.1 only, so you never open port 443 or 8080 to the internet. If the host already runs a reverse proxy, forward its public HTTPS traffic to http://127.0.0.1:8080.
Server/community-apns/AuthKey_4M53447M36.p8 is registered to the stock Drel app only and to the production environment only, so it reaches TestFlight and App Store builds but no other app and no debug build. Whoever runs your relay can send notifications to the devices that paired with it — nothing more. The key can be revoked at any time. Running your own signed Drel build? Its bundle ID is yours, so create your own topic-specific .p8. Without a valid key the relay reports apnsReady: false and refuses pairing, which is the correct behaviour.
You keep using any compatible push relay, but you control app identity, strong offline packages and native action declarations. The phone then trusts only the manifests you signed.
# Generate the signing key
openssl genpkey -algorithm ed25519 -out gateway-ed25519.pem
openssl pkey -in gateway-ed25519.pem -outform DER 2>/dev/null \
| tail -c 32 | base64 | tr '+/' '-_' | tr -d '='
# -> GATEWAY_PRIVATE_KEY
bash tools/prepare-drel-deployment.sh gateway --domain hub.example.com
# Copy build/deployment/drel.env and the generated key seed to your Go service.
curl https://hub.example.com/api/v1/gateway
# -> { "publicKeyId": "gw-2026-10-23", "publicKey": "..." }
Register an app, then import the gateway on the phone. The client verifies the health endpoint, the response origin, every manifest, the origin restrictions, the key id and the signature — and saves nothing until you confirm.
Because the Go service registers the gateway routes and push routes together, this is one process with one hostname.
bash tools/prepare-drel-deployment.sh both --domain hub.example.com # Fill build/deployment/drel.env, install the Go binary, then start it with # the generated gateway and APNs settings.
That one hostname then serves the push address, the app manifests and the health check. The optional Node admin console adds a graphical push console at /admin-push with a device list.
A separated deployment runs the Go gateway on one host and the Go relay for push on another. The phone imports each address separately, so an outage in one does not affect the other. Use this when different teams own the two jobs.
For each deployment, open Drel → Settings and import the address. The client validates it and shows a report before anything is saved.
| What you deployed | Where to import it | What you get |
|---|---|---|
| Option A | Settings → Self-hosted push | A push address on your own hostname |
| Option B | Settings → Gateway | Your own signed app list |
| Option C | Both screens | Two independent trust relationships |
The Drel skill includes the full deployment procedure — the environment variables, the compose files, the pairing flow and the safety boundaries.
npx skills add dyyz1993/Drel --skill drel-app-development
Then tell the agent which option you want, for example “help me deploy option C on one host”. Read the skill page for the manual import path.
| Material | Allows | Does not allow |
|---|---|---|
| Device push address | Alert that one Drel installation | Read message history, fetch an APNs token, or reach the phone |
| Topic-scoped APNs signer | Authenticate delivery for one bundle | Read notifications or address arbitrary apps |
| iPhone private key | Decrypt encrypted envelopes on that device | Send APNs notifications or be exported by the server |
Never publish the APNs .p8. A gateway configuration carries public endpoints and a public key only — never an APNs token, device key, API secret, admin token or password.