Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8f517ef
Upgrade to .NET 10, update packages, and modernize code
KrzysztofPajak Jan 2, 2026
52c93d0
Upgrade .NET SDK from 9.0 to 10.0 in workflows and Dockerfile
KrzysztofPajak Jan 2, 2026
de324d8
Add USER directive to Dockerfile for non-root execution
KrzysztofPajak Jan 2, 2026
bff86a5
Add Directory.Build.props to enable test parallelization for MSTest p…
KrzysztofPajak Jan 2, 2026
d0571b2
Refactor test assertions for clarity and consistency
KrzysztofPajak Jan 2, 2026
d8c718a
Add container logs output during application readiness check and ensu…
KrzysztofPajak Jan 2, 2026
5b29c6e
Enhance application readiness check by following redirects in curl an…
KrzysztofPajak Jan 2, 2026
0258a01
Fix data protection keys path by removing leading slash in key persis…
KrzysztofPajak Jan 2, 2026
1796427
Add user flag to application container run command and update log dis…
KrzysztofPajak Jan 2, 2026
6aebc82
Update Docker workflow to target main branch and refine container run…
KrzysztofPajak Jan 3, 2026
cc4ee95
Update workflow to target develop branch for push and pull_request ev…
KrzysztofPajak Jan 3, 2026
82cc8c8
Add permissions setup for application data directories in Dockerfile
KrzysztofPajak Jan 3, 2026
26d66fc
Refactor URL generation in Configure.cshtml
KrzysztofPajak Jan 3, 2026
ef1c48a
Improve CI debugging: show container logs and status
KrzysztofPajak Jan 3, 2026
d5b701a
Remove unnecessary ownership and permission settings in Dockerfile
KrzysztofPajak Jan 3, 2026
f5fe200
Add global.json to specify SDK version
KrzysztofPajak Jan 3, 2026
46cd722
Ensure non-root user permissions for application data directories in …
KrzysztofPajak Jan 3, 2026
5748830
Fix key persistence location path in data protection configuration
KrzysztofPajak Jan 3, 2026
ed9bd5f
Update key persistence location for data protection configuration
KrzysztofPajak Jan 3, 2026
d385ec1
Update Dockerfile
KrzysztofPajak Jan 3, 2026
f701a51
Remove EnableRuntimeCompilation setting and support - Razor runtime c…
KrzysztofPajak Jan 3, 2026
341a02e
Add rollForward setting to SDK version in global.json
KrzysztofPajak Jan 3, 2026
201dfd2
Update StaticWebAssetBasePath to use project name
KrzysztofPajak Jan 3, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/aspnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- name: Restore
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true # jeśli używasz Git LFS
lfs: true

- name: Setup .NET 9 SDK
- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'
15 changes: 13 additions & 2 deletions .github/workflows/docker-image-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
for i in {1..10}; do
nc -z localhost 27017 && echo "MongoDB is up" && break
echo "Retrying in 3 seconds..."
echo "Container logs:"
docker logs grandnode2-container --tail 20
sleep 3
done

Expand Down Expand Up @@ -79,12 +81,21 @@ jobs:
else
echo "Received HTTP response code: $RESPONSE. Retrying in 3 seconds..."
fi
echo "Container logs:"
docker logs grandnode2-container --tail 30
sleep 3
done
echo "Application did not start successfully. Final response code: $RESPONSE"
exit 1


- name: Show container logs
run: |
echo "=== Full container logs ==="
docker logs grandnode2-container
echo "=== Container status ==="
docker inspect grandnode2-container --format='{{.State.Status}} - Exit: {{.State.ExitCode}}'

