{"id":19260605,"url":"https://github.com/evant/webpush-fcm-relay","last_synced_at":"2026-03-07T22:32:40.734Z","repository":{"id":236685878,"uuid":"792976882","full_name":"evant/webpush-fcm-relay","owner":"evant","description":"Relays WebPush messages to Firebase Cloud Messaging","archived":false,"fork":false,"pushed_at":"2024-09-15T17:38:07.000Z","size":637,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T16:42:08.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-28T04:40:13.000Z","updated_at":"2024-09-15T17:38:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"4619bde7-4718-43ae-9d8d-d35f912ca6b4","html_url":"https://github.com/evant/webpush-fcm-relay","commit_stats":null,"previous_names":["evant/webpush-fcm-relay"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/evant/webpush-fcm-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fwebpush-fcm-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fwebpush-fcm-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fwebpush-fcm-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fwebpush-fcm-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evant","download_url":"https://codeload.github.com/evant/webpush-fcm-relay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fwebpush-fcm-relay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30234648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T19:22:00.066Z","updated_at":"2026-03-07T22:32:40.699Z","avatar_url":"https://github.com/evant.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpush-fcm-relay\n\nRelays WebPush messages through firebase to allow them to be received by mobile applications. This was built for my\n[Mastodon](https://joinmastodon.org/) client but is pretty general.\n\n## Features\n\n- Supports both [rfc8291](https://datatracker.ietf.org/doc/html/rfc8291) and the\n  [draft rfc](https://datatracker.ietf.org/doc/html/draft-ietf-webpush-encryption-04) encryption standards.\n- Supports multiple client applications.\n- Includes a client android library for easy setup.\n\n## Server Setup\n\nYour first step should be to figure out you are authenticating with Firebase. If you aren't familiar with the process\nyou can follow along [here](docs/google-authentication.md). For the rest of this section we'll assume you have a service\naccount key json saved in `./credentials/firebase-key.json`\n\n### Running the jar directly\n\nYou can download the [jar](https://github.com/evant/webpush-fcm-relay/releases/download/server-1.0.0/webpush-fcm-relay.jar)\nand run directly. This requires java 21+.\n\n```shell\njava -jar webpush-fcm-relay.jar -port=8080 -P:firebase.auth.credentialsDir=./credentials\n```\n\n### Running with docker/podman\n\nImages are published to [dockerhub](https://hub.docker.com/r/etatarka/webpush-fcm-relay).\n\n```shell\ndocker run -p 8080:8080 -v ./credentials:/credentials:ro docker.io/etatarka/webpush-fcm-relay:latest -port=8080 -P:firebase.auth.credentialsDir=./credentials\n```\n\n### Running with docker/podman-compose\n\nThere's a [docker-compose.yaml](/docker-compose.yaml) file in this repo that you can use as an example.\n\n```shell\ndocker-compose up\n```\n\n### Arguments\n\nAll methods take the same arguments:\n- `-port=` (required) sets the port the server is run on\n- `-host=0.0.0.0` sets the host address the server is run on\n- `-P:firebase.auth.credentialsDir=` sets the directory to looks for firebase credentials, multiple credentials with\n  different project-id's are allowed in that directory.\n\nIn addition, the following jvm arguments can be set:\n- `-Dlog.level=INFO` set the level of logging. The default is very conservative, setting this to at least DEBUG will\n  cause requests to be logged.\n\nNote: As the server will require https to handle web pushes properly, you'll want to set up a reverse proxy and\nssl certificate. There's a lot of ways to do this, and I'd recommend starting with\n[Let's Encrypt](https://letsencrypt.org/docs/client-options/)'s clients.\n\n## Client Setup (Android)\n\nStart by setting up [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/android/client) in your\nproject. Note: I recommend skipping the `com.google.gms.google-services` plugin as it's not well maintained. Instead you\ncan create a resources file with the following values that can be found in your Firebase project's console or in the\ngoogle-services.json file you can download.\n\n```xml\n\u003cresources\u003e\n    \u003cstring name=\"google_app_id\"\u003e1:0000000000000:android:0000000000000000000000\u003c/string\u003e\n    \u003cstring name=\"project_id\"\u003eprojectid\u003c/string\u003e\n    \u003cstring name=\"google_api_key\"\u003e000000000000000000000000000000000000000\u003c/string\u003e\n\u003c/resources\u003e\n```\n\nThen add the `client-android` dependency to your `build.gradke(.kts)`\n\n```groovy\ndependencies {\n  implementation(\"me.tatarka.webpush.relay:client-android:1.0.0\")\n}\n```\n\nMake your push service extend `me.tatarka.webpush.relay.WebPushRelayService` instead of\n`com.google.firebase.messaging.FirebaseMessagingService.FirebaseMessagingService` and implement the required methods.\n\n```kotlin\nclass MyWebPushService : WebPushRelayService() {\n  override suspend fun register(path: String, publicKey: ByteString, authSecret: ByteString) {\n    // This is where you'd register with the service that's sending the web pushes. The url should be the domain of\n    // your relay server + the path given here. Ex: https://relay.example.com/ + path\n  }\n\n  override suspend fun onWebPushReceived(body: Source) {\n    // This is where you decode the body and optionally show a notification to the user.\n  }\n}\n```\n\n## Comparison to Related Projects\n\n### [mastodon/webpush-fcm-relay](https://github.com/mastodon/webpush-fcm-relay)\n\nPros:\n\n- Written in Go\n- Low memory usage\n- Very simple implementation\n\nCons:\n\n- Unclear licencing\n- Non-standard message encoding\n- Only supports pre-standard WebPush encryption\n- Only supports a single client application\n\n### [mozilla/autopush-rs](https://github.com/mozilla-services/autopush-rs)\n\nPros:\n\n- Written in Rust\n- Designed to handle millions of push messages\n- Supports all WebPush encryption standards\n- Supports multiple client applications\n\nCons:\n\n- Not well documented\n- Existing storage backends are propitiatory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Fwebpush-fcm-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevant%2Fwebpush-fcm-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Fwebpush-fcm-relay/lists"}