Repository navigation
feat(quickstart): add a webhook tunnel so webhook triggers fire locally - #2
Conversation
There was a problem hiding this comment.
Walkthrough
Adds make tunnel, tunnel-stop and ask-tunnel to the quickstart so webhook triggers can fire locally through a Cloudflare quick tunnel. Updates the READMEs and .gitignore.
| Severity | Finding | Location |
|---|---|---|
Empty trigger source fields shift the read columns |
quickstart/Makefile:299 |
Review effort: Low
Risk: Medium, exposes the local cluster API publicly
Coverage: 5 of 5 files reviewed
Where to focus
| Area | Why it needs a person |
|---|---|
quickstart/Makefile |
Confirm exposing the whole API through the tunnel is acceptable. |
Checked
README updates, root Makefile target forwarding, .gitignore.
Visual WalkthroughThe quickstart Makefile gains an optional webhook tunnel with start, stop and a prompt during Tunnel start pathThe sequenceDiagram
participant M as quickstart Makefile
participant C as cloudflared
participant K as Trigger sources
M->>M: prompt or read TUNNEL
alt answer is not yes
M-->>M: no tunnel started
else answer is yes
M->>M: stop previous tunnel
alt cloudflared not installed
M-->>M: exit with install hint
else installed
M->>C: start quick tunnel
C-->>M: tunnel URL in log
alt no URL within 30 seconds
M-->>M: exit, see log
else URL found
M->>K: list trigger sources
K-->>M: webhook path per source
alt path is empty
M-->>M: print not ready
else path is set
M-->>M: print URL and secret command
end
end
end
end
Target wiringThe flowchart TB
subgraph root [root Makefile]
Fwd[forwards quickstart targets]:::changed
end
subgraph qs [quickstart Makefile]
Up[up]:::changed
Ask[ask-tunnel]:::added
Tun[tunnel]:::added
Stop[tunnel-stop]:::added
Down[down]:::changed
end
Fwd --> Ask
Up --> Ask
Ask --> Tun
Tun --> Stop
Down --> Stop
classDef added fill:#1f883d,stroke:#1a7f37,stroke-width:2px,color:#ffffff
classDef changed fill:#bf8700,stroke:#9a6700,stroke-width:2px,color:#ffffff
classDef removed fill:#cf222e,stroke:#a40e26,stroke-width:2px,stroke-dasharray:5,color:#ffffff
classDef context fill:transparent,stroke:#8c959f,stroke-width:1px,stroke-dasharray:3,color:#8c959f
linkStyle default stroke:#8c959f,stroke-width:2px
style root fill:transparent,stroke:#8c959f
style qs fill:transparent,stroke:#8c959f
Legend: green = added, amber = changed, red = removed, dashed grey = context
|
Adds a Cloudflare quick tunnel to the quickstart so webhook triggers fire on a local cluster.
Changes
make tunnel: Starts a quick tunnel to the kora API onlocalhost:9443asapi.local.runkora.io. It prints each trigger source's webhook URL and the command that prints its signing secret. The process ID, URL and log live inquickstart/.tunnel/, which git ignores.make tunnel-stop: Stops the tunnel.make downstops it too.make up: Asks at the end whether to start a tunnel.TUNNEL=yesorTUNNEL=noskips the question, and without a terminal it starts none.Testing
make validatepasses.make tunnelstarted a tunnel on the quickstart. A GitHubpingsigned with thegithubsource's secret returned 202 through it, and the same request with a bad signature returned 404.TUNNEL=noand a run without a terminal skip the question.