pub struct ApiConfig {
pub bind: String,
pub token: Option<String>,
pub token_file: Option<String>,
pub no_token: bool,
pub allow_any_addr: bool,
}Expand description
Daemon status API over TCP ([api]).
rchd’s rich state (/status, /workers/capabilities) lives on a 0600
Unix socket, which only the local user can read. This section opens the
same JSON on a TCP listener so agents and the fleet dashboard on OTHER
machines can ask a dispatcher “why are you local-only right now?” without
ssh. It is meant for a tailnet: the bind address must be loopback or a
Tailscale address (100.64.0.0/10, fd7a:115c:a1e0::/48) unless
allow_any_addr is set, and every status route requires the bearer token
unless token is unset AND no_token is explicitly true.
[api]
bind = "tailscale" # or "tailscale:9101", "100.68.51.94:9101", "127.0.0.1:9101"
token = "…" # or token_file = "~/.config/rch/api.token"Fields§
§bind: StringWhere to listen. "tailscale" resolves this machine’s Tailscale IPv4
at startup (default port 9101); "tailscale:PORT", "IP:PORT" or
"[v6]:PORT" are taken literally. Unset (empty) = API off.
token: Option<String>Bearer token required on /status and /workers/capabilities.
token_file: Option<String>File holding the bearer token (trimmed). Takes precedence over token.
no_token: boolServe the status routes with NO token. Only honoured when no token is configured; must be set explicitly so an empty token is never an accidental open door.
allow_any_addr: boolPermit a bind address outside loopback and the Tailscale ranges.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ApiConfig
impl<'de> Deserialize<'de> for ApiConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ApiConfig
impl StructuralPartialEq for ApiConfig
Auto Trait Implementations§
impl Freeze for ApiConfig
impl RefUnwindSafe for ApiConfig
impl Send for ApiConfig
impl Sync for ApiConfig
impl Unpin for ApiConfig
impl UnsafeUnpin for ApiConfig
impl UnwindSafe for ApiConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.