A webhook middleware that transforms any payloads to work with the Brrr API.
Let-It-Brrr receives webhooks from various sources, transforms their payloads using customizable mappings, and forwards them to the Brrr notification API. This allows you to integrate any webhook source with Brrr without modifying your existing systems.
- Customizable Payload Mapping: Define how incoming payloads should be transformed to match Brrr's expected format.
- Default Values: Set default values for fields that may not be present in the incoming payload.
docker pull ghcr.io/thisisbenny/let-it-brrr:latestCreate a mappings.yaml file:
mappings:
my-fluxcd-alerts:
brrr_fields:
- field_expression: "message"
target_field: "message"
- field_expression: "involvedObject.name"
target_field: "subtitle"
default_values:
title: "FluxCD Alert"docker run -d \
--name let-it-brrr \
-p 8080:8080 \
-e BRRR_SECRET=your_brrr_secret_here \
-v ./mappings.yaml:/app/config/mappings.yaml \
ghcr.io/thisisbenny/let-it-brrr:latestSend a test webhook:
curl -X POST http://localhost:8080/webhook/my-fluxcd-alerts \
-H "Content-Type: application/json" \
-d '{"message": "Deployment successful", "involvedObject": {"name": "my-app"}}'ghcr.io/thisisbenny/let-it-brrr
| Tag | Description |
|---|---|
latest |
Most recent release |
v*.*.* |
Specific semantic version (e.g., v0.1.0) |
linux/amd64linux/arm64
| Variable | Required | Default | Description |
|---|---|---|---|
BRRR_SECRET |
Yes | - | Secret for Brrr API authentication |
MAPPINGS_FILE |
No | /app/config/mappings.yaml |
Path to mappings configuration |
LOG_LEVEL |
No | INFO |
Logging level (DEBUG, INFO, WARN, ERROR) |
The mappings.yaml file defines how webhook payloads are transformed:
mappings:
<mapping-id>:
brrr_fields:
- field_expression: "json.path.to.field" # JSON path or template in incoming webhook
target_field: "target_field_name" # Field name for Brrr API
- field_expression: "prefix - {{otherField}}" # Template with {{}} embedding
target_field: "target_field_name" # Result field name for Brrr API
default_values:
<field_name>: <default_value> # Fallback if field_expression result is emptyTemplate Syntax: Use {{jsonPath}} within target_field to embed dynamic
values from the webhook payload.
target_field: "prefix - {{involvedObject.name}}"
# Result if involvedObject.name = "my-app": "prefix - my-app"mappings:
fluxcd-generic:
brrr_fields:
- field_expression: "message"
target_field: "message"
- field_expression: "FluxCD - {{involvedObject.kind}}"
target_field: "title"
- field_expression: "involvedObject.name"
target_field: "subtitle"Health check endpoint.
Response:
{ "status": "ok", "mappings_count": 2, "version": "1.0.0" }Fields:
status- Always "ok" when healthymappings_count- Number of configured mappingsversion- Application version (from git tag or "0.0.0" if not available)
Receive and transform webhooks.
Path Parameters:
mappingId- The mapping configuration to use
Request:
Content-Type: application/json- Body: Webhook payload
Response:
{ "status": "forwarded", "mapping_id": "my-mapping" }Error Responses:
400- Invalid JSON or missing Content-Type404- Mapping not found502- Brrr API error
Important: Let-It-Brrr does not have built-in authentication. The service is designed to be deployed behind network protection layers and should never be exposed directly to the internet without additional security measures.
To safely deploy Let-It-Brrr, use one or more of the following protection mechanisms:
- Network Restrictions: Deploy behind a firewall or VPN to limit access to trusted networks only
- Reverse Proxy with Authentication: Place a reverse proxy (such as nginx, Traefik, or Cloudflare Tunnel) in front of Let-It-Brrr that handles authentication
- IP Allowlisting: Configure firewall rules to only allow incoming webhooks from known IP addresses
Mapping IDs (the <mapping-id> in webhook URLs) act as a minimal form of
security through obscurity. Use randomly generated, unpredictable mapping
IDs (e.g., UUIDs) rather than descriptive names like my-fluxcd-alerts.
Example of a secure mapping ID:
mappings:
a7f3b2c1-9e45-4d8f-b123-456789abcdef:
brrr_fields:
- field_expression: "message"
target_field: "message"
default_values:
title: "Alert"Do NOT use predictable mapping IDs that could be guessed by unauthorized parties.
Contributions are welcome! Please feel free to submit issues or pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
deno testdeno lintThis project is licensed under the MIT License - see the LICENSE file for details.