Skip to content

Commit

Permalink
Remove unused target frameworks and pass certificate in healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
w1am committed Dec 20, 2024
1 parent 2cdf1f0 commit 632631b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 69 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
framework: [ net6.0, net7.0, net8.0 ]
framework: [ net8.0 ]
os: [ ubuntu-latest ]
configuration: [ release ]
runs-on: ${{ matrix.os }}
Expand All @@ -52,8 +52,6 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Run Tests
shell: bash
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
framework: [ net6.0, net7.0, net8.0 ]
framework: [ net8.0 ]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
name: scan-vulnerabilities/${{ matrix.os }}/${{ matrix.framework }}
Expand All @@ -25,8 +25,6 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Scan for Vulnerabilities
shell: bash
Expand Down Expand Up @@ -100,7 +98,7 @@ jobs:
strategy:
fail-fast: false
matrix:
framework: [ net6.0, net7.0, net8.0 ]
framework: [ net8.0 ]
os: [ ubuntu-latest, windows-latest ]
configuration: [ release ]
runs-on: ${{ matrix.os }}
Expand All @@ -115,8 +113,6 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Compile
shell: bash
Expand Down Expand Up @@ -167,8 +163,6 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Dotnet Pack
shell: bash
Expand Down
21 changes: 0 additions & 21 deletions samples/Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "quick-start", "quick-start\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventStore.Client.Streams", "..\src\EventStore.Client.Streams\EventStore.Client.Streams.csproj", "{A32CE3CB-AB71-45C6-A1B2-CD94BE2D2B28}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventStore.Client", "..\src\EventStore.Client\EventStore.Client.csproj", "{A71A13F7-8480-4E48-B88D-A2364F7C95B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "connecting-to-a-cluster", "connecting-to-a-cluster\connecting-to-a-cluster.csproj", "{C4CA324A-450D-4621-82F1-B4ECD18216B6}"
Expand All @@ -29,10 +27,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "server-side-filtering", "se
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "persistent-subscriptions", "persistent-subscriptions\persistent-subscriptions.csproj", "{A5A5EF0D-1AE4-4647-823D-FA172E8858F2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventStore.Client.PersistentSubscriptions", "..\src\EventStore.Client.PersistentSubscriptions\EventStore.Client.PersistentSubscriptions.csproj", "{7200BB01-A405-45D5-A6E8-A8FA8DE39DA0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventStore.Client.ProjectionManagement", "..\src\EventStore.Client.ProjectionManagement\EventStore.Client.ProjectionManagement.csproj", "{79992D7B-C311-4E8A-856F-896C1EA61042}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "projection-management", "projection-management\projection-management.csproj", "{9DEA2684-C38B-465C-91A6-ED2AB67A4338}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "diagnostics", "diagnostics\diagnostics.csproj", "{546496AD-E355-4C20-930C-30D0FC76D26F}"
Expand All @@ -51,10 +45,6 @@ Global
{521987E5-4394-4EE0-B217-E3DC9DB0D327}.Debug|Any CPU.Build.0 = Debug|Any CPU
{521987E5-4394-4EE0-B217-E3DC9DB0D327}.Release|Any CPU.ActiveCfg = Release|Any CPU
{521987E5-4394-4EE0-B217-E3DC9DB0D327}.Release|Any CPU.Build.0 = Release|Any CPU
{A32CE3CB-AB71-45C6-A1B2-CD94BE2D2B28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A32CE3CB-AB71-45C6-A1B2-CD94BE2D2B28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A32CE3CB-AB71-45C6-A1B2-CD94BE2D2B28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A32CE3CB-AB71-45C6-A1B2-CD94BE2D2B28}.Release|Any CPU.Build.0 = Release|Any CPU
{A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -95,14 +85,6 @@ Global
{A5A5EF0D-1AE4-4647-823D-FA172E8858F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5A5EF0D-1AE4-4647-823D-FA172E8858F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5A5EF0D-1AE4-4647-823D-FA172E8858F2}.Release|Any CPU.Build.0 = Release|Any CPU
{7200BB01-A405-45D5-A6E8-A8FA8DE39DA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7200BB01-A405-45D5-A6E8-A8FA8DE39DA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7200BB01-A405-45D5-A6E8-A8FA8DE39DA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7200BB01-A405-45D5-A6E8-A8FA8DE39DA0}.Release|Any CPU.Build.0 = Release|Any CPU
{79992D7B-C311-4E8A-856F-896C1EA61042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79992D7B-C311-4E8A-856F-896C1EA61042}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79992D7B-C311-4E8A-856F-896C1EA61042}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79992D7B-C311-4E8A-856F-896C1EA61042}.Release|Any CPU.Build.0 = Release|Any CPU
{9DEA2684-C38B-465C-91A6-ED2AB67A4338}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DEA2684-C38B-465C-91A6-ED2AB67A4338}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DEA2684-C38B-465C-91A6-ED2AB67A4338}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -124,10 +106,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A32CE3CB-AB71-45C6-A1B2-CD94BE2D2B28} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
{A71A13F7-8480-4E48-B88D-A2364F7C95B6} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
{7200BB01-A405-45D5-A6E8-A8FA8DE39DA0} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
{79992D7B-C311-4E8A-856F-896C1EA61042} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
{29E3F07A-6676-45C1-805C-46BDF6CF325B} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
1 change: 1 addition & 0 deletions samples/Samples.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=acked/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" Condition="'$(TargetFramework)' == 'net48'"/>
</ItemGroup>

<!-- &lt;!&ndash; Vulnerable Transitive Packages &ndash;&gt;-->
<!-- <ItemGroup>-->
<!-- &lt;!&ndash; https://github.com/advisories/GHSA-7jgj-8wvc-jh57 &ndash;&gt;-->
<!-- <PackageReference Include="System.Net.Http " Version="4.3.4"/>-->
<!-- &lt;!&ndash; https://github.com/advisories/GHSA-cmhx-cq75-c4mj &ndash;&gt;-->
<!-- <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1"/>-->
<!-- </ItemGroup>-->
<!-- Vulnerable Transitive Packages -->
<ItemGroup>
<!-- https://github.com/advisories/GHSA-7jgj-8wvc-jh57 -->
<PackageReference Include="System.Net.Http" Version="4.3.4"/>
<!-- https://github.com/advisories/GHSA-cmhx-cq75-c4mj -->
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1"/>
</ItemGroup>

<ItemGroup>
<Content Include="..\..\certs\**\*">
Expand Down Expand Up @@ -63,4 +63,4 @@
<ItemGroup>
<None Remove="EventStore.Client.Tests.Common.csproj.DotSettings"/>
</ItemGroup>
</Project>
</Project>
58 changes: 29 additions & 29 deletions test/EventStore.Client.Tests.Common/Fixtures/EventStoreTestNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,40 +81,40 @@ protected override ContainerBuilder Configure() {
.WithEnvironment(env)
.MountVolume(certsPath, "/etc/eventstore/certs", MountType.ReadOnly)
.ExposePort(port, 2113)
//.KeepContainer().KeepRunning().ReuseIfExists()
// .KeepContainer().KeepRunning().ReuseIfExists()
.WaitUntilReadyWithConstantBackoff(1_000, 60, service => {
var output = service.ExecuteCommand("curl -o - -I http://admin:changeit@localhost:2113/health/live");
var output = service.ExecuteCommand("curl -u admin:changeit --cacert /etc/eventstore/certs/ca/ca.crt https://localhost:2113/health/live");
if (!output.Success)
throw new Exception(output.Error);
});
}

/// <summary>
/// max of 30 seconds (300 * 100ms)
/// </summary>
static readonly IEnumerable<TimeSpan> DefaultBackoffDelay = Backoff.ConstantBackoff(FromMilliseconds(100), 300);

protected override async Task OnServiceStarted() {
using var http = new HttpClient(
#if NET
new SocketsHttpHandler { SslOptions = { RemoteCertificateValidationCallback = delegate { return true; } } }
#else
new WinHttpHandler { ServerCertificateValidationCallback = delegate { return true; } }
#endif
) {
BaseAddress = Options.ClientSettings.ConnectivitySettings.Address
};

await Policy.Handle<Exception>()
.WaitAndRetryAsync(DefaultBackoffDelay)
.ExecuteAsync(
async () => {
using var response = await http.GetAsync("/health/live", CancellationToken.None);
if (response.StatusCode >= HttpStatusCode.BadRequest)
throw new FluentDockerException($"Health check failed with status code: {response.StatusCode}.");
}
);
}
// /// <summary>
// /// max of 30 seconds (300 * 100ms)
// /// </summary>
// static readonly IEnumerable<TimeSpan> DefaultBackoffDelay = Backoff.ConstantBackoff(FromMilliseconds(100), 300);
//
// protected override async Task OnServiceStarted() {
// using var http = new HttpClient(
// #if NET
// new SocketsHttpHandler { SslOptions = { RemoteCertificateValidationCallback = delegate { return true; } } }
// #else
// new WinHttpHandler { ServerCertificateValidationCallback = delegate { return true; } }
// #endif
// ) {
// BaseAddress = Options.ClientSettings.ConnectivitySettings.Address
// };
//
// await Policy.Handle<Exception>()
// .WaitAndRetryAsync(DefaultBackoffDelay)
// .ExecuteAsync(
// async () => {
// using var response = await http.GetAsync("/health/live", CancellationToken.None);
// if (response.StatusCode >= HttpStatusCode.BadRequest)
// throw new FluentDockerException($"Health check failed with status code: {response.StatusCode}.");
// }
// );
// }
}

/// <summary>
Expand Down Expand Up @@ -164,4 +164,4 @@ public async Task<int> GetNextAvailablePort(TimeSpan delay = default) {
}

public int NextAvailablePort => GetNextAvailablePort(FromMilliseconds(100)).GetAwaiter().GetResult();
}
}

0 comments on commit 632631b

Please sign in to comment.