Skip to content

Commit

Permalink
Merge branch 'release/1.24.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mindaugasveblauskas committed Dec 7, 2021
2 parents 67ae811 + 0d94f67 commit 2a7efc9
Show file tree
Hide file tree
Showing 32 changed files with 200 additions and 33 deletions.
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ variables:
PUBLIC_REPO_URL: [email protected]:ProtonVPN/win-app.git

stages:
- release
- bot # comes from translations/generator job
- build
- test
Expand Down Expand Up @@ -179,3 +180,14 @@ i18n-manual-sync-crowdin:
variables:
I18N_SYNC_CROWDIN_PROJECT: 'windows-vpn'
extends: .i18n-sync-crowdin-common

create-release:
image: debian:stable-slim
stage: release
when: manual
only:
refs:
- develop
script:
- apt-get update && apt-get install -y python3 python3-pip git
- python3 ci/release.py
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
url = https://github.com/ProtonMail/go-srp
[submodule "src/ProtonVPN.LocalAgent"]
path = src/ProtonVPN.LocalAgent
url = https://gitlab.protontech.ch/ProtonVPN/development/clients-shared.git
url = https://github.com/ProtonVPN/go-vpn-lib.git
4 changes: 2 additions & 2 deletions Setup/ProtonVPN.aip
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@
<ROW File="LocalAgent.dll" Component_="LocalAgent.dll" FileName="LOCALA~1.DLL|LocalAgent.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\Resources\32-bit\LocalAgent.dll" SelfReg="false"/>
<ROW File="LocalAgent.dll_1" Component_="LocalAgent.dll_1" FileName="LOCALA~1.DLL|LocalAgent.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\Resources\64-bit\LocalAgent.dll" SelfReg="false"/>
<ROW File="log4net.dll" Component_="log4net.dll" FileName="log4net.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\log4net.dll" SelfReg="false"/>
<ROW File="wireguard.dll" Component_="wireguard.dll" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="wireguard-nt\amd64\wireguard.dll" SelfReg="false"/>
<ROW File="wireguard.dll_1" Component_="wireguard.dll_1" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="wireguard-nt\x86\wireguard.dll" SelfReg="false"/>
<ROW File="wireguard.dll" Component_="wireguard.dll" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\ProtonVPN.Vpn\Resources\64-bit\wireguard.dll" SelfReg="false"/>
<ROW File="wireguard.dll_1" Component_="wireguard.dll_1" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\ProtonVPN.Vpn\Resources\32-bit\wireguard.dll" SelfReg="false"/>
<ROW File="ProtonVPN.WireGuardDriver.dll" Component_="ProtonVPN.WireGuardDriver.dll" FileName="PROTO~13.DLL|ProtonVPN.WireGuardDriver.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\ProtonVPN.WireGuardDriver.dll" SelfReg="false"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.AiRemoveFileComponent">
Expand Down
3 changes: 1 addition & 2 deletions ci/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import tests
import installer
import ssh
import os
import guest_hole_server_loader
from pathlib import Path

Expand Down Expand Up @@ -99,4 +98,4 @@

elif args.command == 'update-gh-list':
print('Executing guest hole server loader')
guest_hole_server_loader.load()
guest_hole_server_loader.load()
64 changes: 64 additions & 0 deletions ci/release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import os
import re

def get_remote_url():
repository = os.getenv("CI_REPOSITORY_URL", "")
user = f"git:{os.getenv('RELEASE_PAT')}"
(_, url) = repository.split("@")
return f"https://{user}@{url.replace(':', '/')}"

def configure_git(git_email, git_username):
os.system(f"git config user.email \"{git_email}\"")
os.system(f"git config user.name \"{git_username}\"")

def checkout_develop():
os.system("git fetch origin develop:develop")
os.system("git checkout develop")
os.system(f"git remote set-url origin {get_remote_url()}")

def checkout_branch(name):
os.system(f"git checkout -b {name}")

