Skip to content

Commit

Permalink
Merge pull request #301 from UKGovernmentBEIS/dev
Browse files Browse the repository at this point in the history
Dev -> Staging
  • Loading branch information
Glenn-Clarke authored Jul 1, 2024
2 parents da7aaf7 + 2bf26d6 commit c208ac7
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 -
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace SeaPublicWebsite.Data.Migrations
{
public partial class initial : Migration
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Expand Down
3 changes: 2 additions & 1 deletion SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion SeaPublicWebsite.UnitTests/SeaPublicWebsite.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Tests</RootNamespace>
<IsPublishable>false</IsPublishable>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SeaPublicWebsite/Middleware/BasicAuthMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions SeaPublicWebsite/Middleware/SecurityHeadersMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

}

Expand Down
4 changes: 2 additions & 2 deletions SeaPublicWebsite/SeaPublicWebsite.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>10</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<UserSecretsId>b88a2d94-9041-47c6-ab29-ff57149dd347</UserSecretsId>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Expand Down
3 changes: 2 additions & 1 deletion SeaPublicWebsite/Services/StaticAssetsVersioningService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -26,7 +27,7 @@ public StaticAssetsVersioningService(IWebHostEnvironment environment)
private const string AppJsRegex = "app-.*.js";
private const string Html5ShivJsRegex = "html5shiv-.*.js";

private Dictionary<string, string> cachedFilenames = new Dictionary<string, string>();
private ConcurrentDictionary<string, string> cachedFilenames = new();

public string GetAppCssFilename() => GetStaticFile(CompiledDirectory, AppCssRegex);
public string GetAppIe8CssFilename() => GetStaticFile(CompiledDirectory, AppIe8CssRegex);
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0",
"version": "8.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down

0 comments on commit c208ac7

Please sign in to comment.