Struct routinator::config::Config[][src]

pub struct Config {
Show fields pub cache_dir: PathBuf, pub tal_dir: PathBuf, pub exceptions: Vec<PathBuf>, pub strict: bool, pub stale: FilterPolicy, pub unsafe_vrps: FilterPolicy, pub unknown_objects: FilterPolicy, pub allow_dubious_hosts: bool, pub fresh: bool, pub disable_rsync: bool, pub rsync_command: String, pub rsync_args: Option<Vec<String>>, pub rsync_timeout: Duration, pub disable_rrdp: bool, pub rrdp_fallback_time: Duration, pub rrdp_timeout: Option<Option<Duration>>, pub rrdp_connect_timeout: Option<Duration>, pub rrdp_local_addr: Option<IpAddr>, pub rrdp_root_certs: Vec<PathBuf>, pub rrdp_proxies: Vec<String>, pub rrdp_user_agent: String, pub rrdp_keep_responses: Option<PathBuf>, pub max_object_size: Option<u64>, pub dirty_repository: bool, pub validation_threads: usize, pub refresh: Duration, pub retry: Duration, pub expire: Duration, pub history_size: usize, pub rtr_listen: Vec<SocketAddr>, pub http_listen: Vec<SocketAddr>, pub systemd_listen: bool, pub rtr_tcp_keepalive: Option<Duration>, pub rtr_client_metrics: bool, pub log_level: LevelFilter, pub log_target: LogTarget, pub pid_file: Option<PathBuf>, pub working_dir: Option<PathBuf>, pub chroot: Option<PathBuf>, pub user: Option<String>, pub group: Option<String>, pub tal_labels: HashMap<String, String>,
}
Expand description

Routinator configuration.

This type contains both the basic configuration of Routinator, such as where to keep the repository and how to update it, as well as the configuration for server mode.

All values are public and can be accessed directly.

The two functions config_args and server_args can be used to create the clap application. Its matches can then be used to create the basic config via from_arg_matches. If the RTR server configuration is necessary, it can be added via apply_server_arg_matches from the server subcommand matches.

The methods init_logging and switch_logging can be used to configure logging according to the strategy provided by the configuration. On Unix systems only, the method daemonize creates a correctly configured Daemonizer. Finally, to_toml can be used to produce a TOML value that contains a configuration file content representing the current configuration.

Fields

cache_dir: PathBuf
Expand description

Path to the directory that contains the repository cache.

tal_dir: PathBuf
Expand description

Path to the directory that contains the trust anchor locators.

exceptions: Vec<PathBuf>
Expand description

Paths to the local exceptions files.

strict: bool
Expand description

Should we do strict validation?

See the relevant RPKI crate documentation for more information.

stale: FilterPolicy
Expand description

How should we deal with stale objects?

Stale objects are manifests and CRLs that have a next_update field in the past. The current version of the protocol leaves the decision how to interpret stale objects to local policy. This configuration value configures this policy.

Since the upcoming version of the protocol clarifies that these objects should be rejected, this is the default policy.

unsafe_vrps: FilterPolicy
Expand description

How should we deal with unsafe VRPs?

Unsafe VRPs have their prefix intersect with a prefix held by a rejected CA. Allowing such VRPs may lead to legitimate routes being flagged as RPKI invalid. To avoid this, these can VRPs can be filtered.

The default for now is to warn about them.

unknown_objects: FilterPolicy
Expand description

How to deal with unknown RPKI object types.

allow_dubious_hosts: bool
Expand description

Allow dubious host names.

fresh: bool
Expand description

Should we wipe the cache before starting?

(This option is only available on command line.)

disable_rsync: bool
Expand description

Whether to disable rsync.

rsync_command: String
Expand description

The command to run for rsync.

rsync_args: Option<Vec<String>>
Expand description

Optional arguments passed to rsync.

If these are present, they overide the arguments automatically determined otherwise. Thus, Some<Vec::new()> will supress all arguments.

rsync_timeout: Duration
Expand description

Timeout for rsync commands.

disable_rrdp: bool
Expand description

Whether to disable RRDP.

rrdp_fallback_time: Duration
Expand description

Time since last update of an RRDP repository before fallback to rsync.

rrdp_timeout: Option<Option<Duration>>
Expand description

Optional RRDP timeout in seconds.

If this is not set, the default timeouts of the reqwest crate are used. Use Some(None) for no timeout.

rrdp_connect_timeout: Option<Duration>
Expand description

Optional RRDP connect timeout in seconds.

rrdp_local_addr: Option<IpAddr>
Expand description

Optional RRDP local address to bind to when doing requests.

