pub struct Args {Show 36 fields
pub host: IpAddr,
pub host_explicit: bool,
pub port: u16,
pub port_explicit: bool,
pub config: Option<PathBuf>,
pub api_key: Option<String>,
pub no_auth: bool,
pub require_auth: bool,
pub capabilities: Vec<String>,
pub preset: Option<String>,
pub no_rate_limit: bool,
pub tunnel: bool,
pub tunnel_command: Option<String>,
pub relay: bool,
pub relay_url: Option<String>,
pub enroll_token: Option<String>,
pub public_base: Option<String>,
pub device_name: Option<String>,
pub tls_cert: Option<PathBuf>,
pub tls_key: Option<PathBuf>,
pub tls_self_signed: bool,
pub relay_fingerprint: Option<String>,
pub relay_ca: Option<PathBuf>,
pub allow_hosts: Vec<String>,
pub audit_log: Option<PathBuf>,
pub fs_root: Option<PathBuf>,
pub fs_chunk_size: Option<usize>,
pub audit_max_bytes_raw: Option<u64>,
pub kill_orphans: bool,
pub cors_allow_any: bool,
pub log_level: Option<String>,
pub version: bool,
pub help: bool,
pub check_update: bool,
pub update: bool,
pub no_update_check: bool,
}Expand description
Command-line arguments.
Fields§
§host: IpAddrHost address to bind to.
host_explicit: boolWhether the bind address was stated rather than defaulted.
Without this the default is indistinguishable from a choice, and
apply_args overwrites a configured server.host with 127.0.0.1 for
a user who passed no flag at all. Since 0.14.0 that field also decides
the security posture, so “not stated” has to be a fact the config layer
can read rather than one it has to guess.
port: u16Port to listen on.
port_explicit: boolWhether the port was stated rather than defaulted.
A relay-attached device serves only itself on loopback, so the port is an
implementation detail there — but only if the user did not ask for one.
Also what keeps apply_args from overwriting a configured
server.port, the same way host_explicit does above.
config: Option<PathBuf>Path to configuration file.
api_key: Option<String>API key for authentication (overrides config file).
no_auth: boolDisable authentication.
require_auth: boolRequire authentication, auto-generating an API key if none is provided.
capabilities: Vec<String>Capability strings scoping the issued token(s) (empty = full-control).
preset: Option<String>Role preset scoping the issued token(s) (operator/file-write/file-read/full-control).
no_rate_limit: boolDisable rate limiting.
tunnel: boolExpose the server through a Cloudflare quick tunnel.
tunnel_command: Option<String>Expose the server through an arbitrary tunnel command.
relay: boolRun as a relay server (shell-tunnel relay) instead of a shell gateway.
relay_url: Option<String>Attach to this relay instead of publishing through a tunnel.
enroll_token: Option<String>Shared secret devices present to attach to this relay.
public_base: Option<String>Public base URL this relay is reachable at.
device_name: Option<String>Stable name to claim on the relay (keeps one URL across reconnects).
tls_cert: Option<PathBuf>PEM certificate chain for serving HTTPS directly.
tls_key: Option<PathBuf>PEM private key matching tls_cert.
tls_self_signed: boolGenerate a self-signed certificate when none is present.
relay_fingerprint: Option<String>Expect exactly this certificate fingerprint from the relay.
relay_ca: Option<PathBuf>Extra PEM certificate authority to trust when dialling a relay.
allow_hosts: Vec<String>Additional host names this server answers to.
audit_log: Option<PathBuf>Append an audit trail of executions and refusals to this file.
fs_root: Option<PathBuf>Directory the filesystem API is confined to. None disables the API.
fs_chunk_size: Option<usize>Chunk size advertised to upload clients, in bytes.
audit_max_bytes_raw: Option<u64>Rotation limit for the audit trail exactly as the operator wrote it.
None means the flag was absent, which is not the same as unbounded —
see Args::audit_rotation_limit, which is what callers should use.
Kept raw so the three cases (absent / a size / an explicit 0) stay
distinguishable here.
kill_orphans: boolKill whatever a command leaves running when the command ends.
Off by default: a command that deliberately starts a daemon expects it
to outlive the request, and turning that off by default would break it
silently. See src/process.rs.
cors_allow_any: boolAllow any CORS origin (permissive; opt-in for browser UIs).
log_level: Option<String>Log level (error, warn, info, debug, trace).
version: boolShow version and exit.
help: boolShow help and exit.
check_update: boolCheck for updates and exit.
update: boolPerform self-update and exit.
no_update_check: boolDisable automatic update check on startup.
Implementations§
Source§impl Args
impl Args
Sourcepub fn audit_rotation_limit(&self) -> Option<u64>
pub fn audit_rotation_limit(&self) -> Option<u64>
The audit rotation limit to apply, or None to never rotate.
Three inputs, three answers, and the middle one is the reason this is a method rather than a field read:
--audit-max-bytes | result |
|---|---|
| absent | audit::DEFAULT_MAX_BYTES |
0 | None — never rotate |
N | Some(N) |
0 has to mean “unbounded” rather than “rotate immediately”, because
rotating at zero bytes would rotate on every single entry and keep
nothing. It is also the escape hatch for an operator who had the old
unbounded behaviour and wants it back.