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:
parent
6f76f9722c
commit
ad2a623120
116 changed files with 69 additions and 46 deletions
51
Cargo.toml
51
Cargo.toml
|
|
@ -1,5 +1,24 @@
|
||||||
[workspace]
|
[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]
|
[package]
|
||||||
name = "fedserv"
|
name = "fedserv"
|
||||||
|
|
@ -9,21 +28,21 @@ description = "Federated IRC services daemon (protocol-agnostic core, InspIRCd l
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "api" }
|
fedserv-api = { path = "api" }
|
||||||
fedserv-inspircd = { path = "inspircd" }
|
fedserv-inspircd = { path = "modules/inspircd" }
|
||||||
fedserv-chanserv = { path = "chanserv" }
|
fedserv-chanserv = { path = "modules/chanserv" }
|
||||||
fedserv-nickserv = { path = "nickserv" }
|
fedserv-nickserv = { path = "modules/nickserv" }
|
||||||
fedserv-example = { path = "example" }
|
fedserv-example = { path = "modules/example" }
|
||||||
fedserv-botserv = { path = "botserv" }
|
fedserv-botserv = { path = "modules/botserv" }
|
||||||
fedserv-memoserv = { path = "memoserv" }
|
fedserv-memoserv = { path = "modules/memoserv" }
|
||||||
fedserv-statserv = { path = "statserv" }
|
fedserv-statserv = { path = "modules/statserv" }
|
||||||
fedserv-hostserv = { path = "hostserv" }
|
fedserv-hostserv = { path = "modules/hostserv" }
|
||||||
fedserv-operserv = { path = "operserv" }
|
fedserv-operserv = { path = "modules/operserv" }
|
||||||
fedserv-diceserv = { path = "diceserv" }
|
fedserv-diceserv = { path = "modules/diceserv" }
|
||||||
fedserv-infoserv = { path = "infoserv" }
|
fedserv-infoserv = { path = "modules/infoserv" }
|
||||||
fedserv-reportserv = { path = "reportserv" }
|
fedserv-reportserv = { path = "modules/reportserv" }
|
||||||
fedserv-groupserv = { path = "groupserv" }
|
fedserv-groupserv = { path = "modules/groupserv" }
|
||||||
fedserv-chanfix = { path = "chanfix" }
|
fedserv-chanfix = { path = "modules/chanfix" }
|
||||||
fedserv-helpserv = { path = "helpserv" }
|
fedserv-helpserv = { path = "modules/helpserv" }
|
||||||
tokio = { version = "1", features = ["net", "io-util", "rt-multi-thread", "macros", "time", "sync", "process"] }
|
tokio = { version = "1", features = ["net", "io-util", "rt-multi-thread", "macros", "time", "sync", "process"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|
|
||||||
14
MODULES.md
14
MODULES.md
|
|
@ -11,22 +11,22 @@ There are two kinds of module.
|
||||||
- A **service** (a pseudo-client like NickServ) implements `Service`.
|
- A **service** (a pseudo-client like NickServ) implements `Service`.
|
||||||
- A **protocol** (an ircd link like InspIRCd) implements `Protocol`.
|
- A **protocol** (an ircd link like InspIRCd) implements `Protocol`.
|
||||||
|
|
||||||
Both live in their own crate under the workspace. `example/` is a complete,
|
Both live in their own crate under `modules/`. `modules/example/` is a complete,
|
||||||
minimal service to copy from; `inspircd/` is the reference protocol.
|
minimal service to copy from; `modules/inspircd/` is the reference protocol.
|
||||||
|
|
||||||
## A service, end to end
|
## A service, end to end
|
||||||
|
|
||||||
**1. The crate.** One dependency:
|
**1. The crate.** One dependency:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# mymod/Cargo.toml
|
# modules/mymod/Cargo.toml
|
||||||
[package]
|
[package]
|
||||||
name = "fedserv-mymod"
|
name = "fedserv-mymod"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
```
|
```
|
||||||
|
|
||||||
**2. The service.** A plain struct implementing `Service`:
|
**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
|
```toml
|
||||||
# Cargo.toml
|
# Cargo.toml
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [..., "mymod"]
|
members = [..., "modules/mymod"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-mymod = { path = "mymod" }
|
fedserv-mymod = { path = "modules/mymod" }
|
||||||
```
|
```
|
||||||
|
|
||||||
Construct it in `src/main.rs` alongside the others, behind its config name:
|
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
|
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
|
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
|
`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.
|
`InspIrcd` is constructed.
|
||||||
|
|
||||||
## What the SDK deliberately does not give you
|
## What the SDK deliberately does not give you
|
||||||
|
|
|
||||||
20
README.md
20
README.md
|
|
@ -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
|
through the `Store`/`NetView` traits, so the log, gossip and credential material
|
||||||
stay out of a module's reach.
|
stay out of a module's reach.
|
||||||
- **`src/gossip.rs`** node-to-node replication over the logs.
|
- **`src/gossip.rs`** node-to-node replication over the logs.
|
||||||
- **`inspircd/`** (`fedserv-inspircd`) the ircd link layer. A `Protocol` impl maps
|
- **`modules/`** the loadable modules, each its own crate depending only on the
|
||||||
raw server-to-server lines to and from the normalized model, so the engine never
|
`fedserv-api` SDK:
|
||||||
touches a raw line and a new ircd is one new crate.
|
- **`modules/inspircd/`** (`fedserv-inspircd`) the ircd link layer. A `Protocol`
|
||||||
- **`nickserv/`, `chanserv/`, `botserv/`, `memoserv/`, `statserv/`, `hostserv/`,
|
impl maps raw server-to-server lines to and from the normalized model, so the
|
||||||
`operserv/`** the pseudo-clients, each a crate implementing `Service`. OperServ
|
engine never touches a raw line and a new ircd is one new crate.
|
||||||
holds the network-operator tools (AKILL network bans to start); the rest follow
|
- **`modules/nickserv/`, `modules/chanserv/`, `modules/botserv/`,
|
||||||
the same shape.
|
`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
|
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
|
## Replication
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "BotServ: registers and manages service bots that sit in channels."
|
description = "BotServ: registers and manages service bots that sit in channels."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "ChanFix: reop opless unregistered channels from accumulated op-time scores."
|
description = "ChanFix: reop opless unregistered channels from accumulated op-time scores."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "ChanServ channel-registration service module for fedserv."
|
description = "ChanServ channel-registration service module for fedserv."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,5 +5,5 @@ edition = "2021"
|
||||||
description = "DiceServ: a dice-roll and math-expression service for tabletop games over IRC."
|
description = "DiceServ: a dice-roll and math-expression service for tabletop games over IRC."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "A minimal example service module: the template a new pseudo-client is copied from."
|
description = "A minimal example service module: the template a new pseudo-client is copied from."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "GroupServ: user groups (!name) whose members can be granted channel access together."
|
description = "GroupServ: user groups (!name) whose members can be granted channel access together."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "HelpServ: a help-desk queue — users ask, operators take and answer."
|
description = "HelpServ: a help-desk queue — users ask, operators take and answer."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "HostServ: assign and apply virtual hosts (vhosts)."
|
description = "HostServ: assign and apply virtual hosts (vhosts)."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "InfoServ: network information bulletins shown on connect (public) and on oper login."
|
description = "InfoServ: network information bulletins shown on connect (public) and on oper login."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "InspIRCd server-to-server protocol module for fedserv."
|
description = "InspIRCd server-to-server protocol module for fedserv."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "MemoServ: deliver messages to registered users, online or not."
|
description = "MemoServ: deliver messages to registered users, online or not."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "NickServ account-registration service module for fedserv."
|
description = "NickServ account-registration service module for fedserv."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fedserv-api = { path = "../api" }
|
fedserv-api = { path = "../../api" }
|
||||||
|
|
@ -5,4 +5,4 @@ edition = "2021"
|
||||||
description = "OperServ: network operator tools, starting with AKILL network bans."
|
description = "OperServ: network operator tools, starting with AKILL network bans."
|
||||||
|
|
||||||
[dependencies]
|
[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
Loading…
Add table
Add a link
Reference in a new issue