chadtmiller.com/group-host
atmosphere group host
0
0
# group-host
> **Beta.** `group-host` follows the Atmosphere Groups spec, which is in
> beta and may still change. The
> [atproto spaces](https://github.com/bluesky-social/proposals/tree/main/0016-permissioned-data)
> it builds on are in beta too.
`group-host` is a server for running groups on
[atproto](https://atproto.com). It implements the
[Atmosphere Groups spec](https://tangled.org/atmospheregroups.org/spec).
On atproto, a group is an account of its own. It has a DID, a handle
and a repo, the same as a person's account. But no one person owns it,
and nobody has its password. Its members decide what it does, through
the roles they hold in it.
## What the host is
A person's account lives on a PDS. That's the server that holds their
repo and files, signs their commits, and lets apps sign in as them. A
group's account needs a server like that too, so `group-host` is one.
To the rest of the network it's a PDS, and it answers the same
`com.atproto.repo` and `com.atproto.sync` calls any PDS does.
What's different is who has accounts on it. Every account on a group
host is a group. No person signs up there, and no person's account
lives there. Members keep their own accounts on their own PDSes,
anywhere on the network.

A group also needs two things a person's PDS doesn't do:
- Someone has to decide who reads its private records. Those live in
spaces, atproto's private record stores, where each member writes in
their own repo on their own PDS. The host is the authority for each
group's spaces. It checks every read and write against the space's
policy and the member's roles, and gives readers their credentials.
- Someone has to decide what an app may do as the group. A member signs
into an app as the group at the host, which is the group's OAuth server.
The app gets at most what that member's roles allow, and the host
checks those roles again at every write.
## How it fits on the network

The host is a public server that other servers reach over https. Relays
read each group's public repo from its firehose, the same as from any
PDS. Members' PDSes tell it when they write in a group's space. Apps
sign in at it, and anyone resolving a group's handle asks it for the
group's DID.
It also holds the rotation key that signs each group's DID document in
the PLC directory. Losing that key loses control of the groups' identities,
unless their stewards (members trusted with the group's identity) added
recovery keys of their own. So running a host takes a domain with a
wildcard name for handles, a reverse proxy, and backups that keep the
keys safe. [Deploying](docs/deploying.md) walks through it.
## What a group can do
- Start up with its own `did:plc`, a handle under the host's domain or
on its own domain, and two spaces of its own for its profile, settings,
roles and members. → [Groups](docs/design/groups.md)
- Keep private spaces under policies that say which roles read and write
each one. → [Spaces](docs/design/spaces.md)
- Take members openly, by approval or by invite, and give them roles.
→ [Membership](docs/design/membership.md)
- Label records, work a moderation queue, and handle reports and
appeals. → [Moderation](docs/design/moderation.md)
- Let a member sign an app in as the group, or connect an AI app over
MCP that acts as that member. → [Signing in](docs/design/signing-in.md),
[MCP](docs/design/mcp.md)
- Hand its stewards recovery keys, and move to another host with its DID,
repo and spaces. → [Recovery](docs/design/recovery.md),
[Moving](docs/design/moving.md)
The host also caps how much any one caller can ask
([limits](docs/design/limits.md)).
## What's in this repository
The host is one Rust server (`crates/group-host`) over SQLite. Beside it
are two ways for people to use it:
- The console (`web/`), a SvelteKit app where people start and run
groups and approve apps.
- The `atgrp` command (`crates/atgrp`), which does the same from a
terminal. Each of its commands is also an MCP tool the host serves at
`/mcp` (`crates/group-host-mcp`).
The schemas are in `lexicons/`, the image and compose file in
`Dockerfile` and `deploy/`, and the test harness in `harness/`. Two small
apps in `examples/` use the host as any app would: one signs in as a group
and reads it, the other joins a group for a person. The
`atproto` and `atproto-client` crates live in
[their own repository](https://knotless.dev/chadtmiller.com/atproto).
[The pieces](docs/design/README.md#the-pieces) has the full table.
## Quickstart
### Run it locally
You need Rust's stable toolchain through `rustup`, Node at the version
in `.node-version`, `just`, and `goat` (for linting lexicons). From a
fresh checkout:
```sh
just setup
just dev
```
`just setup` installs the packages and the tools the checks use. `just
dev` builds everything, then starts a reference PDS, a PLC directory,
the host, and the console at
[https://group-host.localtest.me](https://group-host.localtest.me),
behind `portless` on port 443. If `portless` isn't running yet, `just
dev` prints the command to start it.
Sign in as `alice.test` or `bob.test` with the password `password`.
`just dev` also prints a `just atgrp` command to run as `alice.test`
against her group. To run the host and the console on their own, use
`just serve` (on `PORT`, `2600` by default) and `just web-dev`.
### Deploy it
Build the image and run the `host` and `console` services in
`deploy/docker-compose.yml` behind a reverse proxy:
```sh
docker build --build-arg GROUP_HOST_COMMIT=$(git rev-parse HEAD) -t group-host:current .
docker compose -f deploy/docker-compose.yml up -d
```
[Deploying](docs/deploying.md) covers release images, the proxy, handles
and custom domains, upgrades and backups.
## Docs
The pages under `docs/` are also built into a site by `docs-site/`.
| Page | What's in it |
|---|---|
| [Guides](docs/guides/README.md) | Step-by-step console walkthroughs, with screenshots |
| [Design](docs/design/README.md) | How each part of the host works, and why |
| [API](docs/reference/api.md) | Every HTTP route and XRPC method, and the errors each returns |
| [Commands](docs/reference/cli.md) | Every `atgrp` command, `group-host` command, and `just` recipe |
| [MCP tools](docs/reference/mcp.md) | Every MCP tool and the `atgrp` command it matches |
| [Configuration](docs/reference/config.md) | Every environment variable the host and `atgrp` read |
| [Deploying](docs/deploying.md) | The image, the proxy, custom domains, upgrades and backups |
| [Development](docs/development.md) | Building, testing, pull checks, the docs site, and releasing |
## Development
```sh
just test # every workspace test
just t <args> # only the tests those cargo test args pick
just cov # 100% line and function coverage gate
just lint # rustfmt, oxfmt, clippy, cargo-deny, console checks, svelte-check, the examples' types
just fmt # format Rust with rustfmt and web/harness/docs-site/examples with oxfmt
just lex # lint lexicons with goat and check growth against main
just docs # check relative links, #anchor slugs, and guide screenshots
just e2e # run the console's end-to-end flows in Chromium with Playwright
```
[Development](docs/development.md) says what each check runs. Read
`AGENTS.md` when working on the repository with a coding agent.
## License
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE)
or [MIT license](LICENSE-MIT), at your option.