fabriziosalmi/certmate

[Feature][Discussion] Proper UI for building webhooks to external services. (#207)

Open

#218 opened on May 19, 2026

View on GitHub
 (3 comments) (1 reaction) (1 assignee)Python (101 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (1,228 stars)
PR merge metrics
 (PR metrics pending)

Description

This is for a discussion/brainstorming on webhook deployment options I raised on #207

A question was presented about how does this get stored/saved so it can be executed saved.

The way I see it is there are really only 2 ways.

  1. values in a DB/config that are dynamically generated on execution.
  2. Builds a script and saves it.

Webhooks have 3 componets:

  1. Request Method & URL
  2. Request Headers
  3. Request Body

To make it easy to parse and edit in the URL, and have a common calling function, we could use a JSON config file like so:

[
  {
    "name": "Slack Notifications",
    "endpoint_url": "https://slack.com",
    "method": "POST",
    "headers": { "Content-Type": "application/json" },
    "payload_template": { "text": "Event {{event}} triggered." }
  },
  {
    "name": "Customer CRM Sync",
    "endpoint_url": "https://hubspot.com",
    "method": "POST",
    "headers": { 
      "Content-Type": "application/json",
      "Authorization": "Bearer {{token}}"
    },
    "payload_template": { "contact_email": "{{email}}" }
  },
{
 "name": "n8n webhook",
  "endpoint_url": "https://example.com",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-Webhook-Secret": "secure_token"
  },
  "payload_template": {
    "event": "{{event_name}}",
    "timestamp": "{{current_time}}",
    "data": {}
  }
}
]

Lets call it something like webhooks.json We probably want to add a scope: {} entry per element too so that we can denote if it is global or per domain.

"scope": { "type": "domain" , "domains": ["domain.com", "domain1.com"]}
"scope": { "type": "global"}

In that way we would be able to keep them all in a single file, we would have the ability to parse the json file and always format it out in the gui the right way, and if someone had to they could modify the config by hand.

Also would make it easy to be part of the backup script.

You will notice I tossed in a few other references options like Slack and Hubspot, because lots of these services just use a webhook, this solves a lot things.

The CERTMATE_ variables that currently get passed only point to the location on disk so that doesnt actually work for the webhooks. Most APIs i have seen want the cert as a plain text pem format in the json. So I think that the compile script needs to be aware of that. I solved that in my deploy script by using

CERTMATE_CERT_CONTENT=$(cat $CERTMATE_CERT_PATH)
CERTMATE_KEY_CONTENT=$(cat $CERTMATE_KEY_PATH)
CERTMATE_FULLCHAIN_CONTENT=$(cat $CERTMATE_FULLCHAIN_PATH)

At the end of the day depending on what we already have installed, we can use standard requests library to build and execute that.

Contributor guide