trowel

Relay webhooks into NATS JetStream, and JetStream messages back out.

A small Go service that verifies and transforms incoming webhooks, publishes them to JetStream with an acknowledgement, and delivers JetStream messages to HTTP endpoints or commands with retries, signing, and dead-lettering. Secrets can come from OpenBao or Vault over https or a unix socket.

Install with APT (Linux)

Set up the repo.wyrd.foo APT repository (once)
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://repo.wyrd.foo/pubkey.gpg |
  sudo tee /etc/apt/keyrings/wyrd-company.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/wyrd-company.gpg] \
https://repo.wyrd.foo/apt stable main" |
  sudo tee /etc/apt/sources.list.d/wyrd-company.list >/dev/null
sudo apt update
sudo apt install trowel
A signed webhook is accepted, published to JetStream and delivered to a command, while a forged one is rejected.
A signed webhook is accepted, published to JetStream and delivered to a command, while a forged one is rejected.

What it does

  1. Accepts webhooks, verifies them with HMAC, Ed25519 or a static token, and answers 202 only after JetStream acknowledges the publish.

  2. Reshapes headers and payload with JSONata and expands a subject template for each message.

  3. Delivers JetStream messages to an HTTP endpoint, signed if you like, or to a command on stdin.

  4. Keeps one durable consumer per destination, retries failed deliveries, and dead-letters them to a subject when attempts run out.

  5. Reads secrets inline, from files, or from OpenBao or Vault, and reloads the configuration, its conf.d snippets, and every secret without a restart.

  6. Exports OpenTelemetry traces, metrics and logs, with one trace following each webhook to every destination.

Install

Set up the repo.wyrd.foo APT repository (once)
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://repo.wyrd.foo/pubkey.gpg |
  sudo tee /etc/apt/keyrings/wyrd-company.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/wyrd-company.gpg] \
https://repo.wyrd.foo/apt stable main" |
  sudo tee /etc/apt/sources.list.d/wyrd-company.list >/dev/null
sudo apt update
sudo apt install trowel

Documentation

Releases

Latest 0.3.0 Release notes on GitHub

Breaking

  • Start the devcontainer Feature’s Trowel service only after the Ansible Feature’s ansible-setup s6-rc oneshot succeeds when that service is installed, and install after the Ansible Feature. Without the Ansible Feature, Trowel starts as before, and the OpenBao Agent dependency stays independent.

Features

  • Read configuration snippets from the conf.d directory beside the config file, such as /etc/trowel/conf.d. Their webhooks and subjects are added in file name order, a snippet that sets server, nats, or vault already set elsewhere is an error, and Trowel reloads when a snippet is added, changed, or removed. DEB and RPM packages and the devcontainer Feature create an empty /etc/trowel/conf.d.

Fixes

  • Publish the public docs from docs/user in the wyrd.foo format, and point the demo recorder at docs/user/assets.
All releases