Skip to main content

OperatorSection

Struct OperatorSection 

Source
pub struct OperatorSection {
    pub session_ttl_secs: Option<u64>,
    pub grace_window_hours: Option<i64>,
    pub never_wrote_min_idle_secs: Option<u64>,
    pub dns_resolver: Option<String>,
}
Expand description

The operator: how long their sign-in lasts, and how long their claim outlives a poll that cannot see it.

Reload: needs a restart. The TTL is read once when the sign-in is built, and a session already issued keeps the lifetime it was issued with; the grace window is handed to the operator poll when it is spawned.

Fields§

§session_ttl_secs: Option<u64>

How long a signed-in operator stays signed in, in seconds. Mirrors --operator-session-ttl.

Reasonable range: 300 to 86_400 — five minutes to a day.

Below five minutes an operator is signing in again mid-incident, which is the one time the round trip to their own server is least welcome. Above a day the window in which a borrowed browser stays the operator outlives any sitting a person actually had. The built-in default is twelve hours: one working day, so a sign-in in the morning does not expire before the evening.

Nothing enforces the range — it is documented for whoever sets this, not checked — but a value outside it is worth a second thought.

§grace_window_hours: Option<i64>

Hours an unreachable operator keeps this deployment writing, counted from the moment their bot.did.operator claim stops standing. No flag mirrors this, only this key. Applied to didbot_serve::operator_poll::configure.

Only a running server counts it. One restarted while the operator’s PDS is down boots unclaimed, and refuses writes and creates until that PDS answers, however long this is.

Reasonable range: 1 to 168 — an hour to a week.

This is a trade between two ways of being wrong. Short, and an operator whose own PDS is down for an afternoon takes this deployment’s accounts down with it, because the poll cannot see a claim that is still there. Long, and an operator who has genuinely stood down leaves accounts writing under a vouch nobody is behind. An hour is about as short as the poll’s own interval makes meaningful; a week outlasts most outages and most holidays. The built-in default is six hours: long enough to sleep through, short enough that a stood-down operator is not a month of writes.

§never_wrote_min_idle_secs: Option<u64>

The shortest idleFor a neverWrote account delete takes, in seconds. A shorter one is refused. No flag mirrors this, only this key.

Reasonable range: 3600 to 604_800 — an hour to a week.

An agent’s account is created before its session makes its first write. Below an hour, a delete can take an account that is about to write. The built-in default is an hour. Nothing enforces the range, but zero is read as one second, since a delete always names a span.

§dns_resolver: Option<String>

The DNS-over-HTTPS resolver the operator’s handle is checked through: it is asked for the _atproto TXT record under the handle the operator’s DID document claims, before the homepage names them by it. Default https://cloudflare-dns.com/dns-query.

Reasonable range: an https:// DNS-over-HTTPS (RFC 8484) endpoint that also answers the JSON form, ?name=&type=TXT answered as application/dns-json: Cloudflare’s, Google’s at https://dns.google/resolve, or one on this deployment’s own network. Anything else refuses startup. Whoever runs the resolver sees the operator’s handle once per operator poll.

Trait Implementations§

Source§

impl Clone for OperatorSection

Source§

fn clone(&self) -> OperatorSection

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OperatorSection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OperatorSection

Source§

fn default() -> OperatorSection

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OperatorSection

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for OperatorSection

Source§

fn eq(&self, other: &OperatorSection) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for OperatorSection

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for OperatorSection

Source§

impl StructuralPartialEq for OperatorSection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,