From a985e9209bc233407b7078e9f45663baa5c7f29b Mon Sep 17 00:00:00 2001 From: PsykotropyK Date: Mon, 13 Mar 2017 01:22:49 +0100 Subject: [PATCH 1/3] Update ClientCreateParams.cs Removed those lines /** TEMPORARY: DELETE LATER **/ builder.AppendFormat(" --SocksPort 9050"); as it prevents to use the SetConfig(ConfigurationNames.SocksPort, Port0 --> 2 command would be append and it would crash. --- src/Tor/ClientCreateParams.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Tor/ClientCreateParams.cs b/src/Tor/ClientCreateParams.cs index 8cec8fb..72b1168 100644 --- a/src/Tor/ClientCreateParams.cs +++ b/src/Tor/ClientCreateParams.cs @@ -192,9 +192,6 @@ public override string ToString() builder.Append("--allow-missing-torrc "); builder.AppendFormat("--ControlPort {0}", controlPort); - /** TEMPORARY: DELETE LATER **/ - builder.AppendFormat(" --SocksPort 9050"); - if (!string.IsNullOrWhiteSpace(configurationFile)) builder.AppendFormat(" -f \"{0}\"", configurationFile); From ea95771c353297b3e4ecb3b122bd52f3458e6b99 Mon Sep 17 00:00:00 2001 From: PsykotropyK Date: Mon, 13 Mar 2017 01:24:26 +0100 Subject: [PATCH 2/3] Update ConfigurationNames.cs Add the DataDirectory command line option. the Configuration.cs is changed accordingly --- src/Tor/Configuration/Enumerators/ConfigurationNames.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Tor/Configuration/Enumerators/ConfigurationNames.cs b/src/Tor/Configuration/Enumerators/ConfigurationNames.cs index 7e53a8b..ac2d401 100644 --- a/src/Tor/Configuration/Enumerators/ConfigurationNames.cs +++ b/src/Tor/Configuration/Enumerators/ConfigurationNames.cs @@ -43,6 +43,9 @@ public enum ConfigurationNames [ConfigurationAssoc("ConstrainedSockSize", Default = 8388608.0, Type = typeof(Bytes), Validation = ConfigurationValidation.NonNull | ConfigurationValidation.SizeDivision)] ConstrainedSockSize, + [ConfigurationAssoc("DataDirectory", Default = null, Type = typeof(string))] + DataDirectory, + [ConfigurationAssoc("DisableNetwork", Default = false, Type = typeof(bool))] DisableNetwork, From 937a0f89acb1979ca6170b80f1a31f73a4cc256c Mon Sep 17 00:00:00 2001 From: PsykotropyK Date: Mon, 13 Mar 2017 01:25:30 +0100 Subject: [PATCH 3/3] Update Configuration.cs Add the DataDirectory option. The ConfigurationNames.cs is changed accordingly --- src/Tor/Configuration/Configuration.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Tor/Configuration/Configuration.cs b/src/Tor/Configuration/Configuration.cs index 823f005..24f7420 100644 --- a/src/Tor/Configuration/Configuration.cs +++ b/src/Tor/Configuration/Configuration.cs @@ -139,6 +139,15 @@ public int ControlPort set { SetValue(ConfigurationNames.ControlPort, value); } } + /// + /// Gets or sets the data directory path. + /// + public string DataDirectory + { + get { return GetValue(ConfigurationNames.DataDirectory) as string; } + set { SetValue(ConfigurationNames.DataDirectory, value); } + } + /// /// Gets or sets a value indicating whether the Tor application shouldn't listen for accept any connections other than control connections. ///