aboutsummaryrefslogtreecommitdiff
path: root/routes.toml.example
blob: f6a2db4eda803c6841a398f82a3da0694efb8862 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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: JSON webhook with email notifications
[[route]]
name = "email-webhook"
contentType = "json"
hcaptchaProtected = false
requireToken = false

[route.email]
enabled = true
to = "admin@example.com"
from = "webhook@example.com"
host = "smtp.example.com"
port = 587
secure = true
username = "webhook@example.com"
password = "your-smtp-password"
subject = "New Webhook Received"
includeBody = true
includeHeaders = false

# 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)