You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-20Lines changed: 15 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,21 +18,29 @@ This project name aged badly, trans rights are human rights!
18
18
### Hedwig configuration:
19
19
20
20
Please reference `config.sample.yaml` for which settings can be set. The configuration file needs to be named `config.yaml`
21
-
The `fcm_service_account_token_path` setting needs to point to an FCM service account token json file.
21
+
The `fcm_service_account_token_path` setting needs to point to an FCM service account token json file.
22
22
The `fcm_push_max_retries` setting specifies how many attempts at pushing a notification to a device should be made before giving up and reporting the push key as dead.
23
23
24
24
To output to stdout instead of files, remove the `file_output` section from the `config.yaml` file.
25
25
26
+
Hedwig can also be configured with 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.
27
+
28
+
### Kubernetes
29
+
30
+
Hedwig can be easily deployed to a k8s cluster during development using the provided k8s manifests, `kustomize`, and `tilt`. If you have these tools installed, deploying a dev instance is as simple as running `tilt up`. Please see the `Tiltfile` for tilt configuration and the `deploy/` folder for manifests and the `kustomization.yaml`.
31
+
32
+
To run successfully, you will need a google API service account key for use with FCM. Place your key in the `deploy/` folder and name it `fcm-auth.json`. If you need to adjust the location or name of the key, please ensure your changes are reflected in the manifests and `kustomization.yaml`.
33
+
26
34
### On app side:
27
35
28
-
Example valid pusher set request (to homeserver, the homeserver will then talk to hedwig whenever there is a notification):
36
+
Example valid pusher set request (to homeserver, the homeserver will then talk to hedwig whenever there is a notification):
29
37
*`/_matrix/client/v3/pushers/set`:
30
-
```json
38
+
```json
31
39
{
32
40
"app_display_name": "Aweseome matrix client!",
33
41
34
42
// Deprecated: {APP_ID}.data_message is equivalent to setting data-message: "android" in data (keep app_id in hedwig config without the .data_message); This is due to removal, do not rely on it staying around!
35
-
"app_id": "app.id.from.cfg",
43
+
"app_id": "app.id.from.cfg",
36
44
"append": false,
37
45
"data": {
38
46
"format": "event_id_only",
@@ -56,7 +64,7 @@ This will result in an FCM notification being sent to the device with the notifi
@@ -132,22 +140,9 @@ This will result in an FCM notification being sent to the device with the notifi
132
140
}
133
141
```
134
142
143
+
## Lints & Formatting
135
144
136
-
## Lints
137
-
138
-
We have plenty of lints in `lints.toml` that we use. Cargo currently does not natively support an extra file for lints, so we use `cargo-lints`. To check everything with our lints, run this locally:
A few lints are commented out in `lints.toml`. This is because they should not be enabled by default, because e.g. they have false positives. However, they can be very useful sometimes.
145
+
We enforce a set of strict lints across the project, these can be found in `Cargo.toml`. We additionally enforce formatting using rustfmt, see `rustfmt.toml` for information. Please see the #[Pre-commit usage section](#pre-commit-usage) for details on setting up pre-commit hooks to automate checks to ensure the lints and formatting pass prior to pushing.
0 commit comments