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

bumped npm and nuget packages to fix vulnerabilities #589

Merged
merged 4 commits into from
Oct 14, 2024
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
29 changes: 0 additions & 29 deletions .github/workflows/docker_compose.yml

This file was deleted.

11 changes: 7 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app

# Copy everything and build
COPY ./ ./
RUN dotnet publish -c Release -o ./bin

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app/bin
COPY --from=build-env /app/bin/ .

# Set timezone
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ENTRYPOINT ["dotnet", "MASZ.dll"]
EXPOSE 80
EXPOSE 8080

USER app

ENTRYPOINT ["dotnet", "MASZ.dll"]
33 changes: 15 additions & 18 deletions backend/MASZ/MASZ.csproj
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<Content Remove="Properties\launchSettingsExample.json" />
</ItemGroup>

<ItemGroup>
<_WebToolingArtifacts Remove="Properties\launchSettings.json" />
<_WebToolingArtifacts Remove="Properties\launchSettingsExample.json" />
</ItemGroup>

<ItemGroup>
<Content Include="Properties\launchSettings.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.Discord" Version="6.0.1" />
<PackageReference Include="AspNetCoreRateLimit" Version="4.0.1" />
<PackageReference Include="Discord.Net" Version="3.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageReference Include="RestSharp" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="108.0.3" />
<PackageReference Include="Scrutor" Version="3.3.0" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="7.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.0" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.1.2" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="Azure.Identity" Version="1.11.4" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion backend/MASZ/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

builder.Logging.AddProvider(new LoggerProvider());

builder.WebHost.UseUrls("http://0.0.0.0:80/");
builder.WebHost.UseUrls("http://0.0.0.0:8080/");

string connectionString =
$"Server={ Environment.GetEnvironmentVariable("MYSQL_HOST")};" +
Expand Down
31 changes: 0 additions & 31 deletions backend/MASZ/Properties/launchSettingsExample.json

This file was deleted.

2 changes: 1 addition & 1 deletion backend/MASZ/Services/InternalConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public string GetDeployMode()

public string GetVersion()
{
return "v3.7.0";
return "v3.8.0";
}

public string GetDiscordBotStatus()
Expand Down
18 changes: 12 additions & 6 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
FROM node:16 AS compile-frontend
FROM node:20 AS compile-frontend
WORKDIR /svelte

COPY masz-svelte/ .
COPY masz-svelte/package.json .
COPY masz-svelte/package-lock.json .

RUN npm install
RUN npm run build

RUN apt update && apt install -y python3-pip
RUN python3 hashbuild.py
COPY masz-svelte/ .

RUN npm run build

FROM nginx:alpine

RUN rm -rf /usr/share/nginx/html/*

COPY static/ /var/www/data/static/
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=compile-frontend /svelte/public/ /var/www/data/
COPY --from=compile-frontend /svelte/dist/ /var/www/data/

# Set timezone
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN addgroup -S nginxgroup && adduser -S nginxuser -G nginxgroup
RUN chmod 777 /var/cache/nginx /var/run /etc/nginx /var/log/nginx

USER nginxuser

CMD ["nginx", "-g", "daemon off;"]

EXPOSE 80
99 changes: 0 additions & 99 deletions nginx/masz-svelte/hashbuild.py

This file was deleted.

22 changes: 22 additions & 0 deletions nginx/masz-svelte/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>

<title id="tabtitle">MASZ</title>

<link id="tabicon" rel='icon' type='image/x-icon' href='/favicon.ico'>

<link rel='stylesheet' href='/global.css'>

<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
</head>

<body>
<noscript>Please enable Javascript for this site to function.</noscript>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
Loading
Loading