def push_branch(name):
os.system(f"git push --set-upstream origin {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):
checkout_develop()
branch = f"release/{version}"
checkout_branch(branch)
update_app_version(version)
create_commit(commit_message)
push_branch(branch)

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

def update_app_version(version):
file_path = 'src/GlobalAssemblyInfo.cs'
content = ''
with open(file_path, encoding='latin') as f:
content = f.read()
content = re.sub(r"(AssemblyVersion\(\")([0-9]+\.[0-9]+\.[0-9]+)", rf"\g<1>{version}", content)
content = re.sub(r"(AssemblyFileVersion\(\")([0-9]+\.[0-9]+\.[0-9]+)", rf"\g<1>{version}", content)
with open(file_path, 'w') as f:
f.write(content)

os.system(f"git add {file_path}")

version = os.getenv('APP_VERSION')
if version == None:
raise Exception("Missing env variable APP_VERSION")

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

create_release_and_debug_branches(version)
create_release_branch('9.9.9', f"Build app version 9.9.9 to test {version} installer")
6 changes: 3 additions & 3 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ProtonVPN")]
[assembly: AssemblyCopyright("Copyright © 2021 Proton Technologies AG")]
[assembly: AssemblyCopyright("Copyright © 2021 Proton Technologies AG")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.24.1.0")]
[assembly: AssemblyFileVersion("1.24.1.0")]
[assembly: AssemblyVersion("1.24.2.0")]
[assembly: AssemblyFileVersion("1.24.2.0")]
[assembly: ComVisible(false)]
[assembly: AssemblyInformationalVersion("$AssemblyVersion")]
49 changes: 42 additions & 7 deletions src/ProtonVPN.App/Streaming/StreamingServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace ProtonVPN.Streaming
{
internal class StreamingServices : IStreamingServices
{
private const string COUNTRY_CODE_ANY = "*";
private StreamingServicesResponse _response;
private readonly IAppSettings _appSettings;

Expand All @@ -37,18 +38,52 @@ public StreamingServices(StreamingServicesUpdater streamingServicesUpdater, IApp

public IReadOnlyList<StreamingService> GetServices(string countryCode, sbyte tier)
{
if (_response == null ||
!_response.StreamingServices.ContainsKey(countryCode) ||
!_response.StreamingServices[countryCode].ContainsKey(tier))
if (_response == null)
{
return new List<StreamingService>();
}

IReadOnlyList<StreamingServiceResponse> services = _response.StreamingServices[countryCode][tier];
Dictionary<string, StreamingService> streamingServicesByName = new();
if (IsStreamingServicesResponseContainingCountryCodeAndTier(countryCode, tier))
{
UpsertStreamingServicesToDictionary(streamingServicesByName, _response.StreamingServices[countryCode][tier]);
}
if (IsStreamingServicesResponseContainingCountryCodeAndTier(COUNTRY_CODE_ANY, tier))
{
UpsertStreamingServicesToDictionary(streamingServicesByName, _response.StreamingServices[COUNTRY_CODE_ANY][tier]);
}

return streamingServicesByName.Values.OrderBy(s => s.Name).ToList();
}

private bool IsStreamingServicesResponseContainingCountryCodeAndTier(string countryCode, sbyte tier)
{
return countryCode != null &&
_response.StreamingServices.ContainsKey(countryCode) &&
_response.StreamingServices[countryCode].ContainsKey(tier);
}

return services.Select(s => new StreamingService(s.Name, GetIconUrl(s.Icon)))
.OrderBy(s => s.Name)
.ToList();
private void UpsertStreamingServicesToDictionary(Dictionary<string, StreamingService> streamingServicesByName,
IList<StreamingServiceResponse> streamingServiceResponses)
{
foreach (StreamingServiceResponse streamingServiceResponse in streamingServiceResponses)
{
UpsertStreamingServiceToDictionary(streamingServicesByName, streamingServiceResponse);
}
}

private void UpsertStreamingServiceToDictionary(Dictionary<string, StreamingService> streamingServicesByName,
StreamingServiceResponse streamingServiceResponse)
{
StreamingService streamingService = MapStreamingService(streamingServiceResponse);
streamingServicesByName[streamingService.Name] = streamingService;
}

private StreamingService MapStreamingService(StreamingServiceResponse streamingServicesResponse)
{
return new StreamingService(
name: streamingServicesResponse.Name,
iconUrl: GetIconUrl(streamingServicesResponse.Icon));
}

private string GetIconUrl(string icon)
Expand Down
2 changes: 1 addition & 1 deletion src/ProtonVPN.Common/Configuration/Source/DefaultConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Config Value()

ServerLoadUpdateInterval = TimeSpan.FromMinutes(15),

P2PCheckInterval = TimeSpan.FromSeconds(30),
P2PCheckInterval = TimeSpan.FromSeconds(60),

VpnInfoCheckInterval = TimeSpan.FromMinutes(3),

Expand Down
2 changes: 1 addition & 1 deletion src/ProtonVPN.LocalAgent
11 changes: 10 additions & 1 deletion src/ProtonVPN.Resources/Properties/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/ProtonVPN.Resources/Properties/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@
<data name="Language_fr" xml:space="preserve">
<value>Français</value>
</data>
<data name="Language_hr" xml:space="preserve">
<value>Hrvatski</value>
</data>
<data name="Language_hu" xml:space="preserve">
<value>Magyar</value>
</data>
<data name="Language_id" xml:space="preserve">
<value>Bahasa Indonesia</value>
<value>Bahasa, Indonesia</value>
</data>
<data name="Language_it" xml:space="preserve">
<value>Italiano</value>
Expand Down
1 change: 1 addition & 0 deletions src/ProtonVPN.Vpn/Connection/LocalAgentWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public void SetFeatures(VpnFeatures vpnFeatures)
public void UpdateAuthCertificate(string certificate)
{
_clientCertPem = certificate;
_logger.Info("[LocalAgentWrapper] Client certificate updated. Closing existing TLS channel and reconnecting.");
_eventReceiver.Stop();
CloseTlsChannel();
ConnectToTlsChannel();
Expand Down
6 changes: 5 additions & 1 deletion src/ProtonVPN.Vpn/ProtonVPN.Vpn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\32-bit\tunnel.dll" />
<Content Include="Resources\32-bit\wireguard.dll" />
<Content Include="Resources\64-bit\libcrypto-1_1-x64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -174,6 +175,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\64-bit\tunnel.dll" />
<Content Include="Resources\64-bit\wireguard.dll" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
Expand All @@ -182,6 +184,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>call "$(ProjectDir)build-local-agent.bat"</PostBuildEvent>
<PostBuildEvent>call "$(ProjectDir)build-local-agent.bat"
copy $(ProjectDir)Resources\64-bit\tunnel.dll $(ProjectDir)$(OutDir)
copy $(ProjectDir)Resources\64-bit\wireguard.dll $(ProjectDir)$(OutDir)</PostBuildEvent>
</PropertyGroup>
</Project>
Binary file modified src/ProtonVPN.Vpn/Resources/32-bit/libcrypto-1_1.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/32-bit/liblzo2-2.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/32-bit/libpkcs11-helper-1.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/32-bit/libssl-1_1.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/32-bit/openvpn.exe
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/32-bit/tunnel.dll
Binary file not shown.
Binary file removed src/ProtonVPN.Vpn/Resources/32-bit/tunnel.dll.bak
Binary file not shown.
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/64-bit/libcrypto-1_1-x64.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/64-bit/liblzo2-2.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/64-bit/libpkcs11-helper-1.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/64-bit/libssl-1_1-x64.dll
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/64-bit/openvpn.exe
Binary file not shown.
Binary file modified src/ProtonVPN.Vpn/Resources/64-bit/tunnel.dll
Binary file not shown.
Binary file removed src/ProtonVPN.Vpn/Resources/64-bit/tunnel.dll.bak
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 2a7efc9

Please sign in to comment.