From 1332b2c2b4e1eddd8722960fb2ceeb88c1f82416 Mon Sep 17 00:00:00 2001 From: erebion Date: Tue, 6 Jan 2026 20:47:50 +0100 Subject: [PATCH] document this a bit --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ef48c9..306ee59 100644 --- a/README.md +++ b/README.md @@ -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