diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 777509c4..4caa261c 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -17,10 +17,10 @@ jobs: - name: Checkout code onto job runner uses: actions/checkout@v2 - - name: Install .Net (8.0) + - name: Install .Net (6.0) uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.x + dotnet-version: 6.0.x - name: Restore .Net dependencies run: dotnet restore --configfile Nuget.config diff --git a/Dockerfile b/Dockerfile index 22f3c933..24716bd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 as base +FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base # Install Chrome RUN apt-get update && apt-get -f install && apt-get -y install wget gnupg2 apt-utils RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - @@ -7,7 +7,7 @@ RUN apt-get update \ && apt-get install -y google-chrome-stable --no-install-recommends --allow-downgrades fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf ENV PUPPETEER_EXECUTABLE_PATH "/usr/bin/google-chrome-stable" -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env WORKDIR /SeaPublicWebsite # Copy everything diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 83f3a309..95b94a4c 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -1,9 +1,8 @@ - net8.0 + net6.0 enable - 12 diff --git a/SeaPublicWebsite.Data/Migrations/20220609164007_Initial.Designer.cs b/SeaPublicWebsite.Data/Migrations/20220609164007_initial.Designer.cs similarity index 99% rename from SeaPublicWebsite.Data/Migrations/20220609164007_Initial.Designer.cs rename to SeaPublicWebsite.Data/Migrations/20220609164007_initial.Designer.cs index badaca06..f11d30c2 100644 --- a/SeaPublicWebsite.Data/Migrations/20220609164007_Initial.Designer.cs +++ b/SeaPublicWebsite.Data/Migrations/20220609164007_initial.Designer.cs @@ -13,7 +13,7 @@ namespace SeaPublicWebsite.Data.Migrations { [DbContext(typeof(SeaDbContext))] [Migration("20220609164007_initial")] - partial class Initial + partial class initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { diff --git a/SeaPublicWebsite.Data/Migrations/20220609164007_Initial.cs b/SeaPublicWebsite.Data/Migrations/20220609164007_initial.cs similarity index 99% rename from SeaPublicWebsite.Data/Migrations/20220609164007_Initial.cs rename to SeaPublicWebsite.Data/Migrations/20220609164007_initial.cs index 33d9e0ab..c525999f 100644 --- a/SeaPublicWebsite.Data/Migrations/20220609164007_Initial.cs +++ b/SeaPublicWebsite.Data/Migrations/20220609164007_initial.cs @@ -5,7 +5,7 @@ namespace SeaPublicWebsite.Data.Migrations { - public partial class Initial : Migration + public partial class initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 55529b51..24de6be8 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -1,9 +1,8 @@ - net8.0 + net6.0 enable - 12 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index 7cbbc1a4..ffd4b6a7 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -1,11 +1,10 @@ - net8.0 + net6.0 false Tests false - 12 diff --git a/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs b/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs index fc6975f2..ec65ba53 100644 --- a/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs +++ b/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs @@ -93,7 +93,7 @@ private static void AddOrUpdateHeader(HttpContext httpContext, string headerName } else { - httpContext.Response.Headers.Append(headerName, headerValue); + httpContext.Response.Headers.Add(headerName, headerValue); } } } diff --git a/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs b/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs index dce68140..83df4129 100644 --- a/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs +++ b/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs @@ -16,19 +16,19 @@ public Task Invoke(HttpContext context) { if (!context.Response.Headers.ContainsKey("X-Content-Type-Options")) { - context.Response.Headers.Append("X-Content-Type-Options", "nosniff"); + context.Response.Headers.Add("X-Content-Type-Options", "nosniff"); } if (!context.Response.Headers.ContainsKey("Content-Security-Policy")) { - context.Response.Headers.Append("Content-Security-Policy", + context.Response.Headers.Add("Content-Security-Policy", "default-src 'self'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'"); } if (!context.Response.Headers.ContainsKey("Referrer-Policy")) { - context.Response.Headers.Append("Referrer-Policy", "no-referrer"); + context.Response.Headers.Add("Referrer-Policy", "no-referrer"); } diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index dab4a7b6..1881927e 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -1,8 +1,8 @@ - net8.0 - 12 + net6.0 + 10 b88a2d94-9041-47c6-ab29-ff57149dd347 true true diff --git a/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs b/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs index c35b4e4f..a46b124a 100644 --- a/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs +++ b/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; @@ -27,7 +26,7 @@ public StaticAssetsVersioningService(IWebHostEnvironment environment) private const string AppJsRegex = "app-.*.js"; private const string Html5ShivJsRegex = "html5shiv-.*.js"; - private ConcurrentDictionary cachedFilenames = new(); + private Dictionary cachedFilenames = new Dictionary(); public string GetAppCssFilename() => GetStaticFile(CompiledDirectory, AppCssRegex); public string GetAppIe8CssFilename() => GetStaticFile(CompiledDirectory, AppIe8CssRegex); diff --git a/docker-compose.yml b/docker-compose.yml index 5c406c45..1a898ea7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,6 @@ services: - "5001:80" environment: ASPNETCORE_ENVIRONMENT: "Development" - ASPNETCORE_HTTP_PORTS: "80" volumes: # map the dotnet user-secret folder - $APPDATA/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro diff --git a/global.json b/global.json index 9a56770e..1d5e2b17 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0", + "version": "5.0", "rollForward": "latestMajor", "allowPrerelease": true }