Webhook handler for recipes hosted on a mealie.io instance
4.9K
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.
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 }}
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"
services:
mealie:
# mealie configuration
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
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:a19f3f8f9…
Size
8 MB
Last updated
2 months ago
docker pull timoreymann/mealie-webhook-handler