Skip to content
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: 4 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push image
uses: docker/build-push-action@v6
with:
platforms: linux/arm64,linux/amd64
context: .
file: ./Dockerfile
push: true
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["EOToolsWeb.Api/EOToolsWeb.Api.csproj", "EOToolsWeb.Api/"]
Expand Down
84 changes: 42 additions & 42 deletions EOToolsWeb.Api/EOToolsWeb.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>82c8340f-25e9-428c-a86e-94acf0c6eda1</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>82c8340f-25e9-428c-a86e-94acf0c6eda1</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<Content Remove="Config.json" />
</ItemGroup>
<ItemGroup>
<Content Remove="Config.json" />
</ItemGroup>

<ItemGroup>
<None Include="Assets\Config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="Assets\Config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="DynamicData" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DynamicData" Version="9.4.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="NSwag.AspNetCore" Version="14.6.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EOToolsWeb.Shared\EOToolsWeb.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EOToolsWeb.Shared\EOToolsWeb.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Assets\EOTools.zip">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\EOTools.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\pull.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\push.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="Assets\EOTools.zip">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\EOTools.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\pull.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\push.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
57 changes: 16 additions & 41 deletions EOToolsWeb.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
using EOToolsWeb.Api.Services;
using EOToolsWeb.Api.Services.GitManager;
using EOToolsWeb.Api.Services.UpdateData;
using EOToolsWeb.Shared.Sessions;
using Microsoft.AspNetCore.Authentication;
using Microsoft.EntityFrameworkCore;
using Microsoft.OpenApi.Models;
using NSwag;
using NSwag.Generation.Processors.Security;
using System.Reflection.Metadata;
using System.Runtime.InteropServices;
using System.Text.Encodings.Web;
using System.Text.Json;
using EOToolsWeb.Shared.Sessions;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -18,55 +20,28 @@
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();

builder.Services.AddSwaggerGen(option =>
builder.Services.AddOpenApiDocument(option =>
{
option.AddSecurityDefinition("ApiAuthentication", new OpenApiSecurityScheme
option.AddSecurity("ApiAuthentication", new OpenApiSecurityScheme()
{
In = ParameterLocation.Header,
In = OpenApiSecurityApiKeyLocation.Header,
Description = "Username / Password",
Name = "Authorization",
Type = SecuritySchemeType.Http,
Type = OpenApiSecuritySchemeType.Http,
Scheme = "Basic",
});

option.AddSecurityDefinition("TokenAuthentication", new OpenApiSecurityScheme
option.AddSecurity("TokenAuthentication", new OpenApiSecurityScheme
{
In = ParameterLocation.Header,
In = OpenApiSecurityApiKeyLocation.Header,
Description = "Token",
Name = "X-TOKEN-EO-TOOLS-WEB-X",
Type = SecuritySchemeType.ApiKey,
Type = OpenApiSecuritySchemeType.ApiKey,
Scheme = "",
});

option.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Type = ReferenceType.SecurityScheme,
Id = "ApiAuthentication"
}
},
new string[]{}
}
});

option.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Type = ReferenceType.SecurityScheme,
Id = "TokenAuthentication"
}
},
new string[]{}
}
});
option.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("ApiAuthentication"));
option.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("TokenAuthentication"));
});

builder.Services.AddScoped<UsersService>();
Expand Down Expand Up @@ -120,10 +95,10 @@
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(config =>
app.UseOpenApi();
app.UseSwaggerUi(config =>
{
config.EnablePersistAuthorization();
config.PersistAuthorization = true;
});
}

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="10.0.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions EOToolsWeb.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
# Visual Studio Version 18
VisualStudioVersion = 18.3.11206.111 d18.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOToolsWeb", "EOToolsWeb\EOToolsWeb\EOToolsWeb.csproj", "{FF84FDF0-DA65-4DC3-B4FB-52A057315CAD}"
EndProject
Expand All @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.dockerignore = .dockerignore
.gitignore = .gitignore
.github\workflows\docker-image.yml = .github\workflows\docker-image.yml
Dockerfile = Dockerfile
EndProjectSection
EndProject
Expand Down
7 changes: 4 additions & 3 deletions EOToolsWeb/EOToolsWeb.Desktop/EOToolsWeb.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<OutputType>WinExe</OutputType>
<!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
One for Windows with net8.0-windows TFM, one for MacOS with net8.0-macos and one with net8.0 TFM for Linux.-->
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
</PropertyGroup>
Expand All @@ -13,9 +13,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.3.7" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.7" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.8" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions EOToolsWeb/EOToolsWeb.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ internal sealed class Program
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);

// TODO : Need to replace the nuget Avalonia.ReactiveUI by ReactiveUI.Avalonia
// This can't be done for the moment cause of an issue on startup
// See https://github.com/reactiveui/ReactiveUI/issues/4123

// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
Expand Down
27 changes: 13 additions & 14 deletions EOToolsWeb/EOToolsWeb/EOToolsWeb.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<AssemblyVersion>2.4.2</AssemblyVersion>
<FileVersion>2.4.2</FileVersion>
<AssemblyVersion>2.5.0</AssemblyVersion>
<FileVersion>2.5.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,19 +23,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.7" />
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.3.7" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.7" />
<PackageReference Include="Avalonia" Version="11.3.8" />
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.3.8" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.8" />
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.5" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.7" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.7" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.7" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.8" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.3.8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.7" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="ReactiveUI" Version="20.1.63" />
<PackageReference Include="SkiaSharp" Version="2.88.9" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.8" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="SkiaSharp" Version="3.119.1" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 7 additions & 7 deletions EoToolsWeb.Updater/EoToolsWeb.Updater.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand All @@ -10,13 +10,13 @@


<ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.7" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.7" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.7" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.7" />
<PackageReference Include="Avalonia" Version="11.3.8" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.8" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.7" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview3" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.8" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
</ItemGroup>


Expand Down