HostServ: temporary vhosts (expiry)

SET <account> <host> [duration] assigns a vhost that lapses after the
duration (e.g. 30d); a Vhost carries an optional expiry and the store hides
an expired one lazily (like a suspension), so it stops applying on identify/
ON without a sweep. LIST flags temporary vhosts.
This commit is contained in:
Jean Chevronnet 2026-07-13 22:53:04 +00:00
parent 87bad7fbcc
commit 271e06fa77
No known key found for this signature in database
8 changed files with 81 additions and 28 deletions

View file

@ -383,6 +383,7 @@ pub struct VhostView {
pub account: String,
pub host: String,
pub setter: String,
pub expires: Option<u64>,
}
#[derive(Debug, Clone)]
@ -596,7 +597,7 @@ pub trait Store {
fn set_email(&mut self, account: &str, email: Option<String>) -> Result<(), RegError>;
fn set_greet(&mut self, account: &str, greet: &str) -> Result<(), RegError>;
// HostServ vhosts.
fn set_vhost(&mut self, account: &str, host: &str, setter: &str) -> Result<(), RegError>;
fn set_vhost(&mut self, account: &str, host: &str, setter: &str, ttl: Option<u64>) -> Result<(), RegError>;
fn del_vhost(&mut self, account: &str) -> Result<bool, RegError>;
fn vhost(&self, account: &str) -> Option<VhostView>;
fn vhosts(&self) -> Vec<VhostView>;