55- Docker Compose
66- A GitHub App (org or personal) — the app's webhook delivers events from every
77 repo where it's installed, so you configure the URL once
8+ - An [ ngrok] ( https://ngrok.com ) account (free tier works)
89
910## 1. Generate a webhook secret
1011
@@ -14,51 +15,54 @@ openssl rand -hex 32
1415
1516Save the output — you'll use it in both GitHub and the local stack.
1617
17- ## 2. Create a smee.io channel
18+ ## 2. Start the stack
1819
19- Go to [ smee.io] ( https://smee.io ) and click ** Start a new channel** . Copy the
20- channel URL (e.g. ` https://smee.io/abc123 ` ).
20+ ``` bash
21+ docker compose --profile dev up
22+ ```
23+
24+ This starts NATS, the webhook receiver, and ngrok. Find the public tunnel URL
25+ in the ngrok container logs:
26+
27+ ``` bash
28+ docker compose logs ngrok
29+ ```
30+
31+ Look for the ` github ` tunnel URL (e.g. ` https://abc123.ngrok-free.app ` ).
2132
2233## 3. Configure your GitHub App
2334
24351 . Go to ** Settings → Developer settings → GitHub Apps**
25362 . Select your app (or create a new one)
26373 . Under ** Webhook** :
27- - ** Webhook URL** : your smee.io channel URL
38+ - ** Webhook URL** : ` https://<ngrok-url>/webhook `
2839 - ** Webhook secret** : the secret you generated in step 1
29404 . Under ** Permissions & events** , subscribe to the events you need
30415 . Install the app on the repositories or organization you want to receive
3142 events from
3243
33- ## 4. Start the stack
34-
35- ``` bash
36- SMEE_URL=https://smee.io/abc123 \
37- GITHUB_WEBHOOK_SECRET=< secret-from-step-1> \
38- docker compose --profile dev up
39- ```
44+ ## 4. Verify
4045
41- This starts NATS, the webhook receiver, and the smee client. The smee client
42- connects to your channel and forwards events to the webhook receiver.
46+ Trigger an event in a repository where the app is installed (e.g. push a
47+ commit). You should see:
4348
44- Without ` --profile dev ` , the smee client is excluded and only the core services
45- start.
49+ - The webhook receiver log the incoming event
50+ - The event published to NATS on ` github.{event} `
4651
47- ## 5. Verify
52+ You can inspect NATS with:
4853
49- Trigger an event in a repository where the app is installed (e.g. push a
50- commit). You should see:
54+ ``` bash
55+ nats sub " github.>"
56+ ```
5157
52- - The event appear on your smee.io channel page
53- - The smee client forward it to the webhook receiver
54- - The webhook receiver publish it to NATS on ` github.{event} `
58+ Without ` --profile dev ` , ngrok is excluded and only the core services start.
5559
5660## Environment variables
5761
5862| Variable | Required | Default | Description |
5963| ---| ---| ---| ---|
6064| ` GITHUB_WEBHOOK_SECRET ` | yes | — | HMAC-SHA256 secret (must match GitHub App) |
61- | ` SMEE_URL ` | yes (dev profile) | — | smee.io channel URL |
65+ | ` NGROK_AUTHTOKEN ` | yes (dev profile) | — | ngrok auth token |
6266| ` GITHUB_WEBHOOK_PORT ` | no | ` 8080 ` | HTTP port for the webhook receiver |
6367| ` GITHUB_SUBJECT_PREFIX ` | no | ` github ` | NATS subject prefix |
6468| ` GITHUB_STREAM_NAME ` | no | ` GITHUB ` | JetStream stream name |
0 commit comments