Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
497353b
Add the push relay
MrAlders0n Nov 18, 2026
0f1e9b1
Tighten abuse controls in the relay
MrAlders0n Nov 18, 2026
28a1c6e
Make the test harness's address counter safe for concurrent requests
MrAlders0n Nov 18, 2026
7680a8c
fix: refuse more non-public IPv6 ranges in the domain check
MrAlders0n Nov 18, 2026
9b1aaf9
fix: tighten token, TTL, body size and revoked-handle checks
MrAlders0n Nov 18, 2026
3e9b716
fix: keep FCM status, error code and Retry-After in send errors
MrAlders0n Nov 18, 2026
97b008e
fix: send batches concurrently with reserved quota and idempotency keys
MrAlders0n Nov 18, 2026
4dda3fe
docs: describe send ids, retry waits and the new limits
MrAlders0n Nov 18, 2026
094afe8
fix: bound each FCM send and share a failed token refresh
MrAlders0n Nov 18, 2026
9e18a94
fix: answer sent ids first, apply quota changes mid-batch and back of…
MrAlders0n Nov 18, 2026
9f145c2
docs: describe send replay, throttle cooldown and outage backoff
MrAlders0n Nov 18, 2026
88ae359
fix: keep FCM pauses and cooldowns through mixed results and recover …
MrAlders0n Nov 18, 2026
2dd4088
docs: describe FCM wait caps and device cooldowns
MrAlders0n Nov 18, 2026
ce9834b
fix: release abandoned pending sends after the pending timeout
MrAlders0n Nov 18, 2026
246ae3f
docs: list the handle errors and per-address limits
MrAlders0n Nov 18, 2026
198cc27
Share push errors across providers and pause each provider on its own
MrAlders0n Nov 18, 2026
06aba3a
Store a token and APNs environment per handle
MrAlders0n Nov 18, 2026
77671b9
Send iOS notifications straight to APNs
MrAlders0n Nov 18, 2026
17fd93a
docs: APNs for iOS, token and apnsEnvironment fields
MrAlders0n Nov 18, 2026
84d0b12
Revoke a handle only if it is still the registration that was sent to
MrAlders0n Nov 18, 2026
b2bc744
Treat APNs IdleTimeout as a retryable failure
MrAlders0n Nov 18, 2026
02442d0
Add admin delete to remove a server for good
MrAlders0n Nov 19, 2026
0ee3a6b
Explain the domain check and tier limits on the register pages
MrAlders0n Nov 19, 2026
2fc90d3
Ask for hosting support on the home page
MrAlders0n Nov 19, 2026
f95827f
Self-host the page fonts and serve the Beacon favicon
MrAlders0n Nov 19, 2026
2d52cba
Redesign the relay pages and trim the copy
MrAlders0n Nov 19, 2026
653be12
Fix the push providers in the privacy notice, drop draft labels
MrAlders0n Nov 19, 2026
db71ce0
Make the Ko-fi support block stand out
MrAlders0n Nov 19, 2026
19a05c2
Add a self-serve manage page for a new secret or removing a server
MrAlders0n Nov 19, 2026
da060fb
Show usage on the manage page and clarify the remove wording
MrAlders0n Nov 19, 2026
5c62090
Redesign the manage page around a usage meter
MrAlders0n Nov 19, 2026
374c113
Give manage its own button on the home page
MrAlders0n Nov 19, 2026
018615d
Keep the home buttons the same width when they wrap
MrAlders0n Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2026 Beacon Contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

FROM golang:1.26-alpine AS builder
ARG VERSION=dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o beacon-push ./cmd/beacon-push

FROM alpine:3.24
RUN apk add --no-cache ca-certificates tzdata \
&& addgroup -S -g 10001 push && adduser -S -D -H -u 10001 -G push push \
&& mkdir -p /data && chown push:push /data
COPY --from=builder /app/beacon-push /usr/local/bin/beacon-push
USER push
VOLUME /data
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s CMD ["beacon-push", "healthcheck"]
CMD ["beacon-push"]
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.github
.claude
docs/superpowers
*.db
*.db-*
.env
.env.*
*.p8
35 changes: 35 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# beacon-push settings. Copy to .env next to the compose file; never commit the real one.

