Skip to content

Commit d7c89b0

Browse files
feat: add direct APNS support
1 parent 9f62ac8 commit d7c89b0

32 files changed

+1055
-195
lines changed

.github/workflows/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: "Docker"
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
tags: [ "*" ]
5+
branches: ["main"]
6+
tags: ["*"]
77

88
jobs:
99
build:
10-
uses: famedly/backend-build-workflows/.github/workflows/docker-backend.yml@main
10+
uses: famedly/backend-build-workflows/.github/workflows/docker-backend.yml@v2
1111
secrets: inherit
1212
with:
1313
name: hedwig

Cargo.lock

Lines changed: 172 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "matrix-hedwig"
3-
version = "2.0.0"
3+
version = "2.2.0"
44
authors = [
55
"Christian Pauly <c.pauly@famedly.com>",
66
"Kateřina Churanová <k.churanova@famedly.com>",
@@ -10,6 +10,7 @@ publish = false
1010
edition = "2021"
1111

1212
[dependencies]
13+
a2 = { version = "0.10.0", git = "https://github.com/famedly/a2.git", branch = "thomast/owned-struct-params" }
1314
async-trait = "0.1.89"
1415
axum = { version = "0.8.6", features = ["macros"] }
1516
axum-tracing-opentelemetry = "0.32.1"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This project name aged badly, trans rights are human rights!
2020
Multiple configuration files must be setup :
2121

2222
- `config.yaml` (from `config.sample.yaml`) for hedwig's config
23-
- authentication against GCP is done with `gcp_auth`, you need to setup one of the 4 authentication methods listed [here](https://github.com/djc/gcp_auth/blob/5a1e48db47784c9afdbad38a33907cb2e98bbfdd/README.md)
23+
- authentication against GCP is done with `gcp_auth`, you need to setup one of the 4 authentication methods listed [here](https://github.com/djc/gcp_auth/blob/5a1e48db47784c9afdbad38a33907cb2e98bbfdd/README.md). The setting value `fcm_credentials_file_path` will be set as the env var `GOOGLE_APPLICATION_CREDENTIALS`
2424

2525
Hedwig's config `config.yaml` can be replaced by environment variables, which is used for the local kubernetes development setup. All variables are namespaced under `PUSHGW`, with a double underscore (`__`) being the separator between the prefix and all keys. As an example, `server.bind_address` would be represented as `PUSHGW__SERVER__BIND_ADDRESS`. See `deploy/config.properties.sample` for an example configuration.
2626

config.sample.yaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,23 @@ server:
1313
hedwig:
1414
app_id: "org.matrix.awesome_client"
1515
# specifies how many attempts at pushing a notification to a device should be made before giving up and reporting the push key as dead
16-
fcm_push_max_retries: 5
17-
fcm_notification_click_action: "FLUTTER_NOTIFICATION_CLICK"
18-
fcm_notification_title: "<count> unread rooms"
19-
fcm_notification_body: "Open app to read the messages"
20-
fcm_notification_sound: "default"
21-
fcm_notification_icon: "notifications_icon"
22-
fcm_notification_tag: "org.matrix.default_notification"
16+
push_max_retries: 5
17+
notification_click_action: "FLUTTER_NOTIFICATION_CLICK"
18+
notification_title: "<count> unread rooms"
19+
notification_body: "Open app to read the messages"
20+
notification_sound: "default"
21+
notification_icon: "notifications_icon"
22+
notification_tag: "org.matrix.default_notification"
2323
fcm_notification_android_channel_id: "org.matrix.app.message"
2424
# https://developer.apple.com/documentation/usernotifications/sending-notification-requests-to-apns#Know-when-to-use-push-types
25-
fcm_apns_push_type: background
25+
apns_push_type: background
26+
apns_topic: app.bundle.id
27+
# leave blank if you don't want to use APNS directly
28+
apns_key_file_path: "path/to/apns_key.p8"
29+
fcm_credentials_file_path: "/path/to/fcm_credentials.json"
30+
apns_team_id: "YOUR_TEAM_ID"
31+
apns_key_id: "YOUR_KEY_ID"
32+
apns_sandbox: true
2633
notification_request_body_size_limit: 15000
2734

2835
# these are sample configuration options for the telemetry

0 commit comments

Comments
 (0)