MCPSERV.CLUB
Hatsu

Hatsu

Self-Hosted

Bridge static sites to the Fediverse automatically

Stale(55)
210stars
1views
Updated Apr 3, 2025

Overview

Discover what makes Hatsu powerful

Hatsu is a **self‑hosted ActivityPub bridge** that turns any static site into a fully fledged Fediverse actor. Written in Rust, it listens for ActivityPub traffic, translates it into the static site’s feed format (JSON, Atom or RSS), and vice‑versa. The core idea is to expose a single “catch‑all” account (`@catch-all@example.com`) and a virtual URL space that mirrors the static site’s content. When a Fediverse user follows or mentions this account, Hatsu automatically forwards the relevant posts to their inbox and pulls replies back into the static site’s feed, keeping both sides in sync without manual intervention.

Language & Runtime

Web Framework

Federation Layer

Data Source

Overview

Hatsu is a self‑hosted ActivityPub bridge that turns any static site into a fully fledged Fediverse actor. Written in Rust, it listens for ActivityPub traffic, translates it into the static site’s feed format (JSON, Atom or RSS), and vice‑versa. The core idea is to expose a single “catch‑all” account (@catch-all@example.com) and a virtual URL space that mirrors the static site’s content. When a Fediverse user follows or mentions this account, Hatsu automatically forwards the relevant posts to their inbox and pulls replies back into the static site’s feed, keeping both sides in sync without manual intervention.

Architecture

  • Language & Runtime: Rust 1.80+; the entire backend is a single binary that uses async I/O (Tokio) for high concurrency.
  • Web Framework: axum (with optional extensions), providing a lightweight, composable request‑handling pipeline.
  • Federation Layer: activitypub-federation-rust – the same library that powers Lemmy, ensuring compatibility with Mastodon, Pleroma, GoToSocial and other ActivityPub‑enabled services.
  • Data Source: The bridge consumes the static site’s feed (JSON/Atom/RSS). No database is required; state is kept in memory or simple local files for configuration.
  • Deployment: Distributed as a Docker image; can run on any host that supports the Rust runtime, including ARM64 (aarch64) platforms.

Core Capabilities

  • Automatic Redirects: Maps @catch-all@example.com to the correct local user and https://example.com/hello-world to the corresponding ActivityPub post.
  • Follow Handling: Accepts follow requests, pushes new posts to followers’ inboxes in real time.
  • Backfeed: Receives replies or reblogs from the Fediverse and injects them back into the static site’s feed via webhooks or polling.
  • HTTP Signatures: Supports signed_fetch_actor and http_signature_compat, enabling secure communication with Mastodon (secure mode) and Pleroma.
  • Extensible via Webhooks: Exposes endpoints for third‑party services to hook into post creation, updates, or deletions.

Deployment & Infrastructure

  • Self‑Hosting: One Docker container is sufficient; no external database or message broker required.
  • Scalability: The async Rust stack handles thousands of concurrent connections with minimal CPU overhead. For high‑traffic sites, a simple load balancer (e.g., Traefik) can front multiple Hatsu instances.
  • Containerization: Official Docker images are published on GitHub Container Registry; can be run on Kubernetes, Docker Swarm, or a bare‑metal server.
  • Resource Footprint: A single instance typically consumes < 50 MiB RAM and < 10 mCPU on a modern CPU, making it ideal for edge deployments or low‑cost VPS plans.

Integration & Extensibility

  • Plugin System: While Hatsu currently offers a minimal plugin API, developers can fork the repository and add custom middleware or handlers in Rust before recompiling.
  • RESTful API: Exposes endpoints for querying followers, posting new content, or retrieving the bridge’s status; documented in docs.rs and the bundled API spec.
  • Webhooks: Supports outgoing webhooks to notify external services (e.g., CI/CD pipelines, analytics dashboards) whenever a post is mirrored or a reply is received.
  • Configuration: All settings are file‑based (config.toml) or environment variables, allowing declarative deployment via Docker Compose or Helm charts.

Developer Experience

  • Documentation: Comprehensive guides on the official site (hatsu.cli.rs) cover installation, configuration, and advanced federation options. The codebase is well‑structured with inline comments.
  • Community: Maintained by the importantimport GitHub organization; issues and pull requests are actively reviewed. Matrix channel (#importantimport:matrix.org) offers real‑time support.
  • Licensing: MIT license ensures freedom to modify, redistribute, or embed Hatsu in commercial projects without copyleft constraints.

Use Cases

  1. Static Blog to Fediverse – A Jekyll or Hugo site can expose its posts on Mastodon, Pleroma, and other instances without a CMS backend.
  2. Micro‑blogging on the Edge – Deploy Hatsu on a VPS close to your audience; users can follow and comment directly from their favorite Fediverse clients.
  3. Content Aggregation – A curated feed (e.g., newsletters) can be mirrored to the Fediverse, automatically pulling updates from RSS/Atom sources.
  4. Decentralized Collaboration – Teams using static documentation can interact with each other via ActivityPub, enabling threaded discussions on any client.

Advantages

  • Zero‑DB Footprint – No relational or document database; reduces operational complexity.
  • High Performance – Rust’s async runtime delivers low latency and high throughput, outperforming many Node or Python bridges.
  • Protocol‑Focused – Strict ActivityPub compliance means fewer edge cases and a smaller surface for bugs compared to multi‑protocol bridges.
  • Licensing Freedom – MIT license removes legal barriers for commercial use, unlike some GPL‑licensed alternatives.
  • Community & Maintenance – Active development and alignment with the Lemmy ecosystem ensures timely updates for new ActivityPub features.

For developers looking to expose a static site on the Fediverse with minimal overhead, Hatsu offers a lightweight, performant, and highly configurable

Open SourceReady to get started?

Join the community and start self-hosting Hatsu today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
apis-services
License
AGPL-3.0
Stars
210
Technical Specs
Pricing
Open Source
Docker
Official
Supported OS
LinuxDocker
Author
importantimport
importantimport
Last Updated
Apr 3, 2025