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: v117View latest version
A modern blog platform inspired by Posterous that allows publishing posts via email.
Your email blog platform is fully functional! Send an email to start publishing.
- ๐ง Email-to-Publish: Send an email to publish posts instantly
- ๐ Email Security: Allowlist and verification system to prevent unauthorized posts
- ๐จ Multi-format Support: HTML and plain text posts
- ๐ก RSS Feed: Full RSS 2.0 support for syndication
- ๐ WebSub: Real-time feed updates via WebSub protocol (configured)
- ๐ ActivityPub: Full federated social networking with followers, likes, and shares โ
- ๐ฆ AT Protocol: Bluesky integration for cross-platform syndication (configured)
- ๐ SEO Friendly: Clean URLs with slugified titles
- ๐ฑ Responsive Design: Mobile-first responsive interface with TailwindCSS
- โก Fast: Built on Val Town with SQLite storage and static HTML generation
- ๐ No JavaScript: Pure HTML/CSS frontend for maximum performance
index.ts
- Main Hono server with HTML generation and API routes โdatabase/
- SQLite schema and query functions โservices/
- External service integrations โ
- Email trigger handler with security verification โ
- Allowlist checking and draft post creation โ
- Automated verification email sending โ
- Server-side HTML rendering with TailwindCSS โ
- No client-side JavaScript dependencies โ
- Fast loading and SEO optimized โ
- Configure Security: Set
ALLOWED_EMAIL_ADDRESSES
environment variable (see Security section) - Send Email: Send email from an allowed address to your Val Town email address
- Verify Email: Click the verification link sent to your email
- View Blog: Visit your backend HTTP val URL after verification
- RSS Feed: Access
/rss
for syndication - Individual Posts: Visit
/post/[slug]
See SETUP.md for detailed setup instructions and ACTIVITYPUB.md for ActivityPub federation details.
ALLOWED_EMAIL_ADDRESSES
- Comma-separated list of allowed email addresses (required)BASE_URL
- Your blog's base URL for verification links (optional, auto-detected)
WEBSUB_HUB_URL
- WebSub hub URLACTIVITYPUB_DOMAIN
- Domain for ActivityPub federationATPROTO_HANDLE
- AT Protocol handleATPROTO_PASSWORD
- AT Protocol app password
GET /
- Main blog interfaceGET /post/:slug
- Individual post pageGET /rss
- RSS 2.0 feedGET /api/posts
- JSON API for postsGET /api/posts/:slug
- JSON API for single postGET /websub
- WebSub subscription endpointGET /.well-known/webfinger
- WebFinger discovery for ActivityPub โGET /actor
- ActivityPub actor document โGET /outbox
- ActivityPub outbox (published activities) โGET /followers
- ActivityPub followers collection โGET /following
- ActivityPub following collection โPOST /inbox
- ActivityPub inbox (processes Follow, Like, Announce, Undo) โGET /api/posts/:slug/activities
- Get activity counts (likes, shares, replies) โGET /health
- Health check
Use /test-publish.ts
to create sample posts for testing.
Send an email like this:
To: your-email-val@val.town
Subject: My Amazing Blog Post
Body: <h2>Hello World!</h2><p>This post was published via email!</p>
The post will appear instantly on your blog with:
- Title: "My Amazing Blog Post"
- Slug: "my-amazing-blog-post"
- Content: Rendered HTML
- Author: Extracted from email address
- Edit HTML generation functions in
/backend/index.ts
- Modify CSS styles in the
getCustomCSS()
function - Update branding in HTML templates
- Configure federation services via environment variables
Posts are automatically syndicated to:
- RSS feed (always enabled)
- WebSub subscribers (if configured)
- ActivityPub followers (with full interaction support) โ
- AT Protocol/Bluesky (if configured)
Your blog is now fully federated with ActivityPub! Users can:
- Follow your blog from Mastodon, Pleroma, and other ActivityPub platforms
- Like your blog posts (shows โค๏ธ count on posts)
- Share/Boost your posts (shows ๐ count on posts)
- Reply to your posts (shows ๐ฌ count on posts)
Discovery formats:
- WebFinger:
@blog@your-domain.com
- Direct actor URL:
https://your-domain.com/actor
Real-time interaction tracking:
- All likes, shares, and replies are stored and displayed on individual post pages
- Follower count is maintained and accurate
- Full ActivityPub inbox processing for Follow/Unfollow activities
Example: If your blog is at myblog.web.val.run
, users can follow @blog@myblog.web.val.run
from their Mastodon client and interact with your posts!
Ready to blog via email? Send your first post now! ๐งโจ