Group the module crates under modules/

The service pseudo-clients and the ircd protocol link sat flat at the
repo root, mixed in with the daemon core and the SDK. Move them all
under modules/ so the tree separates concerns cleanly: the daemon in
src/, the SDK every module links against in api/, and the loadable
modules — the pseudo-clients plus the protocol link — in modules/.

Workspace members, the daemon's per-crate dependency paths, and each
module's api path are updated to match; the docs follow. No code change.
This commit is contained in:
Jean Chevronnet 2026-07-14 14:19:43 +00:00
parent 6f76f9722c
commit ad2a623120
No known key found for this signature in database
116 changed files with 69 additions and 46 deletions

View file

@ -1,5 +1,24 @@
[workspace]
members = ["api", "inspircd", "chanserv", "nickserv", "example", "botserv", "memoserv", "statserv", "hostserv", "operserv", "diceserv", "infoserv", "reportserv", "groupserv", "chanfix", "helpserv"]
# api is the SDK every module links against; the loadable modules — the service
# pseudo-clients and the ircd protocol link — live under modules/.
members = [
"api",
"modules/inspircd",
"modules/chanserv",
"modules/nickserv",
"modules/example",
"modules/botserv",
"modules/memoserv",
"modules/statserv",
"modules/hostserv",
"modules/operserv",
"modules/diceserv",
"modules/infoserv",
"modules/reportserv",
"modules/groupserv",
"modules/chanfix",
"modules/helpserv",
]
[package]
name = "fedserv"
@ -9,21 +28,21 @@ description = "Federated IRC services daemon (protocol-agnostic core, InspIRCd l
[dependencies]
fedserv-api = { path = "api" }
fedserv-inspircd = { path = "inspircd" }
fedserv-chanserv = { path = "chanserv" }
fedserv-nickserv = { path = "nickserv" }
fedserv-example = { path = "example" }
fedserv-botserv = { path = "botserv" }
fedserv-memoserv = { path = "memoserv" }
fedserv-statserv = { path = "statserv" }
fedserv-hostserv = { path = "hostserv" }
fedserv-operserv = { path = "operserv" }
fedserv-diceserv = { path = "diceserv" }
fedserv-infoserv = { path = "infoserv" }
fedserv-reportserv = { path = "reportserv" }
fedserv-groupserv = { path = "groupserv" }
fedserv-chanfix = { path = "chanfix" }
fedserv-helpserv = { path = "helpserv" }
fedserv-inspircd = { path = "modules/inspircd" }
fedserv-chanserv = { path = "modules/chanserv" }
fedserv-nickserv = { path = "modules/nickserv" }
fedserv-example = { path = "modules/example" }
fedserv-botserv = { path = "modules/botserv" }
fedserv-memoserv = { path = "modules/memoserv" }
fedserv-statserv = { path = "modules/statserv" }
fedserv-hostserv = { path = "modules/hostserv" }
fedserv-operserv = { path = "modules/operserv" }
fedserv-diceserv = { path = "modules/diceserv" }
fedserv-infoserv = { path = "modules/infoserv" }
fedserv-reportserv = { path = "modules/reportserv" }
fedserv-groupserv = { path = "modules/groupserv" }
fedserv-chanfix = { path = "modules/chanfix" }
fedserv-helpserv = { path = "modules/helpserv" }
tokio = { version = "1", features = ["net", "io-util", "rt-multi-thread", "macros", "time", "sync", "process"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

View file

@ -11,22 +11,22 @@ There are two kinds of module.
- A **service** (a pseudo-client like NickServ) implements `Service`.
- A **protocol** (an ircd link like InspIRCd) implements `Protocol`.
Both live in their own crate under the workspace. `example/` is a complete,
minimal service to copy from; `inspircd/` is the reference protocol.
Both live in their own crate under `modules/`. `modules/example/` is a complete,
minimal service to copy from; `modules/inspircd/` is the reference protocol.
## A service, end to end
**1. The crate.** One dependency:
```toml
# mymod/Cargo.toml
# modules/mymod/Cargo.toml
[package]
name = "fedserv-mymod"
version = "0.0.1"
edition = "2021"
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }
```
**2. The service.** A plain struct implementing `Service`:
@ -76,10 +76,10 @@ an IRC-originated one does — you do not write any replication code.
```toml
# Cargo.toml
[workspace]
members = [..., "mymod"]
members = [..., "modules/mymod"]
[dependencies]
fedserv-mymod = { path = "mymod" }
fedserv-mymod = { path = "modules/mymod" }
```
Construct it in `src/main.rs` alongside the others, behind its config name:
@ -107,7 +107,7 @@ ignored.
A protocol crate implements `Protocol`: it turns raw server-to-server lines into
the normalized `NetEvent`s the engine understands, and turns the engine's
`NetAction`s back into raw lines. The engine never sees a raw line, so supporting
another ircd is one new crate — see `inspircd/`. Wire it in `src/main.rs` where
another ircd is one new crate — see `modules/inspircd/`. Wire it in `src/main.rs` where
`InspIrcd` is constructed.
## What the SDK deliberately does not give you

View file

@ -20,16 +20,20 @@ workspace, each depending only on the `fedserv-api` SDK crate.
through the `Store`/`NetView` traits, so the log, gossip and credential material
stay out of a module's reach.
- **`src/gossip.rs`** node-to-node replication over the logs.
- **`inspircd/`** (`fedserv-inspircd`) the ircd link layer. A `Protocol` impl maps
raw server-to-server lines to and from the normalized model, so the engine never
touches a raw line and a new ircd is one new crate.
- **`nickserv/`, `chanserv/`, `botserv/`, `memoserv/`, `statserv/`, `hostserv/`,
`operserv/`** the pseudo-clients, each a crate implementing `Service`. OperServ
holds the network-operator tools (AKILL network bans to start); the rest follow
the same shape.
- **`modules/`** the loadable modules, each its own crate depending only on the
`fedserv-api` SDK:
- **`modules/inspircd/`** (`fedserv-inspircd`) the ircd link layer. A `Protocol`
impl maps raw server-to-server lines to and from the normalized model, so the
engine never touches a raw line and a new ircd is one new crate.
- **`modules/nickserv/`, `modules/chanserv/`, `modules/botserv/`,
`modules/memoserv/`, `modules/statserv/`, `modules/hostserv/`, `modules/operserv/`**
and diceserv, infoserv, reportserv, groupserv, chanfix, helpserv — the
pseudo-clients, each a crate implementing `Service`. OperServ holds the
network-operator tools (AKILL network bans to start); the rest follow the same
shape.
Writing your own module — a service or a new ircd protocol — is documented in
[MODULES.md](MODULES.md); `example/` is a minimal service to copy from.
[MODULES.md](MODULES.md); `modules/example/` is a minimal service to copy from.
## Replication

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "BotServ: registers and manages service bots that sit in channels."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "ChanFix: reop opless unregistered channels from accumulated op-time scores."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "ChanServ channel-registration service module for fedserv."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,5 +5,5 @@ edition = "2021"
description = "DiceServ: a dice-roll and math-expression service for tabletop games over IRC."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }
rand = "0.8"

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "A minimal example service module: the template a new pseudo-client is copied from."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "GroupServ: user groups (!name) whose members can be granted channel access together."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "HelpServ: a help-desk queue — users ask, operators take and answer."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "HostServ: assign and apply virtual hosts (vhosts)."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "InfoServ: network information bulletins shown on connect (public) and on oper login."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "InspIRCd server-to-server protocol module for fedserv."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "MemoServ: deliver messages to registered users, online or not."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "NickServ account-registration service module for fedserv."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

View file

@ -5,4 +5,4 @@ edition = "2021"
description = "OperServ: network operator tools, starting with AKILL network bans."
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }

Some files were not shown because too many files have changed in this diff Show more