Make every pseudo-client a first-class default service
GroupServ, ChanFix, ReportServ, HelpServ and DiceServ were left out of the default service suite, so they came up only when explicitly opted in — an add-on tier the others don't have. They are core services like any other: put them in default_services() so the standard suite is the full set of pseudo-clients, and correct the stale 'NickServ + ChanServ' default in the config comment, main.rs, README and MODULES.
This commit is contained in:
parent
de11939f2e
commit
dfc11bd1c4
3 changed files with 16 additions and 7 deletions
|
|
@ -99,8 +99,8 @@ if enabled("mymod") {
|
||||||
services = ["nickserv", "chanserv", "mymod"]
|
services = ["nickserv", "chanserv", "mymod"]
|
||||||
```
|
```
|
||||||
|
|
||||||
Omitting `[modules]` starts NickServ and ChanServ. A name that isn't built in is
|
Omitting `[modules]` starts the full standard suite (every pseudo-client). A
|
||||||
ignored.
|
name that isn't built in is ignored.
|
||||||
|
|
||||||
## A protocol module
|
## A protocol module
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ pub struct Config {
|
||||||
// Absent = it does not start. Bind to localhost; a token is required.
|
// Absent = it does not start. Bind to localhost; a token is required.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub jsonrpc: Option<JsonRpc>,
|
pub jsonrpc: Option<JsonRpc>,
|
||||||
// Which service modules to start. Absent = the built-in NickServ + ChanServ.
|
// Which service modules to start. Absent = the full standard suite (all the
|
||||||
|
// pseudo-clients); listing it trims that set. Every service is first-class.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub modules: Modules,
|
pub modules: Modules,
|
||||||
// Services operators: accounts granted privileges. Absent = no opers.
|
// Services operators: accounts granted privileges. Absent = no opers.
|
||||||
|
|
@ -132,8 +133,16 @@ impl Default for Modules {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The full standard suite: every pseudo-client is a first-class service and
|
||||||
|
// comes up by default. An admin trims the list; there is no second tier.
|
||||||
fn default_services() -> Vec<String> {
|
fn default_services() -> Vec<String> {
|
||||||
vec!["nickserv".to_string(), "chanserv".to_string(), "botserv".to_string(), "memoserv".to_string(), "statserv".to_string(), "hostserv".to_string(), "operserv".to_string(), "infoserv".to_string()]
|
[
|
||||||
|
"nickserv", "chanserv", "botserv", "hostserv", "memoserv", "operserv", "statserv",
|
||||||
|
"groupserv", "infoserv", "reportserv", "helpserv", "chanfix", "diceserv",
|
||||||
|
]
|
||||||
|
.iter()
|
||||||
|
.map(|s| s.to_string())
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Clone)]
|
#[derive(Debug, Deserialize, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ async fn main() -> Result<()> {
|
||||||
ts,
|
ts,
|
||||||
));
|
));
|
||||||
|
|
||||||
// Bring up the service modules named in [modules] (default NickServ +
|
// Bring up the service modules named in [modules] (default: the full
|
||||||
// ChanServ). Each keeps a fixed uid suffix so its identity is stable no
|
// standard suite — every pseudo-client). Each keeps a fixed uid suffix so
|
||||||
// matter which others are enabled.
|
// its identity is stable no matter which others are enabled.
|
||||||
let enabled = |name: &str| cfg.modules.services.iter().any(|s| s == name);
|
let enabled = |name: &str| cfg.modules.services.iter().any(|s| s == name);
|
||||||
let mut services: Vec<Box<dyn engine::service::Service>> = Vec::new();
|
let mut services: Vec<Box<dyn engine::service::Service>> = Vec::new();
|
||||||
if enabled("nickserv") {
|
if enabled("nickserv") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue