operserv: REHASH reloads config live without a restart
All checks were successful
CI / check (push) Successful in 3m54s
All checks were successful
CI / check (push) Successful in 3m54s
This commit is contained in:
parent
e112b8737c
commit
64b675e61f
8 changed files with 126 additions and 1 deletions
15
modules/operserv/src/rehash.rs
Normal file
15
modules/operserv/src/rehash.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use echo_api::{Priv, Sender, ServiceCtx};
|
||||
|
||||
// REHASH: re-read config.toml and apply the settings that are safe to change
|
||||
// while linked (opers, standard-replies, services channel, service oper-type,
|
||||
// expiry, session limits) without restarting — so no relink and no user
|
||||
// disruption. Admin-only. Server identity, service umodes and the keycard
|
||||
// endpoint still need a RESTART. The engine does the re-read off the command
|
||||
// path and notices the outcome (or a parse error, keeping the old config).
|
||||
pub fn handle(me: &str, from: &Sender, ctx: &mut ServiceCtx) {
|
||||
if !from.privs.has(Priv::Admin) {
|
||||
ctx.notice(me, from.uid, "Access denied — REHASH needs the \x02admin\x02 privilege.");
|
||||
return;
|
||||
}
|
||||
ctx.rehash(me, from.uid);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue