Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
trudyhood committed Jan 19, 2023
2 parents 469c50d + 50ed382 commit 216c73c
Show file tree
Hide file tree
Showing 21 changed files with 129 additions and 44 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# v2.6.337
# v2.6.338
### Server
* Feature: Report server public IPs to log
* Update: Improve IPv6 stability

### Server
* Fix: It doesn't generate log
* Feature: Add linux-arm64 installation
Expand Down
4 changes: 2 additions & 2 deletions Pub/Version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Major": 2,
"Minor": 6,
"Build": 337,
"BumpTime": "2023-01-18T18:23:03.5889252Z",
"Build": 339,
"BumpTime": "2023-01-19T06:54:34.7813738Z",
"Prerelease": false
}
2 changes: 1 addition & 1 deletion VpnHood.Client.App.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="336" package="com.vpnhood.client.android" android:installLocation="auto" android:versionName="2.6.336">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="338" package="com.vpnhood.client.android" android:installLocation="auto" android:versionName="2.6.338">
<uses-sdk android:minSdkVersion="22" android:targetSdkVersion="33" />
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Client.App.UI/VpnHood.Client.App.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageIcon>VpnHood.png</PackageIcon>
<Description>Tiny internal webserver to server your single-page application (SPA). You need this only if you want to create a UI for your VpnHood client by single-page application (SPA).</Description>
<PackageId>VpnHood.Client.App.UI</PackageId>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Client.App.Win/VpnHood.Client.App.Win.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageId>VpnHood.Client.App.Win</PackageId>
<StartupObject></StartupObject>
<Version>2.6.336</Version>
<AssemblyVersion>2.6.336</AssemblyVersion>
<FileVersion>2.6.336</FileVersion>
<Version>2.6.338</Version>
<AssemblyVersion>2.6.338</AssemblyVersion>
<FileVersion>2.6.338</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Client.App/VpnHood.Client.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Description>Readymade Vpn App skeleton for VpnHood clients. You just need to create a UI on it.</Description>
<PackageId>VpnHood.Client.App</PackageId>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<PackageIcon>VpnHood.png</PackageIcon>
<Description>VpnHood client device provider for Windows using WinDivert.</Description>
<Version>2.6.337</Version>
<Version>2.6.339</Version>
<PackageId>VpnHood.Client.Device.WinDivert</PackageId>
<Version>1.1.226</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Client.Device/VpnHood.Client.Device.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<RepositoryType></RepositoryType>
<PackageId>VpnHood.Client.Device</PackageId>
<RootNamespace>VpnHood.Client.Device</RootNamespace>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Client/VpnHood.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<Copyright>2022 VpnHood</Copyright>
<PackageId>VpnHood.Client</PackageId>
<PackageTags>VPN VpnClient Proxy</PackageTags>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion VpnHood.Client/VpnHoodClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ private void Dispose(Exception ex)

public void Dispose()
{
DisposeAsync().GetAwaiter().GetResult();
Task.Run(async () => await DisposeAsync(), CancellationToken.None).GetAwaiter().GetResult();
}

