pub struct CliArgs {Show 17 fields
pub state_file: Option<PathBuf>,
pub generate_config: Option<PathBuf>,
pub loglevel: Option<String>,
pub logfile: Option<String>,
pub config_file: PathBuf,
pub control_ip: Option<String>,
pub control_port: Option<u16>,
pub control_socket: Option<PathBuf>,
pub control_pass: Option<String>,
pub retry_limit: Option<u32>,
pub one_shot_vanguards: bool,
pub disable_vanguards: bool,
pub disable_bandguards: bool,
pub disable_rendguard: bool,
pub disable_logguard: bool,
pub enable_cbtverify: bool,
pub enable_pathverify: bool,
}Expand description
Command-line arguments for vanguards-rs.
This struct is used by clap to parse command-line arguments. Arguments override configuration file values, allowing runtime customization without modifying config files.
§Configuration Precedence
Configuration is applied in the following order (later sources override earlier):
- Built-in defaults
- Configuration file (TOML)
- Environment variables (
VANGUARDS_STATE,VANGUARDS_CONFIG) - Command-line arguments
§Usage
vanguards-rs [OPTIONS]§Options
§Connection Options
| Option | Description |
|---|---|
--control-ip <IP> | IP address of the Tor control port (default: 127.0.0.1) |
--control-port <PORT> | Tor control port number (typically 9051) |
--control-socket <PATH> | Path to Tor control socket (e.g., /run/tor/control) |
--control-pass <PASS> | Tor control port password for authentication |
§File Options
| Option | Description |
|---|---|
--state <FILE> | Path to the vanguard state file [env: VANGUARDS_STATE] |
--config <FILE> | Path to configuration file [env: VANGUARDS_CONFIG] [default: vanguards.conf] |
--generate_config <FILE> | Write default config to file and exit |
§Logging Options
| Option | Description |
|---|---|
--loglevel <LEVEL> | Log verbosity: DEBUG, INFO, NOTICE, WARN, ERROR |
--logfile <FILE> | Log to file instead of stdout (use “:syslog:” for syslog) |
§Component Control
| Option | Description |
|---|---|
--disable-vanguards | Disable vanguard selection |
--disable-bandguards | Disable bandwidth monitoring |
--disable-rendguard | Disable rendezvous point monitoring |
--disable-logguard | Disable log monitoring |
--enable-cbtverify | Enable circuit build timeout verification |
--enable-pathverify | Enable path verification |
§Operational Options
| Option | Description |
|---|---|
--retry-limit <N> | Reconnection attempt limit (default: infinite) |
--one-shot-vanguards | Set vanguards and exit immediately |
§Help Options
| Option | Description |
|---|---|
-h, --help | Print help (see a summary with ‘-h’) |
-V, --version | Print version |
§Examples
Connect to Tor via control port:
vanguards-rs --control-ip 127.0.0.1 --control-port 9051Connect via Unix socket with password:
vanguards-rs --control-socket /run/tor/control --control-pass mypasswordGenerate a default configuration file:
vanguards-rs --generate_config vanguards.confRun with custom state file and debug logging:
vanguards-rs --state /var/lib/tor/vanguards.state --loglevel DEBUGDisable specific components:
vanguards-rs --disable-bandguards --disable-logguardOne-shot mode (set vanguards and exit):
vanguards-rs --one-shot-vanguards§Environment Variables
VANGUARDS_STATE: Path to the vanguard state file (equivalent to--state)VANGUARDS_CONFIG: Path to configuration file (equivalent to--config)
§See Also
Configfor the full configuration structureload_configfor the configuration loading function
Fields§
§state_file: Option<PathBuf>Path to the vanguard state file.
The state file stores persistent vanguard selections and rendguard statistics. If not specified, defaults to “vanguards.state” in the current directory.
generate_config: Option<PathBuf>Write default config to file and exit.
Generates a TOML configuration file with all default values and documentation. Useful for creating a starting point for customization.
loglevel: Option<String>Log verbosity (DEBUG, INFO, NOTICE, WARN, ERROR).
Controls the amount of output. DEBUG is most verbose, ERROR is least. Default is NOTICE.
logfile: Option<String>Log to file instead of stdout (use “:syslog:” for syslog).
By default, logs go to stdout. Specify a file path to redirect logs, or use the special value “:syslog:” to send logs to the system logger.
config_file: PathBufPath to configuration file.
TOML configuration file containing all settings. Command-line arguments override values from this file.
control_ip: Option<String>IP address of the Tor control port.
Can be an IPv4 address, IPv6 address, or hostname (will be resolved). Default is 127.0.0.1.
control_port: Option<u16>Tor control port number.
The TCP port where Tor’s control interface is listening. Typically 9051 for the Tor daemon.
control_socket: Option<PathBuf>Path to Tor control socket.
Unix domain socket path for Tor control connection. Takes precedence over TCP connection if specified. Common paths: /run/tor/control, /var/run/tor/control
control_pass: Option<String>Tor control port password.
Password for HashedControlPassword authentication. If not provided and required, will prompt interactively.
retry_limit: Option<u32>Reconnection attempt limit (default: infinite).
Maximum number of times to attempt reconnection to Tor after connection loss. Set to 0 for infinite retries.
one_shot_vanguards: boolSet vanguards and exit.
Configure Tor with vanguard settings, save the configuration, and exit immediately. Useful for one-time setup.
disable_vanguards: boolDisable vanguard selection.
Prevents vanguards-rs from selecting and configuring vanguard relays. Other monitoring components will still run if enabled.
disable_bandguards: boolDisable bandwidth monitoring.
Disables the bandguards component that monitors circuit bandwidth for potential side-channel attacks.
disable_rendguard: boolDisable rendezvous point monitoring.
Disables the rendguard component that monitors rendezvous point usage for statistical anomalies.
disable_logguard: boolDisable log monitoring.
Disables the logguard component that monitors Tor logs for security-relevant events.
enable_cbtverify: boolEnable circuit build timeout verification.
Enables the cbtverify component that monitors circuit construction timing for anomalies. Disabled by default.
enable_pathverify: boolEnable path verification.
Enables the pathverify component that verifies circuit paths conform to vanguard configuration. Disabled by default.
Implementations§
Trait Implementations§
Source§impl Args for CliArgs
impl Args for CliArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl FromArgMatches for CliArgs
impl FromArgMatches for CliArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.