This is a Webmention receiver to be used as an endpoint to receive webmentions for your website.
It's still very much a work-in-progress and not ready for use, but I wanted to share progress as the spec evolves in the IndieWeb community.
- Node.js with Architect framework
- Deploy to AWS using Lambda, API Gateway, DynamoDB, SNS
- POST /webmention with
source
andtarget
form parameters- Return 400 if
source
andtarget
are not valid URLs - Return 400 if
source
is the same as target - Return 400 if
target
is not a known domain (DOMAINS
env var) - Return 400 if
source
's domain is found in blocked domain table - Generate a unique id for the webmention
- Store
id
,source
,target
and a timestamp in webmentions table - Log status "Received webmention"
- Publish verify event with
id
payload - Return 201 with
Location
header/webmention/:id
- Return 400 if
- Handle verify event with
id
payload- Get the webmention record from the database
- Fetch the source, limiting to 1Mb, 20 redirects and a 5-second timeout
- Log error if
Content-Type
is not HTML, JSON or text - Log error if
source
content does not includetarget
- Publish parse event with
id
- Handle parse event with
id
payload- Get the webmention record from the database
- Send source URL to XRay to parse into JF2
- Log status "Source was parsed" or error if unsuccessful
- Upload author photo to Cloudinary
- Create a JF2 object (format TBD - see indieweb/webmention-ecosystem#2)
- Update webmention record with JF2 post in table
- Publish send event with
id
payload
- Handle send event with
id
payload- Get the webmention record from the database
- Send POST to config webhook URL with webmention record in JSON body
- GET /webmention with
target
query parameter- Query for webmentions matching
target
- Return 404 if no webmentions are found
- Return 200 with list of webmentions as HTML (default) or JSON depending on
Accept
header
- Query for webmentions matching
- GET /webmention/:id
- Query for statuses matching
id
- Return 404 if no statuses are found
- Return 200 with list of statuses as HTML (default) or JSON depending on
Accept
header
- Query for statuses matching
ROOT_URL
e.g. https://wembley.barryfrost.com/DOMAINS
e.g. barryfrost.comWEBHOOK_URL
e.g. https://api.barryfrost.com/webmention