- name: Stop and remove the container
run: |
docker stop grandnode2-container
docker rm grandnode2-container
docker rm grandnode2-container
2 changes: 1 addition & 1 deletion .github/workflows/grandnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Create mongoDB Docker container
run: sudo docker run -d -p 27017:27017 mongo:latest
- name: Install .NET Aspire workload
Expand Down
100 changes: 50 additions & 50 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,80 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.3.0" />
<PackageVersion Include="ExcelMapper" Version="5.2.598" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.4.0" />
<PackageVersion Include="ExcelMapper" Version="6.0.615" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.4.0" />
<PackageVersion Include="NPOI" Version="2.7.5" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.8.10" />
<PackageVersion Include="Scryber.Core" Version="6.0.4-beta" />
<PackageVersion Include="Scryber.Core.OpenType" Version="6.1.0-beta" />
<PackageVersion Include="MailKit" Version="4.14.0" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.0.32" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.7.7" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.25.1" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.11" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.11.10" />
<PackageVersion Include="Scryber.Core" Version="9.2.0.2" />
<PackageVersion Include="Scryber.Core.OpenType" Version="9.2.0" />
<PackageVersion Include="MailKit" Version="4.14.1" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.3.6" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.16.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.26.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageVersion Include="SkiaSharp" Version="3.119.1" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.1" />
<PackageVersion Include="LiteDB" Version="5.0.21" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.5.2" />
<PackageVersion Include="MongoDB.Driver" Version="3.5.2" />
<PackageVersion Include="DotLiquid" Version="2.3.197" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
<PackageVersion Include="GoogleAuthenticator" Version="3.2.0" />
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.4.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="9.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="10.0.1" />
<PackageVersion Include="AutoMapper" Version="14.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.0.0" />
<PackageVersion Include="MediatR" Version="12.5.0" />
<PackageVersion Include="Scrutor" Version="6.1.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.9.25" />
<PackageVersion Include="FluentValidation" Version="12.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="9.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.9" />
<PackageVersion Include="Braintree" Version="5.35.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.9" />
<PackageVersion Include="System.Linq.Dynamic.Core" Version="1.6.8" />
<PackageVersion Include="Scrutor" Version="7.0.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.10.1" />
<PackageVersion Include="FluentValidation" Version="12.1.1" />
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="10.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.1" />
<PackageVersion Include="Braintree" Version="5.38.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
<PackageVersion Include="System.Linq.Dynamic.Core" Version="1.7.1" />
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.7.0" />
<PackageVersion Include="Stripe.net" Version="49.0.0" />
<PackageVersion Include="Stripe.net" Version="50.1.0" />
<PackageVersion Include="elFinder.Net.AspNetCore" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Core" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Drivers.FileSystem" Version="1.5.0" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.5.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.1" />
<PackageVersion Include="Azure.Identity" Version="1.16.0" />
<PackageVersion Include="Azure.Identity" Version="1.17.1" />
<PackageVersion Include="Flurl.Http" Version="4.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="9.0.9" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="10.0.1" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.3.1" />
<PackageVersion Include="Wangkanai.Detection" Version="8.20.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.9" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.11.0" />
<PackageVersion Include="MSTest.TestFramework" Version="3.11.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageVersion Include="MSTest.TestFramework" Version="4.0.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="NUnit" Version="4.4.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.5.1" />
<PackageVersion Include="Aspire.Hosting.MongoDB" Version="9.5.1" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.9.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="9.5.1" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.13.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.13.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.12.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.1.0" />
<PackageVersion Include="Aspire.Hosting.MongoDB" Version="13.1.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.1.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0" />
<PackageVersion Include="Aspire.Dashboard.Sdk.$(NETCoreSdkRuntimeIdentifier)" Version="9.0.0" />
<PackageVersion Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Update="Aspire.Dashboard.Sdk.win-x64" Version="9.5.1" />
<PackageVersion Update="Aspire.Hosting.Orchestration.win-x64" Version="9.5.1" />
<PackageVersion Update="Aspire.Dashboard.Sdk.win-x64" Version="13.1.0" />
<PackageVersion Update="Aspire.Hosting.Orchestration.win-x64" Version="13.1.0" />
</ItemGroup>
</Project>
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env
LABEL stage=build-env
WORKDIR /app

