Skip to main content

FedBox

A generic ActivityPub server written in Go. Reference implementation for the GoActivityPub library suite.

Overview

FedBox provides core ActivityPub infrastructure without opinionated application logic. It's designed as a foundation — build your own federated application on top, or use it as a reference for implementing ActivityPub.

Architecture

FedBox is part of the GoActivityPub ecosystem:

┌─────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────┤
│ FedBox │
│ ┌───────────┬───────────┬───────────────────┐ │
│ │ Handlers │ Storage │ Activity Process │ │
│ └───────────┴───────────┴───────────────────┘ │
├─────────────────────────────────────────────────┤
│ GoActivityPub Libraries │
│ ┌─────────┬──────────┬──────────┬──────────┐ │
│ │ go-ap/ │ go-ap/ │ go-ap/ │ go-ap/ │ │
│ │ activ.. │ client │ storage │ process │ │
│ └─────────┴──────────┴──────────┴──────────┘ │
└─────────────────────────────────────────────────┘

Key Features

HTTP Handlers

Built-in handlers for ActivityPub endpoints:

  • HandleActivity — POST to inbox/outbox
  • HandleCollection — GET collections (following, followers, etc.)
  • HandleItem — GET individual objects

Multiple Storage Backends

Choose your persistence layer:

BackendUse Case
BoltDBEmbedded, simple deployments
BadgerHigh-performance embedded
SQLiteSQL with single-file simplicity
FilesystemDebug-friendly, human-readable

Client-to-Server API

Full C2S support for local clients:

  • Create activities
  • Read collections
  • Update objects
  • Delete content

Server-to-Server Federation

Complete S2S implementation:

  • Inbox delivery
  • HTTP Signatures
  • Actor discovery
  • WebFinger support

Quick Start

Installation

# Clone
git clone https://github.com/go-ap/fedbox.git
cd fedbox

# Build
go build

# Initialize
./fedbox init

# Run
./fedbox run

Docker

docker run -p 4000:4000 ghcr.io/go-ap/fedbox

Configuration

# Server settings
LISTEN=:4000
HOSTNAME=fedbox.example.com

# Storage backend
STORAGE=boltdb
STORAGE_PATH=/var/lib/fedbox

# Security
OAUTH2_SECRET=your-secret-here

API Examples

Create an Actor

curl -X POST https://fedbox.example/actors \
-H "Content-Type: application/activity+json" \
-d '{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Person",
"preferredUsername": "alice",
"name": "Alice"
}'

Post an Activity

curl -X POST https://fedbox.example/actors/alice/outbox \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/activity+json" \
-d '{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"object": {
"type": "Note",
"content": "Hello, Fediverse!"
}
}'

Fetch an Actor

curl https://fedbox.example/actors/alice \
-H "Accept: application/activity+json"

The GoActivityPub ecosystem includes:

ProjectDescription
FedBoxMulti-actor reference server
ONISingle-user minimal server
BrutaLinksFederated link aggregator
go-ap/activitypubVocabulary types
go-ap/clientHTTP client with auth
go-ap/processingActivity side-effects

GoActivityPub Philosophy

"GoActivityPub provides a batteries included suite of modules for making the creation of ActivityPub applications easier for Go developers. It was designed to offer a middle ground between the highly dynamic nature of the Activity-Vocabulary and the constraints of the Go programming language, with emphasis on strong typing, minimal resource footprint and very little 'magic'."

Use Cases

Build a Custom Social Network

Use FedBox as the foundation, add your own UI and business logic.

Federation Gateway

Connect your existing application to the Fediverse.

Testing and Development

Run a local ActivityPub server for app development.

Reference Implementation

Learn how ActivityPub servers work by studying the code.

See Also