Description
[root@vm101 ~]# cat config.json
[
{
"id": "test",
"execute-command": "./test.sh",
"pass-arguments-to-command": [{"source": "entire-headers"}]
}
]
[root@vm101 ~]# cat test.sh
#!/bin/bash
echo $*
[root@vm101 ~]# ./webhook -hooks config.json -verbose -debug
[webhook] 2025/02/20 10:08:27 version 2.8.1 starting
[webhook] 2025/02/20 10:08:27 setting up os signal watcher
[webhook] 2025/02/20 10:08:27 attempting to load hooks from config.json
[webhook] 2025/02/20 10:08:27 found 1 hook(s) in file
[webhook] 2025/02/20 10:08:27 loaded: test
[webhook] 2025/02/20 10:08:27 serving hooks on http://0.0.0.0:9000/hooks/{id}
[webhook] 2025/02/20 10:08:27 os signal watcher ready
[22f54b] GET /hooks/test HTTP/1.1
[22f54b] Host: localhost:9000
[22f54b] Accept: /
[22f54b] User-Agent: curl/7.61.1
[22f54b]
[webhook] 2025/02/20 10:08:39 [22f54b] incoming HTTP GET request from 127.0.0.1:39952
[webhook] 2025/02/20 10:08:39 [22f54b] test got matched
[webhook] 2025/02/20 10:08:39 [22f54b] error parsing body payload due to unsupported content type header:
[webhook] 2025/02/20 10:08:39 [22f54b] test hook triggered successfully
< [22f54b] 0
[webhook] 2025/02/20 10:08:39 [22f54b] 200 | 0 B | 215.378µs | localhost:9000 | GET /hooks/test
[webhook] 2025/02/20 10:08:39 [22f54b] executing ./test.sh (./test.sh) with arguments ["./test.sh" "{"Accept":"/","User-Agent":"curl/7.61.1"}"] and environment [] using as cwd
[webhook] 2025/02/20 10:08:39 [22f54b] command output: {"Accept":"/","User-Agent":"curl/7.61.1"}
[webhook] 2025/02/20 10:08:39 [22f54b] finished handling test
Activity