https://github.com/t-matsuo/webhook-receiver
It receives outgoing webhook and call specified command.
https://github.com/t-matsuo/webhook-receiver
webhook webhook-server
Last synced: 7 months ago
JSON representation
It receives outgoing webhook and call specified command.
- Host: GitHub
- URL: https://github.com/t-matsuo/webhook-receiver
- Owner: t-matsuo
- License: apache-2.0
- Created: 2021-03-17T14:47:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-25T12:29:17.000Z (about 3 years ago)
- Last Synced: 2025-01-28T13:49:23.925Z (8 months ago)
- Topics: webhook, webhook-server
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webhook-receiver
It receives webhook and call specified command.
## Environment Variables
* WEBHOOK_CMD (required)
* command
* WEBHOOK_OUTPUT_STDOUT (default:false)
* Output stdout of command to client
* WEBHOOK_OUTPUT_STDERR (default:false)
* Output stderr of command to client if command does not exit with 0
* WEBHOOK_PORT (default:22999)
* Listen Port
* WEBHOOK_BIND (default:0.0.0.0)
* Bind IP
* WEBHOOK_PATH (default:/)
* Endpoint PATH
* WEBHOOK_DEBUG (defualt:false)
* Enable debug mode
* WEBHOOK_LOG_PREFIX (default:[webhook])
* Log prefix
* WEBHOOK_NO_ALOG (default:false)
* Suppress access log
* WEBHOOK_TIMEOUT (default:300)
* Command timeout (sec)
* WEBHOOK_WORKDIR (default:/tmp)
* Command workdir
* WEBHOOK_TLS (default:false)
* Enable TLS
* Certificate is generated automatically if WEBHOOK_SERVER_CRT or WEBHOOK_SERVER_KEY are not specified
* WEBHOOK_SERVER_CRT (default:null)
* TLS server crt file PATH
* WEBHOOK_SERVER_KEY (default:null)
* TLS server key file PATH## Usage
Simple
```
$ WEBHOOK_CMD="./my-script.sh" ./webhook
```Listening on 192.168.0.1:8080
```
$ WEBHOOK_PORT="192.168.0.1" WEBHOOK_PORT="8080" WEBHOOK_CMD="./my-script.sh" ./webhook
```Change log prefix from [webhook] to myapp
```
$ WEBHOOK_LOG_PREFIX="myapp" WEBHOOK_CMD="./my-script.sh" ./webhook
```## Command
Command gets client info through environment variables.
* WEBHOOK_IP: Client IP
* WEBHOOK_HOST: Access Host
* WEBHOOK_PATH: Access Path
* WEBHOOK_UA: UserAgent