FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
paulkinlan
paulkinlanpostherous
https://posthero.us - an email powered blogging system
Public
Like
6
postherous
Home
Code
22
backend
3
frontend
2
shared
2
.vtignore
ACTIVITYPUB-STATUS.md
ACTIVITYPUB-TROUBLESHOOTING.md
ACTIVITYPUB.md
README.md
SECURITY.md
SETUP.md
H
debug-config.ts
H
debug-signatures.ts
deno.json
E
email.ts
H
generate-keys.ts
H
test-activitypub-delivery.ts
H
test-activitypub-inbox.ts
H
test-activitypub.ts
H
test-follow.ts
H
test-http-signatures.ts
H
test-publish.ts
H
test-verification.ts
Branches
1
Pull requests
Remixes
4
History
Environment variables
9
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.
Sign up now
Code
/
ACTIVITYPUB-TROUBLESHOOTING.md
Code
/
ACTIVITYPUB-TROUBLESHOOTING.md
Search
7/11/2025
Viewing readonly version of main branch: v316
View latest version
ACTIVITYPUB-TROUBLESHOOTING.md

ActivityPub Troubleshooting Guide

Current Status: โš ๏ธ Partial Implementation

Your ActivityPub implementation is working correctly but has one critical limitation that prevents posts from appearing in Mastodon timelines.

โœ… What's Working

  1. ActivityPub Discovery: Your blog is discoverable via WebFinger (@blog@posthero.us)
  2. Following: Users can follow your blog from Mastodon
  3. Follower Management: The system correctly tracks followers and their inboxes
  4. Activity Creation: Posts are converted to proper ActivityPub Create/Note activities
  5. Delivery Attempts: The system attempts to deliver activities to follower inboxes
  6. Logging: Comprehensive logging shows exactly what's happening

โŒ What's Not Working

HTTP Signatures: Most Mastodon servers (including the one following you) require HTTP signatures for authentication. Your current implementation sends unsigned requests, which are rejected with:

HTTP 401: {"error":"Request not signed"}

๐Ÿ” Current Test Results

From your latest test delivery:

๐Ÿ“Š Followers found: {
  totalFollowers: 1,
  followersWithInbox: 1,
  followersWithSharedInbox: 1
}

๐Ÿ“ฎ Delivery plan: { uniqueInboxes: 1, totalDeliveries: 1 }

โŒ Inbox delivery failed: {
  inbox: "https://status.kinlan.me/inbox",
  error: 'HTTP 401: {"error":"Request not signed"}',
  followers: [ "paul" ]
}

๐ŸŽ‰ ACTIVITYPUB PUBLISH COMPLETED: {
  processingTimeMs: 395,
  totalInboxes: 1,
  successfulDeliveries: 0,
  failedDeliveries: 1,
  deliveryRate: "0%"
}

๐Ÿ› ๏ธ Solutions

Option 1: Implement HTTP Signatures (Recommended)

HTTP signatures require:

  1. RSA Key Pair: Generate and store securely
  2. Signature Creation: Sign requests with private key
  3. Public Key Distribution: Serve public key in actor document

This is the proper long-term solution but requires careful cryptographic implementation.

Option 2: Find Mastodon Servers That Accept Unsigned Requests

Some smaller Mastodon instances may accept unsigned requests for testing purposes.

Option 3: Use Alternative ActivityPub Servers

Some ActivityPub implementations are more lenient with unsigned requests.

๐Ÿงช Testing Your Implementation

Use the test endpoint to verify delivery:

# Check current followers and posts curl "https://your-val.web.val.run/test-activitypub-delivery?action=info" # Test delivery to current followers curl "https://your-val.web.val.run/test-activitypub-delivery?action=test-delivery"

๐Ÿ“ Next Steps

  1. Immediate: Your ActivityPub setup is correct - the issue is authentication
  2. Short-term: Consider implementing HTTP signatures for full compatibility
  3. Alternative: Test with other ActivityPub servers that may be more lenient

๐Ÿ”ง Implementation Notes

The current code includes:

  • โœ… Proper ActivityPub activity structure
  • โœ… Correct inbox discovery and delivery logic
  • โœ… SHA-256 digest creation for request bodies
  • โœ… Comprehensive error handling and logging
  • โŒ HTTP signature creation (disabled due to complexity)

๐Ÿ“š Resources

  • ActivityPub Specification
  • HTTP Signatures Specification
  • Mastodon ActivityPub Implementation

Summary: Your ActivityPub implementation is architecturally sound and would work perfectly with HTTP signatures. The 401 errors are expected behavior from security-conscious Mastodon servers.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
ยฉ 2025 Val Town, Inc.