Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Pc 1122 investigation into c# and .net update" #294

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 (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
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: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 -
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:8.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /SeaPublicWebsite

# Copy everything
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.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: 1 addition & 2 deletions SeaPublicWebsite.Data/SeaPublicWebsite.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.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.Append(headerName, headerValue);
httpContext.Response.Headers.Add(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.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");

}

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>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>10</LangVersion>
<UserSecretsId>b88a2d94-9041-47c6-ab29-ff57149dd347</UserSecretsId>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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": "8.0",
"version": "5.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down
Loading