https://github.com/dotzero/hooks
🪝 Hooks is a web service to inspect HTTP requests and debug webhooks using a simple web interface
https://github.com/dotzero/hooks
docker go golang http-requests inspect rest standalone testing testing-tools webhooks
Last synced: 10 months ago
JSON representation
🪝 Hooks is a web service to inspect HTTP requests and debug webhooks using a simple web interface
- Host: GitHub
- URL: https://github.com/dotzero/hooks
- Owner: dotzero
- License: mit
- Created: 2022-04-20T12:00:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-05T14:12:02.000Z (over 3 years ago)
- Last Synced: 2025-02-05T07:45:37.426Z (12 months ago)
- Topics: docker, go, golang, http-requests, inspect, rest, standalone, testing, testing-tools, webhooks
- Language: Go
- Homepage: https://hooks.dotzero.dev
- Size: 1.75 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hooks
[](https://github.com/dotzero/hooks/actions/workflows/ci-build.yml)
[](https://goreportcard.com/report/github.com/dotzero/hooks)
[](https://hub.docker.com/r/dotzero/hooks/)
[](https://github.com/dotzero/hooks/blob/master/LICENSE)
Hooks is a web service to inspect HTTP requests and debug webhooks using a simple web interface.
Data stored in [boltdb](https://github.com/etcd-io/bbolt) (embedded key/value database) files under `BOLT_PATH`.
*The UI was originally created by Jeff Lindsay and his RequestBin service.*

## Running container in Docker
```bash
docker run -d --rm --name hooks -p "8080:8080" dotzero/hooks
```
### Running container with Docker Compose
Create a `docker-compose.yml` file:
```yaml
version: "3"
services:
hooks:
image: ghcr.io/dotzero/hooks:latest
container_name: hooks
restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
environment:
HOOKS_HOST: "0.0.0.0"
HOOKS_PORT: "8080"
HOOKS_URL: "https://0.0.0.0:8080"
volumes:
- hooks_db:/app/var
volumes:
hooks_db:
```
Run `docker-compose up -d`, wait for it to initialize completely, and visit `http://localhost:8080`
### Build container
```bash
docker build -t dotzero/hooks .
```
## How to run it locally
```
git clone https://github.com/dotzero/hooks
cd hooks
go run .
```
### Command line options
```bash
Usage:
hooks [OPTIONS]
Application Options:
--host= listening address (default: 0.0.0.0) [$HOOKS_HOST]
--port= listening port (default: 8080) [$HOOKS_PORT]
--url= url to app (default: http://0.0.0.0:8080) [$HOOKS_URL]
--bolt-path= parent directory for the bolt files (default: ./var) [$BOLT_PATH]
--bolt-ttl= TTL in hours to keep data (default: 48) [$BOLT_TTL_HOURS]
--static-path= path to website assets (default: ./static) [$STATIC_PATH]
--tpl-path= path to templates files (default: ./templates) [$TPL_PATH]
--tpl-ext= templates files extensions (default: .html) [$TPL_EXT]
--verbose verbose logging
-v, --version show the version number
Help Options:
-h, --help Show this help message
```
### Environment variables
* `HOOKS_HOST` (*default:* `0.0.0.0`) - listening address
* `HOOKS_PORT` (*default:* `8080`) - listening port
* `HOOKS_URL` (*default:* `http://0.0.0.0:8080`) - url to web UI
* `BOLT_PATH` (*default:* `./var`) - path to BoltDB database (it represents a consistent snapshot of your data)
* `BOLT_TTL_HOURS` (*default:* `48`) - TTL in hours to keep data persistent
* `STATIC_PATH` (*default:* `./static`) - path to web assets
* `TPL_PATH` (*default:* `./templates`) - path to templates
* `TPL_EXT` (*default:* `.html`) - templates files extensions
## License
http://www.opensource.org/licenses/mit-license.php