From c4ca52ab3ffb5ee2ea38564cad929648e6f805ad Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 15:07:29 +0100 Subject: [PATCH 01/20] PC-1122: Investigation results. Updated references to .net from 6.0 to 8.0, and C# from 10 to 11. Change ports to 8080 from 80. Update SDK from 5.0 to 8.0. --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 6 +++--- .../SeaPublicWebsite.BusinessLogic.csproj | 3 ++- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 3 ++- .../SeaPublicWebsite.UnitTests.csproj | 3 ++- SeaPublicWebsite/SeaPublicWebsite.csproj | 4 ++-- .../EnergyEfficiency/PdfGeneration/PdfGenerationService.cs | 2 +- docker-compose.yml | 2 +- global.json | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 4caa261c..777509c4 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 (6.0) + - name: Install .Net (8.0) uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore .Net dependencies run: dotnet restore --configfile Nuget.config diff --git a/Dockerfile b/Dockerfile index 24716bd7..b87462cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base +FROM mcr.microsoft.com/dotnet/aspnet:8.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:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /SeaPublicWebsite # Copy everything @@ -36,5 +36,5 @@ RUN dotnet publish -c Release -o out FROM base WORKDIR /SeaPublicWebsite COPY --from=build-env /SeaPublicWebsite/out . -EXPOSE 80 +EXPOSE 8080 ENTRYPOINT ["dotnet", "SeaPublicWebsite.dll"] diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 95b94a4c..6fe16802 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -1,8 +1,9 @@ - net6.0 + net8.0 enable + 11 diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 24de6be8..950e3f9d 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -1,8 +1,9 @@ - net6.0 + net8.0 enable + 11 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index ffd4b6a7..5b69c289 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -1,10 +1,11 @@ - net6.0 + net8.0 false Tests false + 11 diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index 1881927e..2a2bd458 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -1,8 +1,8 @@ - net6.0 - 10 + net8.0 + 11 b88a2d94-9041-47c6-ab29-ff57149dd347 true true diff --git a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs index 84403c48..4d767f8c 100644 --- a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs +++ b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs @@ -55,6 +55,6 @@ await page.SetCookieAsync(new CookieParam { private string GetLocalAddress() { // If the port the application runs on is ever changed this will need to be updated - return "http://localhost:80"; + return "http://localhost:8080"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 1a898ea7..9a9276a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: sea: build: . ports: - - "5001:80" + - "5001:8080" environment: ASPNETCORE_ENVIRONMENT: "Development" volumes: diff --git a/global.json b/global.json index 1d5e2b17..9a56770e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From bc133497f36dffd071b5f94ea7aa13a83bf8c6a8 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 17:23:43 +0100 Subject: [PATCH 02/20] PC-1122: Updated C# to 12. Reverted CLI SDK to 5.0 --- .../SeaPublicWebsite.BusinessLogic.csproj | 2 +- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 2 +- SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj | 2 +- SeaPublicWebsite/SeaPublicWebsite.csproj | 2 +- global.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 6fe16802..83f3a309 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -3,7 +3,7 @@ net8.0 enable - 11 + 12 diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 950e3f9d..55529b51 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -3,7 +3,7 @@ net8.0 enable - 11 + 12 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index 5b69c289..7cbbc1a4 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -5,7 +5,7 @@ false Tests false - 11 + 12 diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index 2a2bd458..dab4a7b6 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -2,7 +2,7 @@ net8.0 - 11 + 12 b88a2d94-9041-47c6-ab29-ff57149dd347 true true 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 } From 64d43d70d9d9d9d48871879cf75136d4ea39173d Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Fri, 7 Jun 2024 09:21:00 +0100 Subject: [PATCH 03/20] PC-1122: Updated .Net CLI to 8.0 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 1d5e2b17..9a56770e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From d07af0a32929d5ab8fc3cfd36dd412414e878647 Mon Sep 17 00:00:00 2001 From: Glenn-Clarke <152421975+Glenn-Clarke@users.noreply.github.com> Date: Fri, 21 Jun 2024 09:05:08 +0100 Subject: [PATCH 04/20] Revert "PC-1122: Investigation into updating C# & .NET versions" --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 6 +++--- .../SeaPublicWebsite.BusinessLogic.csproj | 3 +-- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 3 +-- .../SeaPublicWebsite.UnitTests.csproj | 3 +-- SeaPublicWebsite/SeaPublicWebsite.csproj | 4 ++-- .../EnergyEfficiency/PdfGeneration/PdfGenerationService.cs | 2 +- docker-compose.yml | 2 +- global.json | 2 +- 9 files changed, 13 insertions(+), 16 deletions(-) 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 b87462cc..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 @@ -36,5 +36,5 @@ RUN dotnet publish -c Release -o out FROM base WORKDIR /SeaPublicWebsite COPY --from=build-env /SeaPublicWebsite/out . -EXPOSE 8080 +EXPOSE 80 ENTRYPOINT ["dotnet", "SeaPublicWebsite.dll"] 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/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/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/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs index 4d767f8c..84403c48 100644 --- a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs +++ b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs @@ -55,6 +55,6 @@ await page.SetCookieAsync(new CookieParam { private string GetLocalAddress() { // If the port the application runs on is ever changed this will need to be updated - return "http://localhost:8080"; + return "http://localhost:80"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 9a9276a9..1a898ea7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: sea: build: . ports: - - "5001:8080" + - "5001:80" environment: ASPNETCORE_ENVIRONMENT: "Development" volumes: 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 } From 844c3a0870fd4fbf40797394a39b8088a3c1327c Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 15:07:29 +0100 Subject: [PATCH 05/20] PC-1122: Investigation results. Updated references to .net from 6.0 to 8.0, and C# from 10 to 11. Change ports to 8080 from 80. Update SDK from 5.0 to 8.0. (cherry picked from commit c4ca52ab3ffb5ee2ea38564cad929648e6f805ad) --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 6 +++--- .../SeaPublicWebsite.BusinessLogic.csproj | 3 ++- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 3 ++- .../SeaPublicWebsite.UnitTests.csproj | 3 ++- SeaPublicWebsite/SeaPublicWebsite.csproj | 4 ++-- .../EnergyEfficiency/PdfGeneration/PdfGenerationService.cs | 2 +- docker-compose.yml | 2 +- global.json | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 4caa261c..777509c4 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 (6.0) + - name: Install .Net (8.0) uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore .Net dependencies run: dotnet restore --configfile Nuget.config diff --git a/Dockerfile b/Dockerfile index 24716bd7..b87462cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base +FROM mcr.microsoft.com/dotnet/aspnet:8.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:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /SeaPublicWebsite # Copy everything @@ -36,5 +36,5 @@ RUN dotnet publish -c Release -o out FROM base WORKDIR /SeaPublicWebsite COPY --from=build-env /SeaPublicWebsite/out . -EXPOSE 80 +EXPOSE 8080 ENTRYPOINT ["dotnet", "SeaPublicWebsite.dll"] diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 95b94a4c..6fe16802 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -1,8 +1,9 @@ - net6.0 + net8.0 enable + 11 diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 24de6be8..950e3f9d 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -1,8 +1,9 @@ - net6.0 + net8.0 enable + 11 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index ffd4b6a7..5b69c289 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -1,10 +1,11 @@ - net6.0 + net8.0 false Tests false + 11 diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index 1881927e..2a2bd458 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -1,8 +1,8 @@ - net6.0 - 10 + net8.0 + 11 b88a2d94-9041-47c6-ab29-ff57149dd347 true true diff --git a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs index 84403c48..4d767f8c 100644 --- a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs +++ b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs @@ -55,6 +55,6 @@ await page.SetCookieAsync(new CookieParam { private string GetLocalAddress() { // If the port the application runs on is ever changed this will need to be updated - return "http://localhost:80"; + return "http://localhost:8080"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 1a898ea7..9a9276a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: sea: build: . ports: - - "5001:80" + - "5001:8080" environment: ASPNETCORE_ENVIRONMENT: "Development" volumes: diff --git a/global.json b/global.json index 1d5e2b17..9a56770e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From f3a911f4ad18fee100024858761a9ca279c8f28e Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 17:23:43 +0100 Subject: [PATCH 06/20] PC-1122: Updated C# to 12. Reverted CLI SDK to 5.0 (cherry picked from commit bc133497f36dffd071b5f94ea7aa13a83bf8c6a8) --- .../SeaPublicWebsite.BusinessLogic.csproj | 2 +- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 2 +- SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj | 2 +- SeaPublicWebsite/SeaPublicWebsite.csproj | 2 +- global.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 6fe16802..83f3a309 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -3,7 +3,7 @@ net8.0 enable - 11 + 12 diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 950e3f9d..55529b51 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -3,7 +3,7 @@ net8.0 enable - 11 + 12 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index 5b69c289..7cbbc1a4 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -5,7 +5,7 @@ false Tests false - 11 + 12 diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index 2a2bd458..dab4a7b6 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -2,7 +2,7 @@ net8.0 - 11 + 12 b88a2d94-9041-47c6-ab29-ff57149dd347 true true 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 } From dd16c206325168316717ba7110de40d25f56902d Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Fri, 7 Jun 2024 09:21:00 +0100 Subject: [PATCH 07/20] PC-1122: Updated .Net CLI to 8.0 (cherry picked from commit 64d43d70d9d9d9d48871879cf75136d4ea39173d) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 1d5e2b17..9a56770e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From c4679a5418d2a03eabe2647bc8a325c40edcd55d Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 17:23:43 +0100 Subject: [PATCH 08/20] PC-1050: Reverted port number changes --- Dockerfile | 2 +- .../EnergyEfficiency/PdfGeneration/PdfGenerationService.cs | 2 +- docker-compose.yml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b87462cc..22f3c933 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,5 +36,5 @@ RUN dotnet publish -c Release -o out FROM base WORKDIR /SeaPublicWebsite COPY --from=build-env /SeaPublicWebsite/out . -EXPOSE 8080 +EXPOSE 80 ENTRYPOINT ["dotnet", "SeaPublicWebsite.dll"] diff --git a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs index 4d767f8c..84403c48 100644 --- a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs +++ b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs @@ -55,6 +55,6 @@ await page.SetCookieAsync(new CookieParam { private string GetLocalAddress() { // If the port the application runs on is ever changed this will need to be updated - return "http://localhost:8080"; + return "http://localhost:80"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 9a9276a9..5c406c45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,10 @@ services: sea: build: . ports: - - "5001:8080" + - "5001:80" environment: ASPNETCORE_ENVIRONMENT: "Development" + ASPNETCORE_HTTP_PORTS: "80" volumes: # map the dotnet user-secret folder - $APPDATA/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro From 8370288f2eb08e02739e89ca51ff51aac86734b2 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Mon, 24 Jun 2024 11:57:51 +0100 Subject: [PATCH 09/20] PC-1122: Updated header dictionary adding to new method (headers.append) --- SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs | 2 +- SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs b/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs index ec65ba53..fc6975f2 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.Add(headerName, headerValue); + httpContext.Response.Headers.Append(headerName, headerValue); } } } diff --git a/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs b/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs index 83df4129..dce68140 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.Add("X-Content-Type-Options", "nosniff"); + context.Response.Headers.Append("X-Content-Type-Options", "nosniff"); } if (!context.Response.Headers.ContainsKey("Content-Security-Policy")) { - context.Response.Headers.Add("Content-Security-Policy", + context.Response.Headers.Append("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.Add("Referrer-Policy", "no-referrer"); + context.Response.Headers.Append("Referrer-Policy", "no-referrer"); } From 914442f6b55b50bb0f06db444dfcab7e1779ac0c Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Mon, 24 Jun 2024 13:48:00 +0100 Subject: [PATCH 10/20] PC-1050: Updated migration name to fix build warning regarding all lower case --- ...7_initial.Designer.cs => 20220609164007_Initial.Designer.cs} | 2 +- .../{20220609164007_initial.cs => 20220609164007_Initial.cs} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename SeaPublicWebsite.Data/Migrations/{20220609164007_initial.Designer.cs => 20220609164007_Initial.Designer.cs} (99%) rename SeaPublicWebsite.Data/Migrations/{20220609164007_initial.cs => 20220609164007_Initial.cs} (99%) 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 f11d30c2..badaca06 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 c525999f..33d9e0ab 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) { From 92e65b64d36ed330da1ed0caa80636555d47d9a8 Mon Sep 17 00:00:00 2001 From: Glenn-Clarke <152421975+Glenn-Clarke@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:51:02 +0100 Subject: [PATCH 11/20] Revert "Pc 1122 investigation into c# and .net update" --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 4 ++-- .../SeaPublicWebsite.BusinessLogic.csproj | 3 +-- ...itial.Designer.cs => 20220609164007_initial.Designer.cs} | 2 +- ...{20220609164007_Initial.cs => 20220609164007_initial.cs} | 2 +- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 3 +-- .../SeaPublicWebsite.UnitTests.csproj | 3 +-- SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs | 2 +- SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs | 6 +++--- SeaPublicWebsite/SeaPublicWebsite.csproj | 4 ++-- docker-compose.yml | 1 - global.json | 2 +- 12 files changed, 16 insertions(+), 20 deletions(-) rename SeaPublicWebsite.Data/Migrations/{20220609164007_Initial.Designer.cs => 20220609164007_initial.Designer.cs} (99%) rename SeaPublicWebsite.Data/Migrations/{20220609164007_Initial.cs => 20220609164007_initial.cs} (99%) 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/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 } From 34bcacf6577e225d81e00174494bd175eb06e824 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 15:07:29 +0100 Subject: [PATCH 12/20] PC-1122: Investigation results. Updated references to .net from 6.0 to 8.0, and C# from 10 to 11. Change ports to 8080 from 80. Update SDK from 5.0 to 8.0. (cherry picked from commit c4ca52ab3ffb5ee2ea38564cad929648e6f805ad) (cherry picked from commit 844c3a0870fd4fbf40797394a39b8088a3c1327c) --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 6 +++--- .../SeaPublicWebsite.BusinessLogic.csproj | 3 ++- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 3 ++- .../SeaPublicWebsite.UnitTests.csproj | 3 ++- SeaPublicWebsite/SeaPublicWebsite.csproj | 4 ++-- .../EnergyEfficiency/PdfGeneration/PdfGenerationService.cs | 2 +- docker-compose.yml | 2 +- global.json | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 4caa261c..777509c4 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 (6.0) + - name: Install .Net (8.0) uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore .Net dependencies run: dotnet restore --configfile Nuget.config diff --git a/Dockerfile b/Dockerfile index 24716bd7..b87462cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base +FROM mcr.microsoft.com/dotnet/aspnet:8.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:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /SeaPublicWebsite # Copy everything @@ -36,5 +36,5 @@ RUN dotnet publish -c Release -o out FROM base WORKDIR /SeaPublicWebsite COPY --from=build-env /SeaPublicWebsite/out . -EXPOSE 80 +EXPOSE 8080 ENTRYPOINT ["dotnet", "SeaPublicWebsite.dll"] diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 95b94a4c..6fe16802 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -1,8 +1,9 @@ - net6.0 + net8.0 enable + 11 diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 24de6be8..950e3f9d 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -1,8 +1,9 @@ - net6.0 + net8.0 enable + 11 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index ffd4b6a7..5b69c289 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -1,10 +1,11 @@ - net6.0 + net8.0 false Tests false + 11 diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index 1881927e..2a2bd458 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -1,8 +1,8 @@ - net6.0 - 10 + net8.0 + 11 b88a2d94-9041-47c6-ab29-ff57149dd347 true true diff --git a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs index 84403c48..4d767f8c 100644 --- a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs +++ b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs @@ -55,6 +55,6 @@ await page.SetCookieAsync(new CookieParam { private string GetLocalAddress() { // If the port the application runs on is ever changed this will need to be updated - return "http://localhost:80"; + return "http://localhost:8080"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 1a898ea7..9a9276a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: sea: build: . ports: - - "5001:80" + - "5001:8080" environment: ASPNETCORE_ENVIRONMENT: "Development" volumes: diff --git a/global.json b/global.json index 1d5e2b17..9a56770e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From 63cf654a0885a82e8d73b9ae14f7d5a4447bc6c2 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 17:23:43 +0100 Subject: [PATCH 13/20] PC-1122: Updated C# to 12. Reverted CLI SDK to 5.0 (cherry picked from commit bc133497f36dffd071b5f94ea7aa13a83bf8c6a8) (cherry picked from commit f3a911f4ad18fee100024858761a9ca279c8f28e) --- .../SeaPublicWebsite.BusinessLogic.csproj | 2 +- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 2 +- SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj | 2 +- SeaPublicWebsite/SeaPublicWebsite.csproj | 2 +- global.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj index 6fe16802..83f3a309 100644 --- a/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj +++ b/SeaPublicWebsite.BusinessLogic/SeaPublicWebsite.BusinessLogic.csproj @@ -3,7 +3,7 @@ net8.0 enable - 11 + 12 diff --git a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj index 950e3f9d..55529b51 100644 --- a/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj +++ b/SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj @@ -3,7 +3,7 @@ net8.0 enable - 11 + 12 diff --git a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj index 5b69c289..7cbbc1a4 100644 --- a/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj +++ b/SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj @@ -5,7 +5,7 @@ false Tests false - 11 + 12 diff --git a/SeaPublicWebsite/SeaPublicWebsite.csproj b/SeaPublicWebsite/SeaPublicWebsite.csproj index 2a2bd458..dab4a7b6 100644 --- a/SeaPublicWebsite/SeaPublicWebsite.csproj +++ b/SeaPublicWebsite/SeaPublicWebsite.csproj @@ -2,7 +2,7 @@ net8.0 - 11 + 12 b88a2d94-9041-47c6-ab29-ff57149dd347 true true 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 } From b3251426e3bd9a3887b47f8edd7f770ed783e74b Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Fri, 7 Jun 2024 09:21:00 +0100 Subject: [PATCH 14/20] PC-1122: Updated .Net CLI to 8.0 (cherry picked from commit 64d43d70d9d9d9d48871879cf75136d4ea39173d) (cherry picked from commit dd16c206325168316717ba7110de40d25f56902d) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 1d5e2b17..9a56770e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From 9cd3c63e9450dd6beb58fbc7edb415c6f1d35443 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 5 Jun 2024 17:23:43 +0100 Subject: [PATCH 15/20] PC-1050: Reverted port number changes (cherry picked from commit c4679a5418d2a03eabe2647bc8a325c40edcd55d) --- Dockerfile | 2 +- .../EnergyEfficiency/PdfGeneration/PdfGenerationService.cs | 2 +- docker-compose.yml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b87462cc..22f3c933 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,5 +36,5 @@ RUN dotnet publish -c Release -o out FROM base WORKDIR /SeaPublicWebsite COPY --from=build-env /SeaPublicWebsite/out . -EXPOSE 8080 +EXPOSE 80 ENTRYPOINT ["dotnet", "SeaPublicWebsite.dll"] diff --git a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs index 4d767f8c..84403c48 100644 --- a/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs +++ b/SeaPublicWebsite/Services/EnergyEfficiency/PdfGeneration/PdfGenerationService.cs @@ -55,6 +55,6 @@ await page.SetCookieAsync(new CookieParam { private string GetLocalAddress() { // If the port the application runs on is ever changed this will need to be updated - return "http://localhost:8080"; + return "http://localhost:80"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 9a9276a9..5c406c45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,10 @@ services: sea: build: . ports: - - "5001:8080" + - "5001:80" environment: ASPNETCORE_ENVIRONMENT: "Development" + ASPNETCORE_HTTP_PORTS: "80" volumes: # map the dotnet user-secret folder - $APPDATA/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro From 574388ac9ad044dbf5bbbf0d17980577f89101d3 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Mon, 24 Jun 2024 11:57:51 +0100 Subject: [PATCH 16/20] PC-1122: Updated header dictionary adding to new method (headers.append) (cherry picked from commit 8370288f2eb08e02739e89ca51ff51aac86734b2) --- SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs | 2 +- SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs b/SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs index ec65ba53..fc6975f2 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.Add(headerName, headerValue); + httpContext.Response.Headers.Append(headerName, headerValue); } } } diff --git a/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs b/SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs index 83df4129..dce68140 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.Add("X-Content-Type-Options", "nosniff"); + context.Response.Headers.Append("X-Content-Type-Options", "nosniff"); } if (!context.Response.Headers.ContainsKey("Content-Security-Policy")) { - context.Response.Headers.Add("Content-Security-Policy", + context.Response.Headers.Append("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.Add("Referrer-Policy", "no-referrer"); + context.Response.Headers.Append("Referrer-Policy", "no-referrer"); } From 3d3c099e58bc3c2d9ab7507579dc06a54c8382ca Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Mon, 24 Jun 2024 13:48:00 +0100 Subject: [PATCH 17/20] PC-1050: Updated migration name to fix build warning regarding all lower case (cherry picked from commit 914442f6b55b50bb0f06db444dfcab7e1779ac0c) --- ...7_initial.Designer.cs => 20220609164007_Initial.Designer.cs} | 2 +- .../{20220609164007_initial.cs => 20220609164007_Initial.cs} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename SeaPublicWebsite.Data/Migrations/{20220609164007_initial.Designer.cs => 20220609164007_Initial.Designer.cs} (99%) rename SeaPublicWebsite.Data/Migrations/{20220609164007_initial.cs => 20220609164007_Initial.cs} (99%) 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 f11d30c2..badaca06 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 c525999f..33d9e0ab 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) { From e3cd575a11814de668e47130a7561684f1b435a3 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Mon, 24 Jun 2024 17:03:48 +0100 Subject: [PATCH 18/20] PC-1050: Fix to concurrency issue with cache dictionary --- SeaPublicWebsite/Services/StaticAssetsVersioningService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs b/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs index a46b124a..c35b4e4f 100644 --- a/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs +++ b/SeaPublicWebsite/Services/StaticAssetsVersioningService.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; @@ -26,7 +27,7 @@ public StaticAssetsVersioningService(IWebHostEnvironment environment) private const string AppJsRegex = "app-.*.js"; private const string Html5ShivJsRegex = "html5shiv-.*.js"; - private Dictionary cachedFilenames = new Dictionary(); + private ConcurrentDictionary cachedFilenames = new(); public string GetAppCssFilename() => GetStaticFile(CompiledDirectory, AppCssRegex); public string GetAppIe8CssFilename() => GetStaticFile(CompiledDirectory, AppIe8CssRegex); From e58e8ad8863e7c6b7b935cf5892fda8e95886b2a Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Tue, 25 Jun 2024 10:52:13 +0100 Subject: [PATCH 19/20] PC-934: Copy text changes for July price cap change --- SeaPublicWebsite/Resources/SharedResources.cy.resx | 4 ++-- SeaPublicWebsite/Resources/SharedResources.resx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SeaPublicWebsite/Resources/SharedResources.cy.resx b/SeaPublicWebsite/Resources/SharedResources.cy.resx index 65294578..fa2f52fe 100644 --- a/SeaPublicWebsite/Resources/SharedResources.cy.resx +++ b/SeaPublicWebsite/Resources/SharedResources.cy.resx @@ -838,7 +838,7 @@ Os ydych chi’n hoffi unrhyw un o’r argymhellion hyn, gallwch eu cadw yn eich cynllun gweithredu cyn bwrw ymlaen. - Amcangyfrifon yw’r costau a’r arbedion a ddarparwn ac efallai na fyddant yr un fath yn ymarferol. Mae'r arbedion a ddangosir wedi’u seilio ar gap prisiau ynni Ebrill 2024 yn achos biliau nwy a thrydan, ac ar brisiau ynni RdSAP yn achos pob math arall o danwydd gwresogi. Wrth i brisiau ynni newid, felly bydd yr amcangyfrifon o arbedion. + Amcangyfrifon yw’r costau a’r arbedion a ddarparwn ac efallai na fyddant yr un fath yn ymarferol. Mae'r arbedion a ddangosir wedi’u seilio ar gap prisiau ynni Gorffennaf 2024 yn achos biliau nwy a thrydan, ac ar brisiau ynni RdSAP yn achos pob math arall o danwydd gwresogi. Wrth i brisiau ynni newid, felly bydd yr amcangyfrifon o arbedion. Mynd yn ôl at eich argymhellion ar ôl i chi adael @@ -1987,7 +1987,7 @@ Sylwer - Sylwer Mae’r ffigurau hyn ar gyfer gosodiad arferol mewn cartref fel eich un chi. Bydd eich amgylchiadau, manylion y gosodiadau a phrisiau ynni yn effeithio ar y costau a’r arbedion a welwch. Mae'r arbedion a ddangosir wedi’u seilio ar gap prisiau ynni Ebrill 2024 yn achos biliau nwy a thrydan, ac ar brisiau ynni RdSAP yn achos pob math arall o danwydd gwresogi. Wrth i brisiau ynni newid, felly bydd yr amcangyfrifon o arbedion. + Sylwer Mae’r ffigurau hyn ar gyfer gosodiad arferol mewn cartref fel eich un chi. Bydd eich amgylchiadau, manylion y gosodiadau a phrisiau ynni yn effeithio ar y costau a’r arbedion a welwch. Mae'r arbedion a ddangosir wedi’u seilio ar gap prisiau ynni Gorffennaf 2024 yn achos biliau nwy a thrydan, ac ar brisiau ynni RdSAP yn achos pob math arall o danwydd gwresogi. Wrth i brisiau ynni newid, felly bydd yr amcangyfrifon o arbedion. 1 funud diff --git a/SeaPublicWebsite/Resources/SharedResources.resx b/SeaPublicWebsite/Resources/SharedResources.resx index 6665bbeb..d9836f57 100644 --- a/SeaPublicWebsite/Resources/SharedResources.resx +++ b/SeaPublicWebsite/Resources/SharedResources.resx @@ -974,7 +974,7 @@ If you like any of these recommendations, you can save them to your action plan before you move on. - The costs and savings we provide are estimates and may not be the same in practice. The savings displayed are based on the April 2024 energy price cap for gas and electricity bills, and on the RdSAP energy prices for all other heating fuel types. As energy prices change, so will the estimates of savings. + The costs and savings we provide are estimates and may not be the same in practice. The savings displayed are based on the July 2024 energy price cap for gas and electricity bills, and on the RdSAP energy prices for all other heating fuel types. As energy prices change, so will the estimates of savings. Getting back to your recommendations once you leave @@ -2205,7 +2205,7 @@ Note - These figures are for a typical installation in a home like yours. The costs and savings you experience will be affected by your circumstances, the details of the installations and energy prices. The savings displayed are based on the April 2024 energy price cap for gas and electricity bills, and on the RdSAP energy prices for all other heating fuel types. As energy prices change, so will the estimates of savings. + These figures are for a typical installation in a home like yours. The costs and savings you experience will be affected by your circumstances, the details of the installations and energy prices. The savings displayed are based on the July 2024 energy price cap for gas and electricity bills, and on the RdSAP energy prices for all other heating fuel types. As energy prices change, so will the estimates of savings. 1 minute From 0bdf84dad5eff0acf61f08ba659cfa92530cb826 Mon Sep 17 00:00:00 2001 From: Glenn-Clarke <152421975+Glenn-Clarke@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:46:19 +0100 Subject: [PATCH 20/20] Revert "PC:1122 investigation into c# and .net update" --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 4 ++-- .../SeaPublicWebsite.BusinessLogic.csproj | 3 +-- ...itial.Designer.cs => 20220609164007_initial.Designer.cs} | 2 +- ...{20220609164007_Initial.cs => 20220609164007_initial.cs} | 2 +- SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj | 3 +-- .../SeaPublicWebsite.UnitTests.csproj | 3 +-- SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs | 2 +- SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs | 6 +++--- SeaPublicWebsite/SeaPublicWebsite.csproj | 4 ++-- SeaPublicWebsite/Services/StaticAssetsVersioningService.cs | 3 +-- docker-compose.yml | 1 - global.json | 2 +- 13 files changed, 17 insertions(+), 22 deletions(-) rename SeaPublicWebsite.Data/Migrations/{20220609164007_Initial.Designer.cs => 20220609164007_initial.Designer.cs} (99%) rename SeaPublicWebsite.Data/Migrations/{20220609164007_Initial.cs => 20220609164007_initial.cs} (99%) 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 }