OperServ: add SET READONLY lockdown
All checks were successful
CI / check (push) Successful in 3m31s
All checks were successful
CI / check (push) Successful in 3m31s
This commit is contained in:
parent
b2442f85e6
commit
0027decdb7
8 changed files with 112 additions and 2 deletions
|
|
@ -197,6 +197,17 @@ impl Db {
|
|||
self.defcon = level.clamp(1, 5);
|
||||
}
|
||||
|
||||
/// Whether the services are in operator read-only lockdown.
|
||||
pub fn readonly(&self) -> bool {
|
||||
self.log.readonly
|
||||
}
|
||||
|
||||
/// Enter or leave read-only lockdown: while on, locally-authored writes are
|
||||
/// refused. Ephemeral (never persisted); gossip ingestion is unaffected.
|
||||
pub fn set_readonly(&mut self, on: bool) {
|
||||
self.log.readonly = on;
|
||||
}
|
||||
|
||||
/// Whether new nick/account registrations are frozen (defcon 3 or lower).
|
||||
pub fn registrations_frozen(&self) -> bool {
|
||||
self.defcon <= 3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue