- http
- post-webmention :source, :target
- Return 400 if source and target are not valid URLs
- Return 400 if source is the same as target
- Return 400 if target is not a known domain
- Return 400 if source’s domain is found in blocks table
- Create random ID to represent webmention
- Put id, source, target, created_at in webmentions table
- Put id, webmention_id, created_at, description in statuses table
- Publish to queues/verify (webmention_id)
- Return 201 with Location header /webmention/:webmention_id
- get-webmention :webmention_id
- Return 400 if webmention_id is not correct format
- Get status records for webmention_id from statuses table
- Return 200 with HTML or JSON depending on header
- post-webmention :source, :target
- queues
- verify (webmention_id)
- Get the webmention record
- Head request on source
- Put status and abort if Content-Type is not valid or length > 1Mb
- Fetch the source, following any redirects (limiting to 20 redirects, 5 sec timeout)
- Put status and abort if there is no mention of the target
- HTML: look for href or src attributes
- JSON: look for exact values
- Text: look for string
- Return 500 if response is an error
- Put status and abort if there is no mention of the target
- Put new status record
- Publish to queues/parse (webmention_id)
- parse (webmention_id)
- Get the webmention record
- Send source to Granary to parse into MF2
- Sanitise and truncate HTML to safe_html
- Upload author photo to Cloudinary and resize to 128px
- Create safe properties object and add to webmention object
- Put updated webmention in webmentions table
- Publish to queues/send (webmention_id)
- send (webmention_id)
- Get the webmention record
- Get the webhook_url from the account record
- Send request to webhook_url with webmention object
- Return 200 if successful
- Auto retries
- verify (webmention_id)
- shared
- status
- log (webmention_id, description)
- Create random ID to represent status
- Put new record in statuses table
- log (webmention_id, description)
- status
- accounts table: domain, secret, webhook_url
- webmentions: id, source, target, created_at, post {jf2}
- statuses: id, webmention_id, created_at, description
- blocks: domain