explaingit

adnanh/webhook

11,815GoAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

A lightweight Go server that listens for HTTP requests and runs shell commands in response, commonly used to trigger auto-deployment scripts when code is pushed to GitHub or when Slack slash commands arrive.

Mindmap

mindmap
  root((webhook))
    What it does
      Listens for HTTP requests
      Runs shell commands
      Passes request data to scripts
    Rules system
      Secret token check
      IP range filter
      Cryptographic signature
    Use Cases
      Auto-deploy on push
      Slack slash commands
      Custom server automation
    Setup
      JSON or YAML config
      Port 9000 default
      HTTPS and reverse proxy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Trigger a deploy script automatically whenever GitHub or Bitbucket sends a push-event webhook to your server.

USE CASE 2

Accept Slack or Mattermost slash commands and have them run scripts directly on your server.

USE CASE 3

Gate any webhook trigger behind a secret token, IP allowlist, or cryptographic signature to prevent unauthorized execution.

USE CASE 4

Automate any server-side task in response to an HTTP POST from any external service.

Tech stack

Go

Getting it running

Difficulty · moderate Time to first run · 30min

Requires writing a JSON or YAML hooks config file and opening an inbound port on your server, no external services needed.

In plain English

Webhook is a small server program written in Go that listens for incoming HTTP requests and runs shell commands in response. You configure it with a list of hooks in a JSON or YAML file, where each hook has a URL endpoint, a command to execute, and optional rules that must be satisfied before the command runs. When a matching request arrives, the tool executes the command and optionally passes values from the request (headers, query parameters, or payload fields) into the command as arguments or environment variables. A common use for this is automatic deployment: you tell your code hosting service (such as GitHub or Bitbucket) to send an HTTP request to your server whenever new code is pushed, and webhook receives that request and runs your deploy script. Another use is accepting slash commands from chat tools like Slack or Mattermost and having those commands trigger scripts on your server. The rules system lets you restrict when a hook fires. You can require a specific secret token, check that a request comes from a particular IP range, or verify a cryptographic signature in the request headers. Without at least one rule, any HTTP request to the endpoint would trigger the command, which would be a security risk. The server starts on port 9000 by default and can run over HTTPS if you provide a certificate and key. It can also run behind a reverse proxy like Nginx. Installation options include package managers on Ubuntu, Debian, and FreeBSD, prebuilt binary downloads from the releases page, or building from the Go source directly. The tool is intentionally minimal: it receives requests, checks rules, and calls commands. Anything beyond that is handled by the scripts or programs you point it at.

Copy-paste prompts

Prompt 1
Write a webhook hook definition in YAML for adnanh/webhook that runs a deploy.sh script when GitHub sends a push event, verifying the HMAC-SHA256 signature in the X-Hub-Signature-256 header before executing.
Prompt 2
Help me configure adnanh/webhook behind an Nginx reverse proxy with HTTPS so Slack slash commands can securely trigger shell scripts on my Linux server.
Prompt 3
Create a hooks.json file for adnanh/webhook that only fires when the incoming request includes a specific secret token header and originates from a set of allowed IP ranges.
Prompt 4
Write a systemd unit file that starts adnanh/webhook on port 9000 at boot and restarts it automatically on failure.
Prompt 5
Show me how to pass a GitHub push-event payload field (the pusher's name) as an environment variable into the command that adnanh/webhook executes.
Open on GitHub → Explain another repo

← adnanh on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.