HostServ: forbidden-vhost patterns + auto-vhost template

FORBID <regex> / FORBIDLIST / FORBIDDEL let operators block impersonating
user requests (e.g. (?i)(admin|staff)); REQUEST refuses a matching host.
Matching reuses the linear-time RegexSet, so untrusted patterns are safe.

TEMPLATE <$account...> sets a network auto-vhost pattern; DEFAULT gives a
user $account.users.example with their sanitised account name. HostServ's
node config (offers/forbidden/template) is consolidated into one HostConfig
threaded through the log replay.
This commit is contained in:
Jean Chevronnet 2026-07-13 22:42:25 +00:00
parent 2c32dcdc63
commit 6a8e02f004
No known key found for this signature in database
9 changed files with 302 additions and 22 deletions

View file

@ -154,7 +154,10 @@ fn to_wire(entry: &LogEntry) -> Option<ReplicationEvent> {
| Event::BotAdded(_)
| Event::BotRemoved { .. }
| Event::VhostOfferAdded { .. }
| Event::VhostOfferRemoved { .. } => return None,
| Event::VhostOfferRemoved { .. }
| Event::VhostForbidAdded { .. }
| Event::VhostForbidRemoved { .. }
| Event::VhostTemplateSet { .. } => return None,
};
Some(ReplicationEvent { origin: entry.origin().to_string(), seq: entry.seq(), lamport: entry.lamport(), kind: Some(kind) })
}