private readonly AsyncLock _disposeLock = new();
Expand Down
8 changes: 6 additions & 2 deletions VpnHood.Common/Net/IPAddressUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ public static async Task<IPAddress[]> GetPublicIpAddresses()
{
try
{
//var url = addressFamily == AddressFamily.InterNetwork
// ? "https://api.ipify.org?format=json"
// : "https://api6.ipify.org?format=json";

var url = addressFamily == AddressFamily.InterNetwork
? "https://api.ipify.org?format=json"
: "https://api64.ipify.org?format=json";
? "https://ip4.seeip.org/json"
: "https://ip6.seeip.org/json";

using var httpClient = new HttpClient();
httpClient.Timeout = timeout ?? TimeSpan.FromSeconds(5);
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Common/VpnHood.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageId>VpnHood.Common</PackageId>
<PackageIcon>VpnHood.png</PackageIcon>
<Description>VpnHood Common Library is shared among all other VpnHood modules.</Description>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions VpnHood.Server.Access/SessionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ public class SessionOptions
public int? NetScanLimit { get; set; }
public TimeSpan? NetScanTimeout { get; set; }
public bool UseUdpProxy2 { get; set; }
public bool AllowIpV6 { get; set; } = true;
}
6 changes: 3 additions & 3 deletions VpnHood.Server.Access/VpnHood.Server.Access.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageId>VpnHood.Server.Access</PackageId>
<PackageIcon>VpnHood.png</PackageIcon>
<Description>Stores, and retrieves end users' access and usage. Provides required interfaces and classes to use or create an access server and accounting.</Description>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
37 changes: 37 additions & 0 deletions VpnHood.Server.App.Net/Pub/publish_linux_arm64.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Write-Host;
Write-Host "*** Creating Linux Server Module..." -BackgroundColor Blue -ForegroundColor White;

# Init script
$projectDir = Split-Path $PSScriptRoot -Parent;
$projectFile = (Get-ChildItem -path $projectDir -file -Filter "*.csproj").FullName;
. "$projectDir/../Pub/Common.ps1";

#update project version
UpdateProjectVersion $projectFile;

# prepare module folders
$moduleDir = "$packagesServerDir/linux-arm64";
$moduleDirLatest = "$packagesServerDirLatest/linux-arm64";
PrepareModuleFolder $moduleDir $moduleDirLatest;

# Creating linux package
$templateDir = "$PSScriptRoot/Linux";
$template_installScriptFile = "$templateDir/install.sh";
$template_launcherFile = "$templateDir/vhserver.sh";
$template_updaterFile = "$templateDir/updater.sh";

$publishDir = "$projectDir/bin/release/publish-linux";
$publish_infoDir = "$publishDir/$versionTag/publish_info";
$publish_updaterFile = "$publish_infoDir/vhupdate";
$publish_launcherFile = "$publish_infoDir/vhserver";
$publish_InfoFile = "$publish_infoDir/publish.json";

$module_InfoFile = "$moduleDir/VpnHoodServer-linux-arm64.json";
$module_InstallerFile = "$moduleDir/VpnHoodServer-linux-arm64.sh";
$module_PackageFile = "$moduleDir/VpnHoodServer-linux-arm64.tar.gz";

$lineEnding = "`n";
$runtime = "linux-arm64";
$launcher_exeFile = "$versionTag/VpnHoodServer";

. "$PSScriptRoot\publish_impl.ps1";
37 changes: 37 additions & 0 deletions VpnHood.Server.App.Net/Pub/publish_linux_x64.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Write-Host;
Write-Host "*** Creating Linux Server Module..." -BackgroundColor Blue -ForegroundColor White;

# Init script
$projectDir = Split-Path $PSScriptRoot -Parent;
$projectFile = (Get-ChildItem -path $projectDir -file -Filter "*.csproj").FullName;
. "$projectDir/../Pub/Common.ps1";

#update project version
UpdateProjectVersion $projectFile;

# prepare module folders
$moduleDir = "$packagesServerDir/linux-x64";
$moduleDirLatest = "$packagesServerDirLatest/linux-x64";
PrepareModuleFolder $moduleDir $moduleDirLatest;

# Creating linux package
$templateDir = "$PSScriptRoot/Linux";
$template_installScriptFile = "$templateDir/install.sh";
$template_launcherFile = "$templateDir/vhserver.sh";
$template_updaterFile = "$templateDir/updater.sh";

$publishDir = "$projectDir/bin/release/publish-linux";
$publish_infoDir = "$publishDir/$versionTag/publish_info";
$publish_updaterFile = "$publish_infoDir/vhupdate";
$publish_launcherFile = "$publish_infoDir/vhserver";
$publish_InfoFile = "$publish_infoDir/publish.json";

$module_InfoFile = "$moduleDir/VpnHoodServer-linux-x64.json";
$module_InstallerFile = "$moduleDir/VpnHoodServer-linux-x64.sh";
$module_PackageFile = "$moduleDir/VpnHoodServer-linux-x64.tar.gz";

$lineEnding = "`n";
$runtime = "linux-x64";
$launcher_exeFile = "$versionTag/VpnHoodServer";

. "$PSScriptRoot\publish_impl.ps1";
6 changes: 3 additions & 3 deletions VpnHood.Server.App.Net/VpnHood.Server.App.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
<PackageIcon>VpnHood.png</PackageIcon>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Server/VpnHood.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<PackageIcon>VpnHood.png</PackageIcon>
<Description>The core of VpnHood server. It can listen and accept connections from VpnHood clients.</Description>
<PackageId>VpnHood.Server</PackageId>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
9 changes: 6 additions & 3 deletions VpnHood.Server/VpnHoodServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private async Task Configure()
var providerSystemInfo = SystemInfoProvider.GetSystemInfo();
var serverInfo = new ServerInfo(
environmentVersion: Environment.Version,
version: typeof(VpnHoodServer).Assembly.GetName().Version,
version: GetType().Assembly.GetName().Version,
privateIpAddresses: await IPAddressUtil.GetPrivateIpAddresses(),
publicIpAddresses: _publicIpDiscovery ? await IPAddressUtil.GetPublicIpAddresses() : Array.Empty<IPAddress>(),
status: Status
Expand All @@ -143,7 +143,10 @@ private async Task Configure()
LogicalCoreCount = providerSystemInfo.LogicalCoreCount,
LastError = _lastConfigError
};
var isIpv6Supported = serverInfo.PublicIpAddresses.Any(x => x.AddressFamily == AddressFamily.InterNetworkV6);

var publicIpV4 = serverInfo.PublicIpAddresses.SingleOrDefault(x => x.AddressFamily == AddressFamily.InterNetwork);
var publicIpV6 = serverInfo.PublicIpAddresses.SingleOrDefault(x => x.AddressFamily == AddressFamily.InterNetworkV6);
VhLogger.Instance.LogInformation($"Public IPv4: {VhLogger.Format(publicIpV4)}, Public IPv6: {VhLogger.Format(publicIpV6)}");

// get configuration from access server
VhLogger.Instance.LogTrace("Sending config request to the Access Server...");
Expand All @@ -162,7 +165,7 @@ private async Task Configure()
var verb = _tcpHost.IsStarted ? "Restarting" : "Starting";
VhLogger.Instance.LogInformation($"{verb} {VhLogger.FormatTypeName(_tcpHost)}...");
if (_tcpHost.IsStarted) await _tcpHost.Stop();
_tcpHost.Start(serverConfig.TcpEndPoints, isIpv6Supported);
_tcpHost.Start(serverConfig.TcpEndPoints, publicIpV6 != null);

// set config status
State = ServerState.Ready;
Expand Down
1 change: 0 additions & 1 deletion VpnHood.Tunneling/UdpProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using PacketDotNet;
using VpnHood.Common.Collections;
using VpnHood.Common.Logging;
using VpnHood.Common.Utils;
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Tunneling/VpnHood.Tunneling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<PackageIcon>VpnHood.png</PackageIcon>
<Product>VpnHood.Tunneling</Product>
<Description>Provides tunnelling classes and protocols shared between VpnHood.Client and VpnHood.Server.</Description>
<Version>2.6.337</Version>
<AssemblyVersion>2.6.337</AssemblyVersion>
<FileVersion>2.6.337</FileVersion>
<Version>2.6.339</Version>
<AssemblyVersion>2.6.339</AssemblyVersion>
<FileVersion>2.6.339</FileVersion>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down

0 comments on commit 216c73c

Please sign in to comment.