diff --git a/NOnion.Tests/FallbackDirectorySelector.cs b/NOnion.Tests/FallbackDirectorySelector.cs index a63d18b3..1bed1455 100644 --- a/NOnion.Tests/FallbackDirectorySelector.cs +++ b/NOnion.Tests/FallbackDirectorySelector.cs @@ -14,7 +14,7 @@ static internal IPEndPoint GetRandomFallbackDirectory() { if (fallbackDirectories == null) { - var urlToTorServerList = "https://raw.githubusercontent.com/torproject/tor/main/src/app/config/fallback_dirs.inc"; + var urlToTorServerList = "https://gitlab.torproject.org/tpo/core/tor/-/raw/main/src/app/config/fallback_dirs.inc"; using var webClient = new WebClient(); var fetchedInfo = webClient.DownloadString(urlToTorServerList); diff --git a/NOnion.Tests/HiddenServicesTests.cs b/NOnion.Tests/HiddenServicesTests.cs index 2223639b..5c09f617 100644 --- a/NOnion.Tests/HiddenServicesTests.cs +++ b/NOnion.Tests/HiddenServicesTests.cs @@ -51,7 +51,7 @@ public void Init() private async Task CreateIntroductionCircuit() { - using TorClient torClient = await TorClient.BootstrapWithGithubAsync(cachePath); + using TorClient torClient = await TorClient.BootstrapWithGitlabAsync(cachePath); var circuit = await torClient.CreateCircuitAsync(1, CircuitPurpose.Unknown, FSharpOption.None); await circuit.RegisterAsIntroductionPointAsync(FSharpOption.None, StubCallback, DisconnectionCallback); } @@ -76,7 +76,7 @@ private async Task CreateRendezvousCircuit() var array = new byte[Constants.RendezvousCookieLength]; RandomNumberGenerator.Create().GetNonZeroBytes(array); - using TorClient torClient = await TorClient.BootstrapWithGithubAsync(cachePath); + using TorClient torClient = await TorClient.BootstrapWithGitlabAsync(cachePath); var circuit = await torClient.CreateCircuitAsync(2, CircuitPurpose.Unknown, FSharpOption.None); await circuit.RegisterAsRendezvousPointAsync(array); } @@ -103,7 +103,7 @@ private async Task ReadExact(TorStream stream, byte[] buffer, int off, int public async Task BrowseFacebookOverHS() { - using TorClient torClient = await TorClient.BootstrapWithGithubAsync(cachePath); + using TorClient torClient = await TorClient.BootstrapWithGitlabAsync(cachePath); var serviceClient = await TorServiceClient.ConnectAsync(torClient, "facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion"); var stream = await serviceClient.GetStreamAsync(); @@ -129,7 +129,7 @@ public void CanBrowseFacebookOverHS() public async Task BrowseFacebookOverHSWithTLS() { - using TorClient torClient = await TorClient.BootstrapWithGithubAsync(cachePath); + using TorClient torClient = await TorClient.BootstrapWithGitlabAsync(cachePath); var serviceClient = await TorServiceClient.ConnectAsync(torClient, "facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion:443"); var stream = await serviceClient.GetStreamAsync(); @@ -159,7 +159,7 @@ public void CanBrowseFacebookOverHSWithTLS() public async Task EstablishAndCommunicateOverHSConnectionOnionStyle() { - using TorClient torClient = await TorClient.BootstrapWithGithubAsync(cachePath); + using TorClient torClient = await TorClient.BootstrapWithGitlabAsync(cachePath); TorLogger.Log("Finished bootstraping"); diff --git a/NOnion.Tests/TorClientTests.cs b/NOnion.Tests/TorClientTests.cs index c7cb3ef4..d017ca16 100644 --- a/NOnion.Tests/TorClientTests.cs +++ b/NOnion.Tests/TorClientTests.cs @@ -10,15 +10,15 @@ namespace NOnion.Tests { public class TorClientTests { - private async Task BootstrapWithGithub() + private async Task BootstrapWithGitlab() { - await TorClient.BootstrapWithGithubAsync(FSharpOption.None); + await TorClient.BootstrapWithGitlabAsync(FSharpOption.None); } [Test] - public void CanBootstrapWithGithub() + public void CanBootstrapWithGitlab() { - Assert.DoesNotThrowAsync(BootstrapWithGithub); + Assert.DoesNotThrowAsync(BootstrapWithGitlab); } private async Task BootstrapWithEmbeddedList() diff --git a/NOnion/Client/TorClient.fs b/NOnion/Client/TorClient.fs index b23b02d0..dc8dde56 100644 --- a/NOnion/Client/TorClient.fs +++ b/NOnion/Client/TorClient.fs @@ -113,7 +113,7 @@ type TorClient internal (directory: TorDirectory) = = TorClient.AsyncBootstrapWithEmbeddedList cachePath |> Async.StartAsTask - static member AsyncBootstrapWithGithub(cachePath: Option) = + static member AsyncBootstrapWithGitlab(cachePath: Option) = async { // Don't put this inside the fallbackListString or it gets disposed // before the task gets executed @@ -121,15 +121,15 @@ type TorClient internal (directory: TorDirectory) = let! fallbackListString = let urlToTorServerList = - "https://raw.githubusercontent.com/torproject/tor/main/src/app/config/fallback_dirs.inc" + "https://gitlab.torproject.org/tpo/core/tor/-/raw/main/src/app/config/fallback_dirs.inc" httpClient.GetStringAsync urlToTorServerList |> Async.AwaitTask return! CreateClientFromFallbackString fallbackListString cachePath } - static member BootstrapWithGithubAsync(cachePath: Option) = - TorClient.AsyncBootstrapWithGithub cachePath |> Async.StartAsTask + static member BootstrapWithGitlabAsync(cachePath: Option) = + TorClient.AsyncBootstrapWithGitlab cachePath |> Async.StartAsTask member __.Directory = directory diff --git a/README.md b/README.md index e10cd808..d425d13b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Install via NuGet: To utilize the Tor network, start by bootstrapping your directory. This step involves downloading the most recent information about available routers and their identity keys. To initiate the bootstrapping process, you require a list of initial nodes for communication. In NOnion, there are two methods to obtain this list: -1- [Download from Github](https://github.com/torproject/tor/blob/main/src/app/config/fallback_dirs.inc) +1- [Download from GitLab](https://gitlab.torproject.org/tpo/core/tor/-/raw/main/src/app/config/fallback_dirs.inc) 2- Utilize the embedded list in the NOnion binary (Note: this list could potentially be outdated) Based on what option you choose use one of the following commands to bootstrap a TorClient object: @@ -41,7 +41,7 @@ let! torClient = TorClient.AsyncBootstrapWithEmbeddedList None ``` ### OR ``` -let! torClient = TorClient.AsyncBootstrapWithGithub None +let! torClient = TorClient.AsyncBootstrapWithGitlab None ``` ## Browsing the web