Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ jobs:

- name: Publish UI
if: ${{ github.event.release.prerelease == false }}
run: dotnet publish "EstateManagementUI.BlazorServer\EstateManagementUI.BlazorServer.csproj" --configuration Release --output publishOutput -r win-x64 --self-contained
run: dotnet publish "EstateManagementUI.BlazorServer\EstateManagementUI.BlazorServer.csproj" --configuration Release --output publishOutput -r win-x64 --self-contained
-p:Version=${{ steps.get_version.outputs.VERSION }}
-p:AssemblyVersion=${{ steps.get_version.outputs.VERSION }}
-p:FileVersion=${{ steps.get_version.outputs.VERSION }}
-p:InformationalVersion=${{ steps.get_version.outputs.VERSION }}

- name: Build Release Package
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<PackageReference Include="Shared" Version="2025.12.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="9.0.0" />
<PackageReference Include="Sentry.AspNetCore" Version="6.2.0" />
</ItemGroup>


Expand Down
47 changes: 45 additions & 2 deletions EstateManagementUI.BlazorServer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,54 @@
using EstateManagementUI.BlazorServer.Common;
using EstateManagementUI.BlazorServer.Components;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Sentry.Extensibility;
using Shared.General;
using Spectre.Console;
using System.IdentityModel.Tokens.Jwt;
using System.Reflection;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args).LoadConfiguration().ConfigureKestrel();


//builder.ConfigureAppConfiguration((context, configBuilder) =>
//{

Check notice on line 15 in EstateManagementUI.BlazorServer/Program.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

EstateManagementUI.BlazorServer/Program.cs#L15

Remove this commented out code.
// var env = context.HostingEnvironment;

// configBuilder.SetBasePath(fi.Directory.FullName)
// .AddJsonFile("hosting.json", optional: true)
// .AddJsonFile($"hosting.{env.EnvironmentName}.json", optional: true)
// .AddJsonFile("/home/txnproc/config/appsettings.json", optional: true, reloadOnChange: true)
// .AddJsonFile($"/home/txnproc/config/appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
// .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
// .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
// .AddEnvironmentVariables();

// // Build a snapshot of configuration so we can use it immediately (e.g. for Sentry)
// var builtConfig = configBuilder.Build();

// // Keep existing static usage (if you must), and initialise the ConfigurationReader now.
// //Startup.Configuration = builtConfig;
// //ConfigurationReader.Initialise(Startup.Configuration);

// Configure Sentry on the webBuilder using the config snapshot.
var sentrySection = ConfigurationReader.GetValueOrDefault("SentryConfiguration", "Dsn", "N/A");
if (sentrySection != "N/A")
{
// Replace the condition below if you intended to only enable Sentry in certain environments.
if (builder.Environment.IsDevelopment() == false)
{
builder.WebHost.UseSentry(o =>
{
o.Dsn = sentrySection;
o.SendDefaultPii = true;
o.MaxRequestBodySize = RequestSize.Always;
o.CaptureBlockingCalls = true;
o.Release = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown";
});
}
}

// Clear default claims mapping
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();

Expand Down
Loading