Merge pull request '[PROD] Add seq support' (#7) from main into production
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2025-08-19 18:56:10 +02:00
6 changed files with 33 additions and 8 deletions

View File

@@ -9,11 +9,13 @@ Includes the backend (`src/Vegasco.Server.Api`) and the frontend (`src/Vegasco-W
### Configuration ### Configuration
| Configuration | Description | Default | Required | | Configuration | Description | Default | Required |
|--------------------------|---------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|----------| |------------------------------------|---------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|----------|
| JWT:MetadataUrl | The oidc meta data url | - | true | | JWT:MetadataUrl | The oidc meta data url | - | true |
| JWT:ValidAudience | The valid audience of the JWT token. | - | true | | JWT:ValidAudience | The valid audience of the JWT token. | - | true |
| JWT:NameClaimType | The claim type of the user's name claim. For keycloak, using `preferred_username` is often the better choice. | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name | false | | JWT:NameClaimType | The claim type of the user's name claim. For keycloak, using `preferred_username` is often the better choice. | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name | false |
| JWT:AllowHttpMetadataUrl | Whether to allow the meta data url to have http as protocol. Always true when `ASPNETCORE_ENVIRONMENT=true` | false | false | | JWT:AllowHttpMetadataUrl | Whether to allow the meta data url to have http as protocol. Always true when `ASPNETCORE_ENVIRONMENT=true` | false | false |
| ConnectionStrings:seq | The seq http endpoint to send the logs and traces to. If not set, logs and traces will not be sent to seq. | - | false |
| ConnectionStrings:vegasco-database | The connection string to the postgres database. | - | true |
The application uses the prefix `Vegasco_` for environment variable names. The prefix is removed when the application reads the environment variables and duplicate entries are overwritten by the environment variables. The application uses the prefix `Vegasco_` for environment variable names. The prefix is removed when the application reads the environment variables and duplicate entries are overwritten by the environment variables.

View File

@@ -1,4 +1,4 @@
FROM node:lts AS build FROM node:latest AS build
RUN npm install -g pnpm RUN npm install -g pnpm
ARG CONFIGURATION=development ARG CONFIGURATION=development
WORKDIR /usr/local/app WORKDIR /usr/local/app

View File

@@ -18,6 +18,8 @@ public static class DependencyInjectionExtensions
/// <param name="builder"></param> /// <param name="builder"></param>
public static void AddApiServices(this IHostApplicationBuilder builder) public static void AddApiServices(this IHostApplicationBuilder builder)
{ {
builder.AddBuilderServices();
builder.Services builder.Services
.AddMiscellaneousServices() .AddMiscellaneousServices()
.AddCustomOpenApi() .AddCustomOpenApi()
@@ -27,6 +29,17 @@ public static class DependencyInjectionExtensions
builder.AddDbContext(); builder.AddDbContext();
} }
private static IHostApplicationBuilder AddBuilderServices(this IHostApplicationBuilder builder)
{
string? seqHost = builder.Configuration.GetConnectionString("seq");
if (!string.IsNullOrEmpty(seqHost))
{
builder.AddSeqEndpoint("seq");
}
return builder;
}
private static IServiceCollection AddMiscellaneousServices(this IServiceCollection services) private static IServiceCollection AddMiscellaneousServices(this IServiceCollection services)
{ {
services.AddSingleton(() => services.AddSingleton(() =>

View File

@@ -14,6 +14,7 @@
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" /> <PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" /> <PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.3.0" /> <PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.3.0" />
<PackageReference Include="Aspire.Seq" Version="9.3.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" /> <PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" /> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />

View File

@@ -14,13 +14,21 @@ if (builder.Environment.IsDevelopment())
.WithPgAdmin(); .WithPgAdmin();
} }
IResourceBuilder<SeqResource> seq = builder.AddSeq("seq")
.WithLifetime(ContainerLifetime.Persistent)
.WithDataVolume()
.WithExternalHttpEndpoints()
.WithImageTag("latest");
IResourceBuilder<PostgresDatabaseResource> postgres = postgresBuilder IResourceBuilder<PostgresDatabaseResource> postgres = postgresBuilder
.AddDatabase(Constants.Database.Name); .AddDatabase(Constants.Database.Name);
IResourceBuilder<ProjectResource> api = builder IResourceBuilder<ProjectResource> api = builder
.AddProject<Projects.Vegasco_Server_Api>(Constants.Projects.Api) .AddProject<Projects.Vegasco_Server_Api>(Constants.Projects.Api)
.WithReference(postgres) .WithReference(postgres)
.WaitFor(postgres); .WaitFor(postgres)
.WithReference(seq)
.WaitFor(seq);
builder builder
.AddNpmApp("Vegasco-Web", "../Vegasco-Web") .AddNpmApp("Vegasco-Web", "../Vegasco-Web")

View File

@@ -18,6 +18,7 @@
<PackageReference Update="Nerdbank.GitVersioning"> <PackageReference Update="Nerdbank.GitVersioning">
<Version>3.7.115</Version> <Version>3.7.115</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Aspire.Hosting.Seq" Version="9.3.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>