document this a bit

This commit is contained in:
erebion 2026-01-06 20:47:50 +01:00
commit 1332b2c2b4

View file

@ -4,6 +4,8 @@ Simple Ansible Playbooks that demonstrate how zuginfo.nrw's API can be used to s
## How to Use
### Creating an account
Run the Playbooks using Ansible:
```
@ -11,4 +13,54 @@ cd zuginfo_playbooks
ansible-playbook zuginfo_api_create_account.yml
```
(Do the same for the other playbooks)
Save the values to `files/account.txt` before you continue.
Example:
```yaml
account:
aid: "12345"
mysterious_id: "12345"
```
### Create Subscription to your WebPush Endpoint
Amend `files/account.txt`:
```yaml
account:
aid: "12345"
mysterious_id: "12345"
push_endpoint: "https://example.org/up/push/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
push_key_auth: "auth_secret"
push_key_p256dh: "auth_key"
```
Run the Playbook:
```
ansible-playbook zuginfo_api_create_webpush_subscription.yml
```
This will return `user_id` and `channel_id`. Amend `files/account.txt`.
```yaml
account:
aid: "12345"
mysterious_id: "12345"
push_endpoint: "https://example.org/up/push/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
push_key_auth: "auth_secret"
push_key_p256dh: "auth_key"
user_id: "12345"
channel_id: "12345"
```
### Subscribing to a specific railway line
to do
## Random Notes
- `user_id` seems to change when all subscriptions are deleted and a new one is added
- `channel_id` seems to change when all subscriptions are deleted and a new one is added
- subscriptions have to be deleted before an account can be deleted