# Where operators and the app reach the relay. Every mailed link is built from it.
PUSH_PUBLIC_URL=https://push.meshcorebeacon.ca

# Listen address inside the container, and the SQLite file (keep /data on a volume and back it up).
# PUSH_LISTEN_ADDR=:8080
# PUSH_DATABASE_PATH=/data/beacon-push.db

# In-container path of the Firebase service-account key file, for Android (mount it read-only).
PUSH_FIREBASE_CREDENTIALS=/run/secrets/firebase.json

# APNs auth key for iOS: in-container path of the .p8 file (mount it read-only), its 10-character key ID,
# the Apple team ID and the app's bundle ID.
PUSH_APNS_KEY=/run/secrets/apns.p8
PUSH_APNS_KEY_ID=
PUSH_APNS_TEAM_ID=
PUSH_APNS_TOPIC=meshcorebeacon.app

# Outgoing mail for registration links and admin notices.
PUSH_SMTP_HOST=
# PUSH_SMTP_PORT=587
PUSH_SMTP_USERNAME=
PUSH_SMTP_PASSWORD=
PUSH_SMTP_FROM="Beacon Push <noreply@meshcorebeacon.ca>"
# PUSH_SMTP_STARTTLS=true

# Gets a mail for every new server, automatic suspensions and lost domain verifications. Empty sends none.
PUSH_ADMIN_EMAIL=abuse@meshcorebeacon.ca

# True behind Caddy: the client address is taken from the last X-Forwarded-For entry.
PUSH_TRUST_PROXY=true

# Logs mail and pushes instead of sending them, and lets the domain check reach local addresses. Never in production.
# PUSH_DEV_MODE=false
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2026 Beacon Contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: CI

on:
push:
branches: [main, dev]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build
run: go build ./...

- name: Format check
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "The following files are not formatted:"
gofmt -l .
exit 1
fi

- name: Vet
run: go vet ./...

- name: Test
run: go test -race ./...
61 changes: 61 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2026 Beacon Contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

name: Build and Publish Docker Image

on:
push:
branches: [main, dev]
tags: ["v*"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.title=beacon-push
org.opencontainers.image.description=Beacon push relay: delivers alerts from self-hosted Beacon servers to the Beacon app
org.opencontainers.image.licenses=AGPL-3.0-or-later
flavor: |
latest=false
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: .build/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.ref_name }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ build/
dist/
/beacon-push

# Environment and local config (Firebase key, SMTP and instance credentials)
# Environment and local config (Firebase and APNs keys, SMTP and instance credentials)
.env
.env.*
!.env.example
config.yaml
config.local.*
*-firebase-adminsdk-*.json
service-account*.json
*.p8

# Data
*.db
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ write conventional commit messages, and open the PR against `dev`.
## What the relay does

beacon-push accepts notifications from registered beacon-server instances and
forwards them to the Beacon app through Firebase Cloud Messaging. It handles
forwards them to the Beacon app through APNs (iOS) and Firebase Cloud
Messaging (Android). It handles
server registration, device handles, rate limits and abuse reports. Rule
matching and notification content belong in
[beacon-server](https://github.com/MeshCore-Beacon/beacon-server), not here.
Expand All @@ -32,7 +33,7 @@ Keep in mind when contributing:
- **The relay must not read content.** Payloads are encrypted between
beacon-server and the app. Do not add logging, parsing or storage of
payload bodies.
- **Credentials are secrets.** The Firebase key, SMTP password and instance
- **Credentials are secrets.** The Firebase and APNs keys, SMTP password and instance
secrets come from the environment, never from source, logs or responses.
Instance secrets are stored hashed.
- **Keep usage records minimal.** Log what abuse tracking needs (server, time,
Expand Down
Loading
Loading