Function base_resolver

Source
pub(crate) fn base_resolver() -> CfgPathResolver
Expand description

A CfgPathResolver with the base variables configured for a Tor relay.

A relay should have a single CfgPathResolver that is passed around where needed to ensure that all parts of the relay are resolving paths consistently using the same variables. If you need to resolve a path, you likely want a reference to the existing resolver, and not to create a new one here.

The supported variables are:

  • ARTI_RELAY_CACHE: An arti-specific cache directory.
  • ARTI_RELAY_CONFIG: An arti-specific configuration directory.
  • ARTI_RELAY_SHARED_DATA: An arti-specific directory in the user’s “shared data” space.
  • ARTI_RELAY_LOCAL_DATA: An arti-specific directory in the user’s “local data” space.
  • PROGRAM_DIR: The directory of the currently executing binary. See documentation for std::env::current_exe for security notes.
  • USER_HOME: The user’s home directory.

These variables are implemented using the [directories] crate, and so should use appropriate system-specific overrides under the hood. (Some of those overrides are based on environment variables.) For more information, see that crate’s documentation.