Public
Like
6
postherous
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v242View latest version
This document explains the ActivityPub and WebFinger implementation in the Email Blog platform.
ActivityPub is a decentralized social networking protocol that allows your blog to be discovered and followed from Mastodon, Pleroma, and other federated social networks. WebFinger is the discovery mechanism that allows users to find your blog using familiar @username@domain.com
syntax.
- Endpoint:
/.well-known/webfinger
- Formats Supported:
acct:blog@your-domain.com
https://your-domain.com/actor
- Response: JSON Resource Descriptor (JRD) format
- CORS: Enabled for cross-origin requests
- Endpoint:
/actor
- Type: Person
- Username:
blog
- Content-Type:
application/activity+json
- Outbox (
/outbox
): Published blog posts as ActivityPub Create activities - Followers (
/followers
): Collection of active followers (real data) - Following (
/following
): Collection of accounts being followed (placeholder) - Inbox (
/inbox
): Processes ActivityPub activities (Follow, Unfollow, Like, Announce, Create)
- Follow Activities: Adds followers to database, sends Accept response
- Unfollow Activities: Removes followers from database
- Like Activities: Tracks likes per post, displays counts
- Announce Activities: Tracks shares/boosts per post, displays counts
- Create Activities: Tracks replies to posts, displays counts
- Followers Table: Stores follower information (actor ID, username, domain, inbox, etc.)
- Activities Table: Stores all received activities (likes, shares, replies)
- Activity Counts: Real-time counting and display on post pages
# Optional: Set a custom domain for ActivityPub ACTIVITYPUB_DOMAIN=your-custom-domain.com
If not set, the system will automatically detect the domain from the request headers.
- Using WebFinger format: Search for
@blog@your-domain.com
in your Mastodon client - Using direct URL: Paste
https://your-domain.com/actor
in the search box
# Test with acct format curl "https://your-domain.com/.well-known/webfinger?resource=acct:blog@your-domain.com" # Test with direct URL format curl "https://your-domain.com/.well-known/webfinger?resource=https://your-domain.com/actor"
# Get actor document curl -H "Accept: application/activity+json" https://your-domain.com/actor # Get outbox (published posts) curl -H "Accept: application/activity+json" https://your-domain.com/outbox # Get followers collection curl -H "Accept: application/activity+json" https://your-domain.com/followers