From 2e41f030f02a336c2e9866d3d56b0494da5a622e Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 15 Dec 2025 00:58:43 -0800 Subject: Remove admin route in favor of a simpler toml format --- routes.toml.example | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 routes.toml.example (limited to 'routes.toml.example') diff --git a/routes.toml.example b/routes.toml.example new file mode 100644 index 0000000..ac9a493 --- /dev/null +++ b/routes.toml.example @@ -0,0 +1,47 @@ +# Posthook Routes Configuration +# +# This file defines webhook routes that Posthook will handle. +# Edit this file and Posthook will automatically reload the configuration. +# +# Each [[route]] section defines a webhook endpoint available at /hook/{name} + +# Example: Simple JSON webhook +[[route]] +name = "github-webhook" +contentType = "json" +hcaptchaProtected = false +requireToken = false + +# Example: Form-encoded webhook with hCaptcha protection +[[route]] +name = "contact-form" +contentType = "form" +hcaptchaProtected = true +hcaptchaSecret = "0x0000000000000000000000000000000000000000" +requireToken = false + +# Example: JSON webhook with ntfy notifications +[[route]] +name = "alerts" +contentType = "json" +hcaptchaProtected = false +requireToken = false + +[route.ntfy] +enabled = true +server = "https://ntfy.sh" +topic = "my-alerts" + +# Example: Multipart file upload with token protection +[[route]] +name = "file-upload" +contentType = "multipart" +hcaptchaProtected = false +requireToken = true + +# Content Types: +# - json: application/json +# - form: application/x-www-form-urlencoded +# - multipart: multipart/form-data +# - text: text/plain +# - raw: any content type (stored as-is) -- cgit v1.2.3-70-g09d2