Expand All @@ -24,9 +24,14 @@ RUN for plugin in /app/Plugins/*; do \
RUN dotnet publish /app/Web/Grand.Web/Grand.Web.csproj -c Release -o ./build/release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH

# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime

EXPOSE 8080
WORKDIR /app
COPY --from=build-env /app/build/release .

RUN chown -R app:app /app/App_Data /app/wwwroot /app/Plugins

USER app

ENTRYPOINT ["dotnet", "Grand.Web.dll"]
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ variables:

steps:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK 9'
displayName: 'Install .NET Core SDK 10'
inputs:
version: '9.0.x'
version: '10.0.x'

- task: Bash@3
displayName: Install .NET Aspire workload
Expand Down
7 changes: 3 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
"version": "10.0.100",
"rollForward": "latestFeature"
}
}
}
1 change: 1 addition & 0 deletions src/Aspire/Aspire.AppHost/Aspire.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Web\Grand.Web.Admin\Grand.Web.Admin.csproj" />
<ProjectReference Include="..\..\Web\Grand.Web.Store\Grand.Web.Store.csproj" />
<ProjectReference Include="..\..\Web\Grand.Web.Vendor\Grand.Web.Vendor.csproj" />
<ProjectReference Include="..\..\Web\Grand.Web\Grand.Web.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Build/Grand.Common.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ private static async Task<Stream> ReadAsync(Stream stream)
return ms;
}

public new async Task<IEnumerable<T>> FetchAsync<T>(Stream stream, int sheetIndex = 0,
public async Task<IEnumerable<T>> FetchAsync<T>(Stream stream, int sheetIndex = 0,
Func<string, object, object> valueParser = null)
{
using var ms = await ReadAsync(stream);
ms.Position = 0;
return Fetch(ms, typeof(T), sheetIndex, valueParser).OfType<T>();
}

public new IEnumerable Fetch(Stream stream, Type type, int sheetIndex,
public IEnumerable Fetch(Stream stream, Type type, int sheetIndex,
Func<string, object, object> valueParser = null)
{
Workbook = WorkbookFactory.Create(stream);
return Fetch(type, sheetIndex, valueParser);
}

public new IEnumerable Fetch(Type type, int sheetIndex = 0, Func<string, object, object> valueParser = null)
public IEnumerable Fetch(Type type, int sheetIndex = 0, Func<string, object, object> valueParser = null)
{
var sheet = Workbook.GetSheetAt(sheetIndex);
return Fetch(sheet, type, valueParser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Grand.SharedKernel;
using Grand.SharedKernel.Extensions;
using MediatR;
using System.IO;

namespace Grand.Business.Marketing.Services.Newsletters;

Expand Down Expand Up @@ -278,9 +279,9 @@ public virtual async Task<int> ImportNewsletterSubscribersFromTxt(Stream stream,
{
var count = 0;
using var reader = new StreamReader(stream);
while (!reader.EndOfStream)
string line;
while ((line = await reader.ReadLineAsync()) is not null)
{
var line = await reader.ReadLineAsync();
if (string.IsNullOrWhiteSpace(line))
continue;
var tmp = line.Split(',');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ public async Task PublishAsync<TMessage>(TMessage msg) where TMessage : IMessage

public Task SubscribeAsync()
{
_subscriber.SubscribeAsync(RedisChannel.Literal(_redisConfig.RedisPubSubChannel), (_, redisValue) =>
_ = _subscriber.SubscribeAsync(RedisChannel.Literal(_redisConfig.RedisPubSubChannel), (_, redisValue) =>
{
try
{
var message = JsonSerializer.Deserialize<MessageEventClient>(redisValue);
MessageEventClient message = null;
if (!redisValue.IsNull)
{
// Use the string overload explicitly to resolve ambiguity
message = JsonSerializer.Deserialize<MessageEventClient>(redisValue.ToString());
}
if (message != null && message.ClientId != ClientId)
OnSubscriptionChanged(message);
}
Expand Down
5 changes: 0 additions & 5 deletions src/Core/Grand.Infrastructure/Configuration/SecurityConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ public class SecurityConfig
public int HttpsRedirectionRedirect { get; set; }
public int? HttpsRedirectionHttpsPort { get; set; }

/// <summary>
/// When enabled, allowing Razor files to be updated if they're edited.
/// </summary>
public bool EnableRuntimeCompilation { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to verify access to a specific controller and action in the admin panel
/// using menu configuration.
Expand Down
3 changes: 1 addition & 2 deletions src/Core/Grand.Infrastructure/StartupBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ private static T StartupConfig<T>(this IServiceCollection services, IConfigurati
/// <param name="services">Collection of service descriptors</param>
private static void AddHttpContextAccessor(this IServiceCollection services)
{
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
}

/// <summary>
Expand Down
Loading
Loading