Skip to content

topl-core-base / io.matthewnelson.topl_core_base / TorConfigFiles


class TorConfigFiles :BaseConsts (source)

Holds Tor configuration information for files and directories that Tor will use.

See Companion.createConfig or Builder to instantiate.

When modifying/querying Files, ensure you are using synchronized and acquiring the appropriate FileLock object pertaining to that File. This inhibits errors across the library.

See extension function readTorConfigFile.


Name Summary
Builder Builder for TorConfig.class Builder


Name Summary
configDir val configDir:File
controlPortFile val controlPortFile:File
controlPortFileLock val controlPortFileLock:Object
cookieAuthFile Used for cookie authentication with the controller. Location can be overridden by the CookieAuthFile config option. Regenerated on startup. See control-spec.txt in torspec for details.val cookieAuthFile:File
cookieAuthFileLock val cookieAuthFileLock:Object
dataDir val dataDir:File
dataDirLock val dataDirLock:Object
fileCreationTimeout When tor starts it waits for the control port and cookie auth files to be created before it proceeds to the next step in startup. If these files are not created after a certain amount of time, then the startup has failed.val fileCreationTimeout:Int
geoIpFile val geoIpFile:File
geoIpFileLock val geoIpFileLock:Object
geoIpv6File val geoIpv6File:File
geoIpv6FileLock val geoIpv6FileLock:Object
hiddenServiceDir val hiddenServiceDir:File
hostnameFile The <base32-encoded-fingerprint>.onion domain name for this hidden service. If the hidden service is restricted to authorized clients only, this file also contains authorization data for all clients.val hostnameFile:File
hostnameFileLock val hostnameFileLock:Object
installDir val installDir:File
libraryPath val libraryPath:File?
resolvConfFileLock val resolvConfFileLock:Object
resolveConf val resolveConf:File
torExecutableFile val torExecutableFile:File
torrcFile var torrcFile:File
torrcFileLock val torrcFileLock:Object
v3AuthPrivateDir val v3AuthPrivateDir:File
v3AuthPrivateDirLock val v3AuthPrivateDirLock:Object


Name Summary
resolveTorrcFile Resolves the tor configuration file. If the torrc file hasn’t been set, then this method will attempt to resolve the config file by looking in the root of the $configDir and then in $user.home directoryfun resolveTorrcFile():File
toString fun toString():String

Companion Object Functions

Name Summary
createConfig Convenience method for if you’re including in your App’s jniLibs directory the binary, or utilizing those maintained by this createConfig(context:Context, configDir:File, dataDir:File? = null):TorConfigFiles
Convenience method for setting up all of your files and directories in their default createConfig(context:Context):TorConfigFiles