~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The README is written fresh, and just setup installs cargo-deny

Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:docs/readme
crates/group-host/src/store.rs+2−2
@@ -1,5 +1,5 @@
//! The host's database: one SQLite file holding every group's account, its
//! repo's current commit, and its records. The tree a commit names is
//! The host's database, in SQLite: every group's account, its repo's
//! current commit, and its records. The tree a commit names is
//! not kept: it is built again from the records, as a group's repo is
//! small (`atproto::mst`).
docs/reference/cli.md+2−2
@@ -162,11 +162,11 @@ An unknown command or flag fails with its usage, and any failure exits 1.
| Recipe | What it does |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `setup` | installs the console's and the harness's packages, llvm-tools and cargo-llvm-cov |
| `setup` | installs the console's and the harness's packages, llvm-tools, cargo-llvm-cov and cargo-deny |
| `test`, `t <args>` | runs every test, or those `args` pick |
| `cov`, `cov-html` | runs the tests under the 100% gate, or shows their coverage as a page |
| `fmt` | formats the Rust with rustfmt, and the console, the harness and the docs site with oxfmt |
| `lint` | checks formatting, clippy, the console's layers and svelte-check |
| `lint` | checks formatting, clippy, cargo-deny, the console's layers, dialogs and strings, and svelte-check |
| `lex` | runs the lexicons' checks |
| `dev` | runs the console over a world of its own to use: the reference PDS with alice, bob and harbor, the host, the console at https://group-host.localtest.me, and an invite waiting for alice ([development](../development.md#using-it)) |
| `serve` | runs the host |
docs/development.md+3−3
@@ -5,7 +5,7 @@ You need Rust's stable toolchain through rustup, Node at the version
for the lexicons.
```sh
just setup # the console's and harness's packages, and coverage tools
just setup # the console's and harness's packages, coverage tools, and cargo-deny
just dev # all of it, to use: see below
just serve # the host alone, on http://localhost:2600
just web-dev # the console alone, asking that host
@@ -241,8 +241,8 @@ versions too; a permissive licence for every one; and crates from
crates.io and the atproto registry alone. An advisory is fixed by an
upgrade, never ignored. The advisories are read as they are at the run,
so `check` can fail on `main` the day one is published, with nothing
changed. It needs `cargo install --locked cargo-deny` once; CI runs
0.22.0.
changed. `just setup` installs it (`cargo install --locked cargo-deny`);
CI runs 0.22.0.
No crate has unsafe code: `[workspace.lints.rust]` in `Cargo.toml`
forbids it, and each crate takes the workspace's lints, so the build
Justfile+3−1
@@ -9,12 +9,14 @@ oxfmt := "web/node_modules/.bin/oxfmt"
js := "web harness docs-site"
# Install the web pages' packages, the harness's (the reference PDS the
# tests reach the network through), and coverage tools.
# tests reach the network through), coverage tools, and cargo-deny for
# `just lint`.
setup:
cd web && npm install --no-audit --no-fund
cd harness && npm ci --no-audit --no-fund
rustup component add llvm-tools-preview --toolchain stable
command -v cargo-llvm-cov >/dev/null || cargo install cargo-llvm-cov
command -v cargo-deny >/dev/null || cargo install --locked cargo-deny
test:
{{cargo}} test --workspace
README.md+120−87
@@ -1,121 +1,154 @@
# group-host
> **Beta.** group-host is early and changes often. Its `org.atgrp.*`
> lexicons are not yet published and will change, as will the space
> alpha it builds on, so apps and records written against today's will
> break. Don't run it for a group you can't afford to lose.
group-host is a group host for atproto. A group on it is an account of
its own, with no password and no one person behind it. The host is the
group's PDS, the authority for its private spaces and its OAuth server,
and its members' roles decide what anyone may do there. Members keep
their own accounts on their own PDSes, anywhere on the network. It
implements the [Atmosphere Groups spec](https://tangled.org/atmospheregroups.org/spec).
It's one Rust server over SQLite, with a console (a SvelteKit app) where
people start and run groups and approve apps, and a command,
`atgrp`, that does the same from a terminal.
> **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 group server for [atproto](https://atproto.com) that
implements the
[Atmosphere Groups spec](https://tangled.org/atmospheregroups.org/spec).
A group on the host is an atproto account of its own, with no password
and no single person behind it. This host is each group's PDS (the
server that holds its public repo and blobs), the authority for its
private spaces, and its OAuth server. Members keep their own accounts on
their own PDSes anywhere on the network, and their roles in a group
decide what anyone may do there.
The host is one Rust server (`crates/group-host`) over SQLite. Beside it
sit a SvelteKit console (`web/`) where people start and run groups and
approve apps, and the `atgrp` command (`crates/atgrp`) that does the
same from a terminal.
## Highlights
- **Groups are accounts.** Each group has its own `did:plc`, public repo
and handle, on the host's domain or one of its own. Its profile, rules,
roles and memberships are records it keeps in its spaces.
→ [Groups](docs/design/groups.md)
- **Private spaces.** A space is a private record store. The group and
each member write in their own repos there, members on their own PDSes,
and the host decides who reads and writes, gives out credentials and
indexes what was written. → [Spaces](docs/design/spaces.md)
- **Roles decide.** A role grants actions, from inviting to moderating.
People join openly, by approval or by invite, and an invite lands in
their own inbox. Moderators label, work a queue and answer reports and
appeals. → [Membership](docs/design/membership.md),
- **Groups are accounts.** Each group gets its own `did:plc` identity,
public repo, and blobs on the host, with a handle under the host's
`HANDLE_DOMAIN` or on its own domain. It keeps its profile, settings,
rules, roles, memberships, labeler, and space list as `org.atgrp.*`
records in its own `meta` and `members` spaces. →
[Groups](docs/design/groups.md)
- **Private spaces.** A space is a private record store from atproto's
permissioned data, where the group writes in its repo on this
host and each member writes in their own repo on their own PDS. The
host acts as the space's authority, checking reads and writes against
the space's `org.atgrp.policy` and the member's roles. It issues read
credentials and indexes every writer's records so readers can query
the space. → [Spaces](docs/design/spaces.md)
- **Roles, membership, and moderation.** Roles (`org.atgrp.role`) grant
permissions across a group and its spaces, from inviting and admitting
members to moderating. People join openly, by approval, or through an
`org.atgrp.invite` record written into their own `org.atgrp.inbox`
space on their PDS. Moderators apply and remove
`com.atproto.label.record` labels, work a moderation queue, and handle
reports and appeals. → [Membership](docs/design/membership.md),
[Moderation](docs/design/moderation.md)
- **Apps sign in as the group.** A member approves an app over OAuth,
and it gets what that member's roles allow, checked again at every
write. → [Signing in](docs/design/signing-in.md)
- **One command, one tool.** An `atgrp` command acts in a group
as you, and its MCP tool twin acts the same way for a member through an
AI app they connect. Only the commands that make, move or end a group
or an account have no tool. → [MCP](docs/design/mcp.md),
[commands](docs/reference/cli.md)
- **The group can leave.** Stewards hold recovery keys that rank above
the host's own, so they can undo what the host does to the group's
identity. A group moves to another host with its repo, files and
spaces. → [Recovery](docs/design/recovery.md),
[Moving](docs/design/moving.md)
- **Apps sign in as the group.** A member approves an OAuth client on
the console, granting it at most what that member's roles allow. The
host binds tokens with DPoP and checks the member's current roles
again on every write, so a role change takes effect right away. →
[Signing in](docs/design/signing-in.md)
- **One command, one MCP tool.** An `atgrp <group> <action>` command
acts in a group as the person running it, and its MCP (Model Context
Protocol) tool twin `<group>_<action>` at `/mcp` carries out the same
plan for an AI app a member connects to that group. Only the commands
that create, seed, move, or delete a group or import an account, plus
the host-wide `admin` commands, have no tool. →
[MCP](docs/design/mcp.md), [Commands](docs/reference/cli.md)
- **Recovery and moving.** Stewards (members trusted with the group's
identity) can add up to four recovery keys that rank above the host's
rotation key on the group's `did:plc` document, letting them undo PLC
operations the host signed and move the group without the host. A
group can move to another host with its DID, public repo, files, and
spaces. An existing `did:plc` account can also move here to become a
group, and the host can change its own address. →
[Recovery](docs/design/recovery.md), [Moving](docs/design/moving.md)
- **Rate limits.** The host caps how much a caller can ask in fixed time
windows of points counted by client IP (or IPv6 `/64`), by group, or
by signed-in person. When a caller runs out of points, the host
answers `429 RateLimitExceeded` with `Retry-After` and `RateLimit-*`
headers. → [Limits](docs/design/limits.md)
## Quickstart
You need Rust's stable toolchain through rustup, Node at the version
`.node-version` names, `just`, and goat (github.com/bluesky-social/goat)
for the lexicons.
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, install the packages and the tools the checks use, then
start a local world:
```sh
just setup # the console's and harness's packages, and coverage tools
just dev # a PDS, a PLC directory, the host and the console, with two groups
just setup
just dev
```
`just dev` serves the console at https://group-host.localtest.me. Sign
in as `alice.test` with the password `password`. She runs a group,
Riders, and has an invite waiting from bob's group, Hikers. `just dev`
prints the rest: the other accounts, where to read the codes the PDS
emails, and how to run the command against it, such as:
`just dev` builds the lexicon types, `group-host`, and `atgrp`, 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. You can sign in as `alice.test` or
`bob.test` with the password `password`, and `just dev` prints a `just
atgrp` command to run as `alice.test` against her group. To run the
processes on their own, use `just serve` (on `PORT`, `2600` by default)
and `just web-dev`.
```sh
ATGRP_HOST=… PDS_URL=… ATGRP_AS=alice.test ATGRP_PASSWORD=password \
just atgrp group show riders.groups.localtest.me
```
[Development](docs/development.md) has the rest of the dev world, and
`just serve` and `just web-dev` for the host and the console alone.
To deploy, build the image and run it with `deploy/docker-compose.yml`
behind a reverse proxy, as [Deploying](docs/deploying.md) sets out:
To deploy, build the single container 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 up -d
docker compose -f deploy/docker-compose.yml up -d
```
See [Deploying](docs/deploying.md) for release images, reverse proxy
setup, custom domains, and backups.
## Docs
The same pages are a site, made by `docs-site/`.
The pages under `docs/` (also built into a Starlight site by
`docs-site/`):
| | |
| --- | --- |
| [Guides](docs/guides/README.md) | Doing each thing in the console, step by step, with a picture of each screen |
| [Design](docs/design/README.md) | What the host is to a group, where each kind of data lives, and why each part works the way it does |
| [API](docs/reference/api.md) | Every HTTP route and XRPC method, and the errors each answers |
| [Commands](docs/reference/cli.md) | Every `atgrp` command and `just` recipe |
| [MCP tools](docs/reference/mcp.md) | Every tool, and the command it's the twin of |
| [Configuration](docs/reference/config.md) | Every environment variable the host reads |
| [Deploying](docs/deploying.md) | The image, running it behind a proxy, and what to back up |
| [Development](docs/development.md) | Building, testing, the checks a pull runs, and the docs site |
| Page | What's in it |
|---|---|
| [Guides](docs/guides/README.md) | Step-by-step console walkthroughs with light and dark screenshots |
| [Design](docs/design/README.md) | What the host is to a group, where data lives, and how each mechanism works |
| [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) | Building or pulling the image, reverse proxy setup, custom domains, upgrades, and backups |
| [Development](docs/development.md) | Building, testing, pull checks, the docs site, and releasing |
## The pieces
The server is `crates/group-host`, the command `crates/atgrp`, the
MCP tools `crates/group-host-mcp` and the console `web/`. The atproto
primitives are the `atproto` crate, in
[its own repository](https://knotless.dev/chadtmiller.com/atproto).
[The pieces](docs/design/README.md#the-pieces) says what each one holds.
The workspace holds the server in `crates/group-host`, the CLI and
client in `crates/atgrp`, the MCP tools in `crates/group-host-mcp`, the
SvelteKit console in `web/`, the schemas in `lexicons/`, the container
and release files in `Dockerfile` and `deploy/`, the dev and test
harness in `harness/`, and the Starlight site in `docs-site/`. The
`atproto` and `atproto-client` crates live in
[their own repository](https://knotless.dev/chadtmiller.com/atproto),
and the full table is in
[The pieces](docs/design/README.md#the-pieces).
## Development
```sh
just test # every test
just t <args> # the tests those cargo test args pick
just cov # every test, under the 100% gate of lines and functions
just lint # formatting, clippy, the console's layers and dialogs, the type checks
just fmt # rustfmt and oxfmt
just e2e # the console's flows in Chromium
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
just fmt # format Rust with rustfmt and web/harness/docs-site 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. AGENTS.md
is for agents working here.
See [Development](docs/development.md) for what each check runs, and
`AGENTS.md` when working on the repository with a coding agent.
## License
Licensed under MIT ([LICENSE-MIT](LICENSE-MIT)) or Apache-2.0
([LICENSE-APACHE](LICENSE-APACHE)), at your option.
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE)
or [MIT license](LICENSE-MIT), at your option.