Skip to content

Make VAPID subject configurable via MESHCORE_VAPID_SUBJECT (fixes iOS/Safari push)#289

Merged
jkingsman merged 1 commit into
jkingsman:mainfrom
ervwalter:fix/configurable-vapid-subject
Jun 16, 2026
Merged

Make VAPID subject configurable via MESHCORE_VAPID_SUBJECT (fixes iOS/Safari push)#289
jkingsman merged 1 commit into
jkingsman:mainfrom
ervwalter:fix/configurable-vapid-subject

Conversation

@ervwalter

Copy link
Copy Markdown
Contributor

What & why
iOS/Safari Web Push silently fails: the hard-coded VAPID sub mailto:noreply@meshcore.local is rejected by Apple's APNs with 403 BadJwtToken (.local is a reserved TLD). FCM accepts it, so only Apple devices are affected.

Verified against a live iOS subscription:

sub = mailto:noreply@meshcore.local  -> 403 BadJwtToken
sub = mailto:noreply@example.com     -> 201 Created

Change

  • Add MESHCORE_VAPID_SUBJECT (app/config.py); default unchanged (mailto:noreply@meshcore.local) — purely additive, no behavior change unless set.
  • Centralize claim construction in get_vapid_claims() (app/push/vapid.py), used by both dispatch (manager.py) and the test endpoint (routers/push.py).
  • Tests: default preserved + override honored.
  • Docs: README env table, root & app AGENTS.md, docker-compose.example.yml.

Testing
./scripts/quality/all_quality.sh passes (backend 1541 + frontend 783 tests, lint, typecheck, build).

Notes / follow-ups

Closes #288

iOS/Safari (Apple APNs) rejects the hard-coded mailto:noreply@meshcore.local VAPID subject with 403 BadJwtToken because .local is a reserved TLD; FCM accepts it, so only Apple devices were affected. Add MESHCORE_VAPID_SUBJECT (default unchanged) resolved via a new get_vapid_claims() in app/push/vapid.py, used by both dispatch and the test-notification endpoint.

Closes jkingsman#288
@ervwalter ervwalter force-pushed the fix/configurable-vapid-subject branch from 395b501 to 1243d01 Compare June 16, 2026 18:30
@jkingsman

Copy link
Copy Markdown
Owner

Fascinating issue; thanks for the fix!

@jkingsman jkingsman merged commit 6efc5f0 into jkingsman:main Jun 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS/Safari Web Push fails: APNs rejects hard-coded VAPID sub (.local)

2 participants