Skip to content

Commit

Permalink
Merge pull request #332 from szyb/net9
Browse files Browse the repository at this point in the history
Net 9 + new version and models
  • Loading branch information
szyb authored Dec 28, 2024
2 parents edeeaec + eefda02 commit f564d29
Show file tree
Hide file tree
Showing 32 changed files with 194 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
dotnet-version: '9.0'
- name: Checkout repository
uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.300
dotnet-version: 9.0.101
- name: Install dependencies
working-directory: ./src
run: dotnet restore Synopackage.sln
Expand Down
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

12 changes: 5 additions & 7 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Build runtime image #
#######################

FROM mcr.microsoft.com/dotnet/aspnet:6.0.4-bullseye-slim as base
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0-bookworm-slim as base
WORKDIR /app
ENV ASPNETCORE_ENVIRONMENT docker
EXPOSE 80/tcp
EXPOSE 5000/tcp

##################
# Build frontend #
Expand All @@ -18,8 +18,7 @@ COPY Synopackage.Web .

RUN rm -rf wwwroot \
&& rm src/environments/environment.*.ts \
&& rm appsettings.*.json \
&& rm global.json
&& rm appsettings.*.json

COPY Synopackage.Web/src/environments/environment.ts src/environments
RUN true
Expand All @@ -37,7 +36,7 @@ RUN yarn --network-timeout 100000 \
# Build backend #
#################

FROM mcr.microsoft.com/dotnet/sdk:6.0.202-bullseye-slim as build-env
FROM mcr.microsoft.com/dotnet/sdk:9.0.101 as build-env
WORKDIR /app

COPY ["Synopackage.Web/Synopackage.Web.csproj", "Synopackage.Web/"]
Expand All @@ -51,8 +50,7 @@ RUN dotnet restore "Synopackage.Web/Synopackage.Web.csproj"
COPY . .
RUN rm -rf Synopackage.Web/wwwroot \
&& rm Synopackage.Web/src/environments/environment.*.ts \
&& rm Synopackage.Web/appsettings.*.json \
&& rm Synopackage.Web/global.json
&& rm Synopackage.Web/appsettings.*.json

