updating to match everything in my homelab.
This commit is contained in:
45
diagrams/ntfy-discord-bridge.mmd
Normal file
45
diagrams/ntfy-discord-bridge.mmd
Normal file
@@ -0,0 +1,45 @@
|
||||
```plaintext
|
||||
%% ntfy-Discord Bridge (ADR-0022)
|
||||
%% Sequence diagram showing message flow and transformation
|
||||
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
participant S as Notification Source<br/>(CI/Alertmanager)
|
||||
participant N as ntfy<br/>Notification Hub
|
||||
participant B as ntfy-discord<br/>Go Bridge
|
||||
participant D as Discord<br/>Webhook
|
||||
|
||||
Note over S,N: Events published to ntfy topics
|
||||
|
||||
S->>N: POST /gitea-ci<br/>{title, message, priority}
|
||||
|
||||
Note over N,B: SSE subscription for real-time
|
||||
|
||||
N-->>B: SSE JSON stream<br/>{topic, message, priority, tags}
|
||||
|
||||
Note over B: Message transformation
|
||||
|
||||
rect rgb(240, 240, 240)
|
||||
B->>B: Map priority to embed color<br/>urgent=red, high=orange<br/>default=blue, low=gray
|
||||
B->>B: Format as Discord embed<br/>{embeds: [{title, description, color}]}
|
||||
end
|
||||
|
||||
B->>D: POST webhook URL<br/>Discord embed format
|
||||
|
||||
Note over B: Hot-reload support
|
||||
|
||||
rect rgb(230, 245, 230)
|
||||
B->>B: fsnotify watches secrets
|
||||
B->>B: Reload config without restart
|
||||
end
|
||||
|
||||
Note over B,D: Retry with exponential backoff
|
||||
|
||||
alt Webhook fails
|
||||
B-->>B: Retry (2s, 4s, 8s...)
|
||||
B->>D: Retry POST
|
||||
end
|
||||
|
||||
D-->>D: Display in channel
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user