Skip to content

Commit

Permalink
Merge branch 'release/3.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindaugas Veblauskas committed Oct 16, 2023
2 parents d7c6aee + a1090f8 commit 217bf56
Show file tree
Hide file tree
Showing 78 changed files with 2,036 additions and 359 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,6 @@ dotnet_diagnostic.ide1006.severity=warning
# Ignore that our code is compatible only with Windows
# CA1416: Validate platform compatibility
dotnet_diagnostic.CA1416.severity = none

# IDE0058: Remove unnecessary expression value
csharp_style_unused_value_expression_statement_preference = discard_variable:none
49 changes: 48 additions & 1 deletion ProtonVpn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.Logging.Contracts
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.Logging.Installers", "src\Logging\ProtonVPN.Logging.Installers\ProtonVPN.Logging.Installers.csproj", "{3522105D-D4CD-4707-8613-271998B582DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtonVPN.Logging.Tests", "src\Logging\ProtonVPN.Logging.Tests\ProtonVPN.Logging.Tests.csproj", "{433F53CA-E2E3-4CE1-A342-4A358D1999FC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.Logging.Tests", "src\Logging\ProtonVPN.Logging.Tests\ProtonVPN.Logging.Tests.csproj", "{433F53CA-E2E3-4CE1-A342-4A358D1999FC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StatisticalEvents", "StatisticalEvents", "{4B1EF657-A679-43B5-83DD-612D602C6333}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtonVPN.StatisticalEvents", "src\StatisticalEvents\ProtonVPN.StatisticalEvents\ProtonVPN.StatisticalEvents.csproj", "{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtonVPN.StatisticalEvents.Contracts", "src\StatisticalEvents\ProtonVPN.StatisticalEvents.Contracts\ProtonVPN.StatisticalEvents.Contracts.csproj", "{669BF256-765D-4BF1-9278-68EF33F86FFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtonVPN.StatisticalEvents.Installers", "src\StatisticalEvents\ProtonVPN.StatisticalEvents.Installers\ProtonVPN.StatisticalEvents.Installers.csproj", "{CEE9045E-0299-4488-80FF-0162D099C544}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1033,6 +1041,42 @@ Global
{433F53CA-E2E3-4CE1-A342-4A358D1999FC}.Release|x64.Build.0 = Release|Any CPU
{433F53CA-E2E3-4CE1-A342-4A358D1999FC}.Release|x86.ActiveCfg = Release|Any CPU
{433F53CA-E2E3-4CE1-A342-4A358D1999FC}.Release|x86.Build.0 = Release|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Debug|x64.ActiveCfg = Debug|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Debug|x64.Build.0 = Debug|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Debug|x86.ActiveCfg = Debug|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Debug|x86.Build.0 = Debug|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Release|Any CPU.Build.0 = Release|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Release|x64.ActiveCfg = Release|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Release|x64.Build.0 = Release|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Release|x86.ActiveCfg = Release|Any CPU
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9}.Release|x86.Build.0 = Release|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Debug|x64.ActiveCfg = Debug|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Debug|x64.Build.0 = Debug|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Debug|x86.ActiveCfg = Debug|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Debug|x86.Build.0 = Debug|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Release|Any CPU.Build.0 = Release|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Release|x64.ActiveCfg = Release|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Release|x64.Build.0 = Release|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Release|x86.ActiveCfg = Release|Any CPU
{669BF256-765D-4BF1-9278-68EF33F86FFB}.Release|x86.Build.0 = Release|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Debug|x64.ActiveCfg = Debug|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Debug|x64.Build.0 = Debug|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Debug|x86.ActiveCfg = Debug|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Debug|x86.Build.0 = Debug|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Release|Any CPU.Build.0 = Release|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Release|x64.ActiveCfg = Release|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Release|x64.Build.0 = Release|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Release|x86.ActiveCfg = Release|Any CPU
{CEE9045E-0299-4488-80FF-0162D099C544}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1093,6 +1137,9 @@ Global
{313EBBB8-C029-4A12-B898-EB6E18D025EA} = {2A968101-45CA-421C-A546-00D681BF3C76}
{3522105D-D4CD-4707-8613-271998B582DA} = {2A968101-45CA-421C-A546-00D681BF3C76}
{433F53CA-E2E3-4CE1-A342-4A358D1999FC} = {2A968101-45CA-421C-A546-00D681BF3C76}
{C8B78B43-EFEE-41CF-8BE9-1EA84AA18BF9} = {4B1EF657-A679-43B5-83DD-612D602C6333}
{669BF256-765D-4BF1-9278-68EF33F86FFB} = {4B1EF657-A679-43B5-83DD-612D602C6333}
{CEE9045E-0299-4488-80FF-0162D099C544} = {4B1EF657-A679-43B5-83DD-612D602C6333}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5CFD3EA5-ADCA-48F0-9E3F-BBC76CCBF1C2}
Expand Down
23 changes: 10 additions & 13 deletions ci/build-scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,18 @@ def push_branch(name):
def create_commit(message):
os.system(f"git commit -m \"{message}\"")

def create_debug_branch(version):
branch = f"debug/{version}"
checkout_branch(branch)
push_branch(branch)

def create_release_branch(version, commit_message):
def create_branch(version, branch_name, commit_message):
checkout_develop()
branch = f"release/{version}"
checkout_branch(branch)
checkout_branch(branch_name)
update_app_version(version)
create_commit(commit_message)
push_branch(branch)
push_branch(branch_name)

def create_release_and_debug_branches(version):
create_release_branch(version, f"Increase app version to {version}")
create_debug_branch(version)
def create_debug_branch(version, commit_message):
create_branch(version, f"debug/{version}", commit_message)

def create_release_branch(version, commit_message):
create_branch(version, f"release/{version}", commit_message)

def update_app_version(version):
file_path = 'src/GlobalAssemblyInfo.cs'
Expand All @@ -63,6 +59,7 @@ def update_app_version(version):

configure_git(os.getenv('RELEASE_GIT_EMAIL'), os.getenv('RELEASE_GIT_USERNAME'))

create_release_and_debug_branches(version)
create_release_branch(version, f"Increase app version to {version}")
create_debug_branch(version, f"Increase app version to {version}")
delete_branch("release/9.9.9")
create_release_branch('9.9.9', f"Build app version 9.9.9 to test {version} installer")
6 changes: 6 additions & 0 deletions src/Api/ProtonVPN.Api.Contracts/IApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
using ProtonVPN.Api.Contracts.Geographical;
using ProtonVPN.Api.Contracts.ReportAnIssue;
using ProtonVPN.Api.Contracts.Servers;
using ProtonVPN.Api.Contracts.Settings;
using ProtonVPN.Api.Contracts.Streaming;
using ProtonVPN.Api.Contracts.Users;
using ProtonVPN.Api.Contracts.VpnSessions;
using ProtonVPN.Common.StatisticalEvents;

namespace ProtonVPN.Api.Contracts
{
Expand All @@ -52,5 +55,8 @@ public interface IApiClient : IClientBase
Task<ApiResponseResult<CertificateResponse>> RequestAuthCertificateAsync(CertificateRequest request);
Task<ApiResponseResult<BaseResponse>> ApplyPromoCodeAsync(PromoCodeRequest promoCodeRequest);
Task<ApiResponseResult<ForkedAuthSessionResponse>> ForkAuthSessionAsync(AuthForkSessionRequest request);
Task<ApiResponseResult<SettingsResponse>> GetSettingsAsync();
Task<ApiResponseResult<BaseResponse>> PostStatisticalEventsAsync(StatisticalEventsBatch statisticalEvents);
Task<ApiResponseResult<UsersResponse>> GetUserAsync();
}
}
28 changes: 28 additions & 0 deletions src/Api/ProtonVPN.Api.Contracts/Settings/SettingsResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2023 Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/

using ProtonVPN.Api.Contracts.Common;

namespace ProtonVPN.Api.Contracts.Settings
{
public class SettingsResponse : BaseResponse
{
public UserSettingsResponse UserSettings { get; set; }
}
}
26 changes: 26 additions & 0 deletions src/Api/ProtonVPN.Api.Contracts/Settings/UserSettingsResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2023 Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/

namespace ProtonVPN.Api.Contracts.Settings
{
public class UserSettingsResponse
{
public bool Telemetry { get; set; }
}
}
26 changes: 26 additions & 0 deletions src/Api/ProtonVPN.Api.Contracts/Users/UserResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2023 Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/

namespace ProtonVPN.Api.Contracts.Users
{
public class UserResponse
{
public long CreateTime { get; set; }
}
}
28 changes: 28 additions & 0 deletions src/Api/ProtonVPN.Api.Contracts/Users/UsersResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2023 Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/

using ProtonVPN.Api.Contracts.Common;

namespace ProtonVPN.Api.Contracts.Users
{
public class UsersResponse : BaseResponse
{
public UserResponse User { get; set; }
}
}
22 changes: 22 additions & 0 deletions src/Api/ProtonVPN.Api/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@
using ProtonVPN.Api.Contracts.Geographical;
using ProtonVPN.Api.Contracts.ReportAnIssue;
using ProtonVPN.Api.Contracts.Servers;
using ProtonVPN.Api.Contracts.Settings;
using ProtonVPN.Api.Contracts.Streaming;
using ProtonVPN.Api.Contracts.Users;
using ProtonVPN.Api.Contracts.VpnConfig;
using ProtonVPN.Api.Contracts.VpnSessions;
using ProtonVPN.Common.Configuration;
using ProtonVPN.Common.OS.Net.Http;
using ProtonVPN.Common.StatisticalEvents;
using ProtonVPN.Core.Settings;
using ProtonVPN.Logging.Contracts;
using ProtonVPN.Logging.Contracts.Events.ApiLogs;
Expand Down Expand Up @@ -208,6 +211,25 @@ public async Task<ApiResponseResult<ForkedAuthSessionResponse>> ForkAuthSessionA
return await SendRequest<ForkedAuthSessionResponse>(request, "Fork auth session");
}

public async Task<ApiResponseResult<SettingsResponse>> GetSettingsAsync()
{
HttpRequestMessage request = GetAuthorizedRequest(HttpMethod.Get, "core/v4/settings");
return await SendRequest<SettingsResponse>(request, "Get user settings");
}

public async Task<ApiResponseResult<BaseResponse>> PostStatisticalEventsAsync(StatisticalEventsBatch statisticalEvents)
{
HttpRequestMessage request = GetAuthorizedRequest(HttpMethod.Post, "data/v1/stats/multiple");
request.Content = GetJsonContent(statisticalEvents);
return await SendRequest<BaseResponse>(request, "Post statistical events batch");
}

public async Task<ApiResponseResult<UsersResponse>> GetUserAsync()
{
HttpRequestMessage request = GetAuthorizedRequest(HttpMethod.Get, "core/v4/users");
return await SendRequest<UsersResponse>(request, "Get user");
}

private async Task<ApiResponseResult<T>> SendRequest<T>(HttpRequestMessage request, string logDescription)
where T : BaseResponse
{
Expand Down
4 changes: 2 additions & 2 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("3.2.1.0")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.2.2.0")]
[assembly: AssemblyFileVersion("3.2.2.0")]
[assembly: ComVisible(false)]
[assembly: AssemblyInformationalVersion("$AssemblyVersion")]
[assembly: SupportedOSPlatform("windows")]
25 changes: 25 additions & 0 deletions src/ProtonVPN.App/Account/IUserCreationDateUpdater.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2023 Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/

namespace ProtonVPN.Account
{
public interface IUserCreationDateUpdater
{
}
}
28 changes: 28 additions & 0 deletions src/ProtonVPN.App/Account/IUserSettingsUpdater.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2023 Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/

using System.Threading.Tasks;

namespace ProtonVPN.Account
{
public interface IUserSettingsUpdater
{
Task Update();
}
}
Loading

0 comments on commit 217bf56

Please sign in to comment.