rrdp_root_certs: Vec<PathBuf>
Expand description

RRDP additional root certificates for HTTPS.

These do not overide the default system root certififcates.

rrdp_proxies: Vec<String>
Expand description

RRDP HTTP proxies.

rrdp_user_agent: String
Expand description

RRDP HTTP User Agent.

rrdp_keep_responses: Option<PathBuf>
Expand description

Should we keep RRDP responses and if so where?

max_object_size: Option<u64>
Expand description

Optional size limit for objects.

dirty_repository: bool
Expand description

Wether to not cleanup the repository directory after a validation run.

If this is false and update has not been disabled otherwise, all data for rsync modules (if rsync is enabled) and RRDP servers (if RRDP is enabled) that have not been used during validation will be deleted.

validation_threads: usize
Expand description

Number of threads used during validation.

refresh: Duration
Expand description

The refresh interval for repository validation.

retry: Duration
Expand description

The RTR retry inverval to be announced to a client.

expire: Duration
Expand description

The RTR expire time to be announced to a client.

history_size: usize
Expand description

How many diffs to keep in the history.

rtr_listen: Vec<SocketAddr>
Expand description

Addresses to listen on for RTR TCP transport connections.

http_listen: Vec<SocketAddr>
Expand description

Addresses to listen on for HTTP monitoring connectsion.

systemd_listen: bool
Expand description

Whether to get the listening sockets from systemd.

rtr_tcp_keepalive: Option<Duration>
Expand description

The length of the TCP keep-alive timeout for RTR TCP sockets.

If this is None, TCP keep-alive will not be enabled.

rtr_client_metrics: bool
Expand description

Should we publish detailed RTR client statistics?

log_level: LevelFilter
Expand description

The log levels to be logged.

log_target: LogTarget
Expand description

The target to log to.

pid_file: Option<PathBuf>
Expand description

The optional PID file for server mode.

working_dir: Option<PathBuf>
Expand description

The optional working directory for server mode.

chroot: Option<PathBuf>
Expand description

The optional directory to chroot to in server mode.

user: Option<String>
Expand description

The name of the user to change to in server mode.

group: Option<String>
Expand description

The name of the group to change to in server mode.

tal_labels: HashMap<String, String>
Expand description

A mapping of TAL file names to TAL labels.

Implementations

impl Config[src]

pub fn config_args<'a: 'b, 'b>(app: App<'a, 'b>) -> App<'a, 'b>[src]

Adds the basic arguments to a clapp app.

The function follows clap’s builder pattern: it takes an app, adds a bunch of arguments to it and returns it at the end.

pub fn server_args<'a: 'b, 'b>(app: App<'a, 'b>) -> App<'a, 'b>[src]

Adds the relevant config args to the server subcommand.

Some of the options in the config only make sense for the RTR server. Having them in the global part of the clap command line is confusing, so we stick to defaults unless we actually run the server. This function adds the relevant arguments to the subcommand provided via app.

It follows clap’s builder pattern and returns the app with all arguments added.

pub fn from_arg_matches(
    matches: &ArgMatches<'_>,
    cur_dir: &Path
) -> Result<Self, Failed>
[src]

Creates a configuration from command line matches.

The function attempts to create configuration from the command line arguments provided via matches. It will try to read a config file if provided via the config file option (-c or --config) or a file in $HOME/.routinator.conf otherwise. If the latter doesn’t exist either, starts with a default configuration.

All relative paths given in command line arguments will be interpreted relative to cur_dir. Conversely, paths in the config file are treated as relative to the config file’s directory.

If you are runming in server mode, you need to also apply the server arguments via apply_server_arg_matches.

pub fn apply_server_arg_matches(
    &mut self,
    matches: &ArgMatches<'_>,
    cur_dir: &Path
) -> Result<(), Failed>
[src]

Applies the RTR server command line arguments to an existing config.

All paths used in arguments are interpreted relative to cur_dir.

pub fn adjust_chroot_paths(&mut self) -> Result<(), Failed>[src]

Alters paths so that they are relative to a possible chroot.

pub fn to_toml(&self) -> Value[src]

Returns a TOML representation of the config.

Trait Implementations

impl Clone for Config[src]

fn clone(&self) -> Config[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Config[src]

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

Formats the value using the given formatter. Read more

impl Default for Config[src]

fn default() -> Self[src]

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

impl Display for Config[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<Config> for Config[src]

fn eq(&self, other: &Config) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Config) -> bool[src]

This method tests for !=.

impl Eq for Config[src]

impl StructuralEq for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

Compare self to key and return true if they are equal.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V