pub struct EngineConfig {Show 15 fields
pub node_bin: PathBuf,
pub agent_path: PathBuf,
pub mode: String,
pub device_token: String,
pub relay_addr: String,
pub control_plane: String,
pub local_port: u16,
pub mgmt_secret: String,
pub frp_token: Option<String>,
pub frpc_bin: Option<PathBuf>,
pub cert_mode: Option<String>,
pub first_party_app: Option<String>,
pub engine_version: Option<String>,
pub work_dir: Option<PathBuf>,
pub mgmt_port: Option<u16>,
}Expand description
Everything needed to launch a bundled engine. The host resolves the paths (from its Tauri resources / sidecars) and the credential, then hands them off.
Fields§
§node_bin: PathBufProgram to run (the bundled Node runtime, or "node" in dev).
agent_path: PathBufThe bundled agent.mjs.
mode: String--mode (usually "portal").
device_token: StringPer-device credential (env AGENT_DEVICE_TOKEN — never argv).
relay_addr: String--relay-addr (may be host or host:port).
control_plane: String--control-plane URL.
local_port: u16--local-port the agent serves on (default 8443).
mgmt_secret: StringOwner-tier secret (env AGENT_MGMT_SECRET — never argv).
frp_token: Option<String>Relay token (env AGENT_FRP_TOKEN — never argv; omitted when empty).
frpc_bin: Option<PathBuf>--frpc-bin — the pinned sidecar (omitted in dev / with an override).
cert_mode: Option<String>--cert-mode (acme in release; None keeps the agent’s static default).
first_party_app: Option<String>--first-party-app — auto-approve this app’s own publish (embeds only).
engine_version: Option<String>--engine-version — stamp reported by /engine/info (from bundle.json).
work_dir: Option<PathBuf>--work-dir — private state dir (None = platform default).
mgmt_port: Option<u16>--mgmt-port — override the default 8765 (None = default).
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn portal(
node_bin: PathBuf,
agent_path: PathBuf,
device_token: String,
relay_addr: String,
control_plane: String,
mgmt_secret: String,
) -> Self
pub fn portal( node_bin: PathBuf, agent_path: PathBuf, device_token: String, relay_addr: String, control_plane: String, mgmt_secret: String, ) -> Self
A minimal portal-mode config; fill in the optionals as needed.
Sourcepub fn to_args(&self) -> Vec<String>
pub fn to_args(&self) -> Vec<String>
Build the agent argument vector (everything after the program + agent.mjs). Optional flags are emitted only when set, so a bare config produces exactly the flags a plain portal agent needs.
SECRETS ARE NEVER HERE. argv is world-readable on the machine (ps,
Activity Monitor), so the device token, relay token, and mgmt secret
travel via [to_envs] instead — the agent’s arg() helper already
falls back to AGENT_<NAME> env vars, and older agents that only read
argv simply never receive them from THIS launcher (they get them from
their own, older launcher).
Sourcepub fn to_envs(&self) -> Vec<(String, String)>
pub fn to_envs(&self) -> Vec<(String, String)>
The secrets, as env vars for the agent’s AGENT_<NAME> fallback —
invisible to ps, unlike argv. Empty values are skipped: the agent’s
own defaults for them are empty too, so absence means the same thing.
Sourcepub fn command(&self) -> Command
pub fn command(&self) -> Command
Build the spawn Command (program + agent.mjs + args + secret envs).
The caller may still set stdio, extra env, and platform creation flags
before spawning.
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more