COPY Synopackage.Web/appsettings.json Synopackage.Web/appsettings.json
RUN true
Expand Down
12 changes: 6 additions & 6 deletions src/Synopackage.Generator/Synopackage.Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.12.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.12.0" />
<!--<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<!--<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />-->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Scriban" Version="4.0.1" IncludeAssets="Build" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Scriban" Version="5.12.1" IncludeAssets="Build" />
</ItemGroup>
<PropertyGroup>
<PackageScribanIncludeSource>true</PackageScribanIncludeSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Synopackage.Model.Caching.Exceptions
{
[Serializable]
public class CacheConfigSectionNotFoundException : Exception
public sealed class CacheConfigSectionNotFoundException : Exception
{
public CacheConfigSectionNotFoundException()
{
Expand All @@ -21,9 +21,5 @@ public CacheConfigSectionNotFoundException(string message) : base($"Config secti
public CacheConfigSectionNotFoundException(string message, Exception innerException) : base(message, innerException)
{
}

protected CacheConfigSectionNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
64 changes: 42 additions & 22 deletions src/Synopackage.Model/Config/changelog.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
[
{
"version": "1.2.1",
"date": "2024-12-28",
"new": [],
"improved": [],
"fixed": [
"Fixed showing default model when not provided by user"
],
"removedSources": []
},
{
"version": "1.2.0",
"date": "2024-12-27",
"new": [
"Add DSM version 7.2.2",
"Add new models: DS423+, DS423, DS223j, DS223, DS224+, DS124",
"Backend upgraded to .NET 9"
],
"improved": [
"Removed old and unnecessary javascript code on loading page"
],
"fixed": [
"Privacy policy is more accurate regarding to logging IP addresses"
],
"removedSources": []
},
{
"version": "1.1.2",
"date": "2023-11-17",
"new": [
"Add DSM version 7.2.1"
],
"improved": [
],
"improved": [],
"fixed": [
"Fixed log files location"
],
Expand All @@ -20,12 +45,9 @@
"new": [
"Memory usage optimalization"
],
"improved": [
],
"fixed": [
],
"removedSources": [
]
"improved": [],
"fixed": [],
"removedSources": []
},
{
"version": "1.1.0",
Expand All @@ -34,23 +56,18 @@
"Introduced repository redirect to improve performance of the Synopackage Proxy Repository",
"Cphub back to the active source list"
],
"improved": [
],
"fixed": [
],
"removedSources": [
]
"improved": [],
"fixed": [],
"removedSources": []
},
{
"version": "1.0.15",
"date": "2023-05-22",
"new": [
"New DSM version: 7.2"
],
"improved": [
],
"fixed": [
],
"improved": [],
"fixed": [],
"removedSources": [
"acmenet - not a valid repository"
]
Expand Down Expand Up @@ -122,8 +139,7 @@
"fixed": [
"Security fixes"
],
"removedSources": [
]
"removedSources": []
},
{
"version": "1.0.9",
Expand Down Expand Up @@ -356,15 +372,19 @@
{
"version": "0.5.12",
"date": "2021-07-25",
"new": [ "Add imnks source for DSM 7" ],
"new": [
"Add imnks source for DSM 7"
],
"improved": [],
"fixed": [],
"removedSources": []
},
{
"version": "0.5.11",
"date": "2021-07-20",
"new": [ "Hofrichter repository is back to active" ],
"new": [
"Hofrichter repository is back to active"
],
"improved": [],
"fixed": [],
"removedSources": [
Expand Down
31 changes: 30 additions & 1 deletion src/Synopackage.Model/Config/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,35 @@
"Name": "DS923+",
"Arch": "r1000",
"Family": "x64"
},
{
"Name": "DS423+",
"Arch": "geminilake",
"Family": "x86_64"
},
{
"Name": "DS423",
"Arch": "rtd1619b",
"Family": "armv8"
},
{
"Name": "DS223j",
"Arch": "rtd1619b",
"Family": "armv8"
},
{
"Name": "DS223",
"Arch": "rtd1619b",
"Family": "armv8"
},
{
"Name": "DS224+",
"Arch": "geminilake",
"Family": "x86_64"
},
{
"Name": "DS124",
"Arch": "rtd1619b",
"Family": "armv8"
}

]
13 changes: 13 additions & 0 deletions src/Synopackage.Model/Config/news.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
[
{
"Date": "2024-12-27",
"Title": "Synopackage needs your help!",
"Body": [
"Synopackage.com is a free service since the begining. However everything cost money, hosting too. This is why we ask you for a help to get some funds for further running synopackage online. See the link below and support (if you can) by buying a coffee.",
"Today we released new version. It supports now DSM 7.2.2 and some new models. See changelog for details.",
"Enjoy!"
],
"RouterLinkDescription": null,
"RouterLink": null,
"ExternalLinkDescription": "https://buymeacoffee.com/synopackage",
"ExternalLink": "https://buymeacoffee.com/synopackage"
},
{
"Date": "2022-02-21",
"Title": "Synopackage.com - 1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Synopackage
{
[Serializable]
public class PageMissingException : Exception
public sealed class PageMissingException : Exception
{
public PageMissingException()
{
Expand All @@ -17,9 +17,5 @@ public PageMissingException(string message) : base(message)
public PageMissingException(string message, Exception innerException) : base(message, innerException)
{
}

protected PageMissingException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Synopackage
{
[Serializable]
public class RepositoryException : Exception
public sealed class RepositoryException : Exception
{
public RepositoryException()
{
Expand All @@ -18,8 +18,5 @@ public RepositoryException(string message, Exception innerException) : base(mess
{
}

protected RepositoryException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
1 change: 0 additions & 1 deletion src/Synopackage.Model/Model/Services/CacheService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class CacheService : ICacheService
private readonly ILogger<CacheService> logger;
private readonly IDownloadFactory downloadFactory;
private readonly ICacheOptionsManager cacheOptionsManager;
private readonly IOptions<RepositoryRedirectSettings> options;
private readonly string defaultIconExtension = "png";
private readonly string defaultCacheExtension = "cache";

Expand Down
26 changes: 13 additions & 13 deletions src/Synopackage.Model/Synopackage.Model.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<SourceGenerator_EnableLogging>True</SourceGenerator_EnableLogging>
Expand Down Expand Up @@ -61,23 +61,23 @@
<ProjectReference Include="..\Synopackage.Generator\Synopackage.Generator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="FluentValidation" Version="11.0.3" />
<PackageReference Include="Castle.Core" Version="5.1.1" />
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Include="FluentValidator" Version="2.0.4" />
<PackageReference Include="HolopaMir.ExpressMapper" Version="2.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.1.0">
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.12.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Polly" Version="7.2.3" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="9.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Polly" Version="8.5.0" />
<PackageReference Include="RestSharp" Version="106.12.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Synopackage.Web/Controllers/DownloadController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ private IHeaderDictionary PrepareResponseHeaders(Guid id, HttpWebResponse newRes
fileName = fileName ?? $"{id}.spk";

}
headers.Add(HeaderNames.ContentDisposition, $"attachment; filename=\"{fileName}\"");
headers.Append(HeaderNames.ContentDisposition, $"attachment; filename=\"{fileName}\"");

var lengthStr = newResponse.Headers[HeaderNames.ContentLength];
if (Int64.TryParse(lengthStr, out var length) && length > 0)
{
headers.Add(HeaderNames.ContentLength, length.ToString());
headers.Append(HeaderNames.ContentLength, length.ToString());
}
return headers;
}
Expand Down
Loading

0 comments on commit f564d29

Please sign in to comment.