Webhook handler for recipes hosted on a mealie.io instance
10K+
Webhook handler for recipes hosted on a mealie.io instance
This small service bridges Mealie (self-hosted recipe manager) with external systems by:
Key Use Case: Automate syncing Mealie recipes to a Chowdown-compatible GitHub repo (or other targets) with minimal manual effort.
Right now the only supported output is GitHub via PR. If you have any other destinations feel free to either create an issue or contribute directly:
outputs/<your name>/main.go (see github_pr for reference)It's recommended to install it next to your mealie instance using docker-compose.
Create webhook-templates/chowdown-template.gotpl
---
layout: recipe
title: {{ .Recipe.Name }}
{{- if .HasImage }}
image: {{ .Recipe.Slug }}.webp
{{- end }}
tags: {{- range $index, $tag := .Recipe.Tags }} {{- if $index }},{{ end }} {{ $tag.Name }} {{- end }}
ingredients:
{{- range $val := .Recipe.RecipeIngredient }}
- {{ if $val.Quantity }} {{ $val.Quantity }}{{- end -}}{{- if $val.Unit }} {{ or $val.Unit.Abbreviation $val.Unit.Name }}{{- end }} {{ if or $val.Quantity $val.Unit }} {{- end }}{{ $val.Food.Name }}{{- if $val.Note }} {{ $val.Note }}{{- end }}
{{- end }}
directions:
{{- range $val := .Recipe.RecipeInstructions }}
- {{ $val.Text }}
{{- end }}
---
{{ .Recipe.Description }}
Create a webhook-config.toml
# chowdown is a sample GitHub webhook to sync recipes to chowdown github repos
[webhook.chowdown_github_sync]
template_path = "/etc/mealie-webhook-handler/templates/chowdown-template.gotpl"
output = "github_pr"
[webhook.chowdown_github_sync.output_options]
title = "chore: Sync recipe {{ .Recipe.Name }} from mealie"
body = """
Update recipe {{ .Recipe.Name }}
"""
slug = "your-user/recipes"
source_branch = "sync/recipe/{{ .Recipe.Slug }}"
target_branch = "gh-pages"
recipe_path = "_recipes/{{ .Recipe.Slug }}.md"
image_path = "images/{{ .Recipe.Slug }}.webp"
commit_message = "chore: Sync {{ .Recipe.Name }} from mealie"
[mealie]
api_url = "http://mealie:9000/api"
Configure the webhook handler next to mealie
services:
mealie:
# Mealie 3.26.0+ requires the internal handler hostname to be allowed
# for Recipe Actions.
image: ghcr.io/mealie-recipes/mealie:latest
environment:
HTTP_ALLOW_LIST: mealie-webhook-handler
mealie-webhook-handler:
image: timoreymann/mealie-webhook-handler
restart: always
environment:
GITHUB_TOKEN: <personal access token>
command:
- mealie-webhook-handler
- --config-file
- /etc/mealie-webhook-handler/config.toml
volumes:
- ./webhook-config.toml:/etc/mealie-webhook-handler/config.toml
- ./webhook-templates:/etc/mealie-webhook-handler/templates
For Mealie 3.26.0 and newer, add the webhook handler's exact Docker DNS
hostname to Mealie's HTTP_ALLOW_LIST. The hostname must match the host
used in the Recipe Action URL, for example
http://mealie-webhook-handler:2025/webhook/chowdown_github_sync. If your
service has a different name, use that name instead. Multiple allowed
hosts can be provided as a comma-separated list. See Mealie's HTTP
allow-list security configuration.
Settings > Data ManagementRecipe ActionsCreateTitle: Sync to ChowdownURL: http://mealie-webhook-handler:2025/webhook/chowdown_github_syncAction Type: postSync to ChowdownCreating templates can sometimes be tricky, to make it easier there is the playground that can be used.
Simply put your template in, pick one of the predefined webhook payloads or paste a custom one and get immediate feedback.
I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:
To get started please read the Contribution Guidelines.
make test-coverage-report
make build
Content type
Image
Digest
sha256:883d9e73a…
Size
8 MB
Last updated
24 days ago
docker pull timoreymann/mealie-webhook-handler