mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Update to dotnet 7
This commit is contained in:
parent
714b7d845a
commit
5d72fe44ab
@ -1,10 +1,11 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 as transcoder
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 as transcoder
|
||||
RUN apt-get update && apt-get install -y cmake make libavutil-dev libavcodec-dev libavformat-dev
|
||||
WORKDIR /transcoder
|
||||
COPY src/Kyoo.Transcoder .
|
||||
RUN cmake . && make -j
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 as builder
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 as builder
|
||||
WORKDIR /kyoo
|
||||
|
||||
COPY Kyoo.sln ./Kyoo.sln
|
||||
COPY nuget.config ./nuget.config
|
||||
@ -22,7 +23,7 @@ COPY . .
|
||||
ARG VERSION
|
||||
RUN dotnet publish --no-restore -c Release -o /app "-p:Version=${VERSION:-"0.0.0-dev"};SkipTranscoder=true" src/Kyoo.Host
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||
RUN apt-get update && apt-get install -y libavutil-dev libavcodec-dev libavformat-dev curl
|
||||
COPY --from=builder /app /app
|
||||
COPY --from=transcoder /transcoder/libtranscoder.so /app
|
||||
@ -31,4 +32,3 @@ WORKDIR /kyoo
|
||||
EXPOSE 5000
|
||||
HEALTHCHECK --interval=5s CMD curl --fail http://localhost:5000/health || exit
|
||||
CMD /app/Kyoo.Host
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 as transcoder
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 as transcoder
|
||||
# Using the dotnet sdk as a base image to have the same versions of glibc/ffmpeg
|
||||
RUN apt-get update && apt-get install -y gcc cmake make libavutil-dev libavcodec-dev libavformat-dev
|
||||
WORKDIR /transcoder
|
||||
COPY src/Kyoo.Transcoder .
|
||||
RUN cmake . && make -j
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0
|
||||
RUN apt-get update && apt-get install -y libavutil-dev libavcodec-dev libavformat-dev curl
|
||||
WORKDIR /app
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<LangVersion>default</LangVersion>
|
||||
<Company>Kyoo</Company>
|
||||
<Authors>Kyoo</Authors>
|
||||
|
@ -6,11 +6,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofac" Version="6.2.0" />
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0" />
|
||||
<PackageReference Include="Autofac" Version="6.5.0" />
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="System.ComponentModel.Composition" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -64,12 +64,12 @@ namespace Kyoo.Authentication
|
||||
string secret = _configuration.GetValue("AUTHENTICATION_SECRET", AuthenticationOption.DefaultSecret);
|
||||
PermissionOption permissions = new()
|
||||
{
|
||||
Default = _configuration.GetValue<string>("UNLOGGED_PERMISSIONS", "overall.read").Split(','),
|
||||
NewUser = _configuration.GetValue<string>("DEFAULT_PERMISSIONS", "overall.read").Split(','),
|
||||
Default = _configuration.GetValue("UNLOGGED_PERMISSIONS", "overall.read").Split(','),
|
||||
NewUser = _configuration.GetValue("DEFAULT_PERMISSIONS", "overall.read").Split(','),
|
||||
ApiKeys = _configuration.GetValue("KYOO_APIKEYS", string.Empty).Split(','),
|
||||
};
|
||||
services.AddSingleton<PermissionOption>(permissions);
|
||||
services.AddSingleton<AuthenticationOption>(new AuthenticationOption()
|
||||
services.AddSingleton(permissions);
|
||||
services.AddSingleton(new AuthenticationOption()
|
||||
{
|
||||
Secret = secret,
|
||||
Permissions = permissions,
|
||||
|
@ -6,9 +6,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.12" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2" />
|
||||
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
|
||||
<ProjectReference Include="../Kyoo.Abstractions/Kyoo.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -13,14 +13,14 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCore.Proxy" Version="4.4.0" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.8" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../Kyoo.Abstractions/Kyoo.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\Kyoo.Postgresql\Kyoo.Postgresql.csproj" />
|
||||
<ProjectReference Include="../Kyoo.Postgresql/Kyoo.Postgresql.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="BuildTranscoder" BeforeTargets="BeforeBuild" Condition="'$(SkipTranscoder)' != 'true' And !Exists('$(TranscoderRoot)/build/$(TranscoderBinary)')">
|
||||
|
@ -7,14 +7,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Expressions" Version="3.2.0" />
|
||||
<PackageReference Include="Serilog.Sinks.SyslogMessages" Version="2.0.6" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
|
||||
<PackageReference Include="Autofac" Version="6.2.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
|
||||
<PackageReference Include="Serilog.Expressions" Version="3.4.1" />
|
||||
<PackageReference Include="Serilog.Sinks.SyslogMessages" Version="2.0.7" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="7.0.0" />
|
||||
<PackageReference Include="Autofac" Version="6.5.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Autofac.Extras.AttributeMetadata" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -5,14 +5,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="5.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.7">
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="5.0.7" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.8" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -48,6 +48,8 @@ namespace Kyoo.Postgresql
|
||||
/// </summary>
|
||||
private readonly bool _skipConfigure;
|
||||
|
||||
// TOOD: This needs ot be updated but ef-core still does not offer a way to use this.
|
||||
[Obsolete]
|
||||
static PostgresContext()
|
||||
{
|
||||
NpgsqlConnection.GlobalTypeMapper.MapEnum<Status>();
|
||||
@ -89,10 +91,7 @@ namespace Kyoo.Postgresql
|
||||
{
|
||||
if (!_skipConfigure)
|
||||
{
|
||||
if (_connection != null)
|
||||
optionsBuilder.UseNpgsql(_connection);
|
||||
else
|
||||
optionsBuilder.UseNpgsql();
|
||||
optionsBuilder.UseNpgsql();
|
||||
if (_debugMode)
|
||||
optionsBuilder.EnableDetailedErrors().EnableSensitiveDataLogging();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NSwag.AspNetCore" Version="13.13.2" />
|
||||
<PackageReference Include="NSwag.AspNetCore" Version="13.18.2" />
|
||||
<ProjectReference Include="../Kyoo.Abstractions/Kyoo.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -30,7 +30,7 @@ namespace Kyoo.Swagger
|
||||
/// <inheritdoc />
|
||||
public void Process(SchemaProcessorContext context)
|
||||
{
|
||||
if (!context.Type.IsAssignableTo(typeof(IThumbnails)))
|
||||
if (!context.ContextualType.OriginalType.IsAssignableTo(typeof(IThumbnails)))
|
||||
return;
|
||||
foreach ((int _, string imageP) in Images.ImageName)
|
||||
{
|
||||
|
@ -1,28 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<LangVersion>default</LangVersion>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Divergic.Logging.Xunit" Version="3.6.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="5.10.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="Divergic.Logging.Xunit" Version="4.2.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.9.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.4" />
|
||||
<PackageReference Include="TvDbSharper" Version="3.2.2" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0">
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
@ -30,6 +30,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../src/Kyoo.Abstractions/Kyoo.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\..\src\Kyoo.Host\Kyoo.Host.csproj" />
|
||||
<ProjectReference Include="../../src/Kyoo.Host/Kyoo.Host.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -124,9 +124,13 @@ const App = ({ Component, pageProps }: AppProps) => {
|
||||
|
||||
App.getInitialProps = async (ctx: AppContext) => {
|
||||
const appProps = await NextApp.getInitialProps(ctx);
|
||||
const Component = ctx.Component as QueryPage;
|
||||
|
||||
const getUrl = (ctx.Component as QueryPage).getFetchUrls;
|
||||
const getLayoutUrl = ((ctx.Component as QueryPage).getLayout as QueryPage)?.getFetchUrls;
|
||||
const getUrl = Component.getFetchUrls;
|
||||
const getLayoutUrl =
|
||||
Component.getLayout && "Layout" in Component.getLayout
|
||||
? Component.getLayout.Layout.getFetchUrls
|
||||
: Component.getLayout?.getFetchUrls;
|
||||
|
||||
const urls: QueryIdentifier[] = [
|
||||
...(getUrl ? getUrl(ctx.router.query as any) : []),
|
||||
|
@ -155,8 +155,8 @@ export type QueryIdentifier<T = unknown> = {
|
||||
export type QueryPage<Props = {}> = ComponentType<Props> & {
|
||||
getFetchUrls?: (route: { [key: string]: string }) => QueryIdentifier[];
|
||||
getLayout?:
|
||||
| ComponentType<{ page: ReactElement }>
|
||||
| { Layout: ComponentType<{ page: ReactElement }>; props: object };
|
||||
| QueryPage<{ page: ReactElement }>
|
||||
| { Layout: QueryPage<{ page: ReactElement }>; props: object };
|
||||
};
|
||||
|
||||
const toQueryKey = <Data,>(query: QueryIdentifier<Data>) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user