Skip to content

Commit

Permalink
Merge pull request #90 from Gml-Launcher/develop
Browse files Browse the repository at this point in the history
Merge develop and master branches
  • Loading branch information
GamerVII-NET authored Nov 28, 2024
2 parents 3bd5ff8 + 8c27756 commit 939b67a
Show file tree
Hide file tree
Showing 60 changed files with 1,617 additions and 104 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
USER root
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
RUN apt-get update && apt-get install -y git
USER $APP_UID

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
Expand All @@ -21,9 +23,6 @@ FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Gml.Web.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

# Java installation stage
FROM adoptopenjdk:11-jdk AS java

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
![Banner](https://github.com/user-attachments/assets/48ab1c5d-6c38-4d1a-80ba-92db9afe8437)


![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Gml-Launcher/Gml.Web.Api/docker-package-publish.yml?label=Tests&style=for-the-badge&branch=master)
![GitHub contributors](https://img.shields.io/github/contributors/Gml-Launcher/Gml.Web.Api?style=for-the-badge)
![Size](https://img.shields.io/github/repo-size/Gml-Launcher/Gml.Web.Api?style=for-the-badge)
![License](https://img.shields.io/github/license/Gml-Launcher/Gml.Web.Api?style=for-the-badge)

# Gml.Web.Api

This is a RESTful API that provides an interface for interaction with server data.This is a comprehensive project,
designed to facilitate rapid deployment of server infrastructure for Minecraft game profiles: Forge, NeoForge, Fabric, LiteLoader.

# Documentation
[Official documentation](https://wiki.recloud.tech)

[Official wiki mirror](https://gml-launcher.github.io/Gml.Docs/home.html)
2 changes: 1 addition & 1 deletion src/Gml.Core
Submodule Gml.Core updated 52 files
+1 −1 src/CmlLib.Core.Installer.Forge
+1 −1 src/CmlLib.Core.Installer.NeoForge
+1 −1 src/CmlLib.ExtendedCore
+3 −3 src/Gml.Common/Gml.Common/SystemHelper.cs
+3 −1 src/Gml.Core.Interfaces/Enums/ProfileState.cs
+7 −0 src/Gml.Core.Interfaces/Enums/TextureProtocol.cs
+1 −1 src/Gml.Core.Interfaces/Gml.Core.Interfaces.csproj
+1 −0 src/Gml.Core.Interfaces/IGmlManager.cs
+19 −0 src/Gml.Core.Interfaces/Launcher/IBugInfo.cs
+5 −1 src/Gml.Core.Interfaces/Launcher/ILauncherInfo.cs
+17 −0 src/Gml.Core.Interfaces/Procedures/IBugTrackerProcedures.cs
+1 −0 src/Gml.Core.Interfaces/Procedures/IGameDownloaderProcedures.cs
+1 −1 src/Gml.Core.Interfaces/Procedures/ILauncherProcedures.cs
+2 −0 src/Gml.Core.Interfaces/Procedures/ISystemProcedures.cs
+1 −0 src/Gml.Core.Interfaces/Procedures/IUserProcedures.cs
+15 −0 src/Gml.Core.Interfaces/Sentry/IExceptionReport.cs
+14 −0 src/Gml.Core.Interfaces/Sentry/IMemoryInfo.cs
+15 −0 src/Gml.Core.Interfaces/Sentry/IStackTrace.cs
+9 −0 src/Gml.Core.Interfaces/Sentry/IStorageBug.cs
+12 −0 src/Gml.Core.Interfaces/Sentry/ProjectType.cs
+1 −0 src/Gml.Core.Interfaces/Storage/IStorageSettings.cs
+10 −0 src/Gml.Core.Interfaces/User/IPlayerTexture.cs
+89 −0 src/Gml.Core/Core/Helpers/BugTracker/BugStorage.cs
+138 −0 src/Gml.Core/Core/Helpers/BugTracker/BugTrackerProcedures.cs
+41 −13 src/Gml.Core/Core/Helpers/Files/FileStorageProcedures.cs
+95 −11 src/Gml.Core/Core/Helpers/Game/GameDownloader.cs
+25 −8 src/Gml.Core/Core/Helpers/Game/GameDownloaderProcedures.cs
+12 −6 src/Gml.Core/Core/Helpers/Launcher/LauncherProcedures.cs
+171 −52 src/Gml.Core/Core/Helpers/Profiles/ProfileProcedures.cs
+16 −2 src/Gml.Core/Core/Helpers/System/SystemProcedures.cs
+23 −2 src/Gml.Core/Core/Helpers/User/UserProcedures.cs
+7 −3 src/Gml.Core/Core/Integrations/ServicesIntegrationProcedures.cs
+9 −3 src/Gml.Core/Core/Integrations/TextureProvider.cs
+21 −0 src/Gml.Core/Core/Launcher/BugInfo.cs
+19 −0 src/Gml.Core/Core/Launcher/ExceptionReport.cs
+10 −3 src/Gml.Core/Core/Launcher/LauncherInfo.cs
+16 −0 src/Gml.Core/Core/Launcher/MemoryInfo.cs
+17 −0 src/Gml.Core/Core/Launcher/StackTrace.cs
+11 −0 src/Gml.Core/Core/Services/Storage/IStorageService.cs
+20 −0 src/Gml.Core/Core/Services/Storage/ReplaceParameterVisitor.cs
+104 −1 src/Gml.Core/Core/Services/Storage/SqliteStorageService.cs
+3 −0 src/Gml.Core/Core/User/User.cs
+1 −1 src/Gml.Core/Gml.Core.csproj
+7 −3 src/Gml.Core/GmlManager.cs
+44 −0 src/Gml.Core/Models/Converters/ExceptionReportConverter.cs
+38 −0 src/Gml.Core/Models/Converters/MemoryInfoConverter.cs
+54 −0 src/Gml.Core/Models/Converters/StackTraceConverter.cs
+13 −0 src/Gml.Core/Models/Storage/StorageItem.cs
+1 −0 src/Gml.Core/Models/Storage/StorageSettings.cs
+1 −1 src/Modrinth.Api/src/Modrinth.Api/Modrinth.Api.csproj
+1 −1 src/Pingo
+1 −0 tests/GmlCore.Tests/UnitTests.cs
13 changes: 13 additions & 0 deletions src/Gml.Web.Api.Domains/Gml.Web.Api.Domains.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,17 @@
<ProjectReference Include="..\Gml.Core\src\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<Compile Update="Integrations\AzuriomAuthResult.cs">
<DependentUpon>AuthResult.cs</DependentUpon>
</Compile>
<Compile Update="Integrations\UnicoreAuthResult.cs">
<DependentUpon>AuthResult.cs</DependentUpon>
</Compile>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Gml.Web.Api.Domains/Integrations/AuthResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ public class AuthResult
public bool IsSuccess { get; set; }
public string? Login { get; set; }
public string? Uuid { get; set; }
public string? Message { get; set; }
}
34 changes: 34 additions & 0 deletions src/Gml.Web.Api.Domains/Integrations/AzuriomAuthResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using Newtonsoft.Json;

namespace Gml.Web.Api.Domains.Integrations;

public class AzuriomAuthResult
{
[JsonProperty("id")]
public int Id { get; set; }

[JsonProperty("username")]
public string Username { get; set; }

[JsonProperty("email")]
public string Email { get; set; }

[JsonProperty("email_verified")]
public bool EmailVerified { get; set; }

[JsonProperty("money")]
public int Money { get; set; }

[JsonProperty("banned")]
public bool Banned { get; set; }

[JsonProperty("uuid")]
public string Uuid { get; set; }

[JsonProperty("access_token")]
public string AccessToken { get; set; }

[JsonProperty("created_at")]
public DateTime CreatedAt { get; set; }
}
85 changes: 85 additions & 0 deletions src/Gml.Web.Api.Domains/Integrations/UnicoreAuthResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using System;
using Newtonsoft.Json;

namespace Gml.Web.Api.Domains.Integrations;

public class UnicoreAuthResult
{
[JsonProperty("user")]
public User User { get; set; }

[JsonProperty("accessToken")]
public string AccessToken { get; set; }

[JsonProperty("refreshToken")]
public string RefreshToken { get; set; }
}

public class Ban
{
[JsonProperty("reason")]
public string Reason { get; set; }

[JsonProperty("expires")]
public object Expires { get; set; }

[JsonProperty("created")]
public DateTime Created { get; set; }
}

public class User
{
[JsonProperty("uuid")]
public string Uuid { get; set; }

[JsonProperty("username")]
public string Username { get; set; }

[JsonProperty("email")]
public string Email { get; set; }

[JsonProperty("password")]
public string Password { get; set; }

[JsonProperty("superuser")]
public bool Superuser { get; set; }

[JsonProperty("activated")]
public bool Activated { get; set; }

[JsonProperty("accessToken")]
public object AccessToken { get; set; }

[JsonProperty("serverId")]
public object ServerId { get; set; }

[JsonProperty("two_factor_enabled")]
public object TwoFactorEnabled { get; set; }

[JsonProperty("two_factor_secret")]
public object TwoFactorSecret { get; set; }

[JsonProperty("two_factor_secret_temp")]
public string TwoFactorSecretTemp { get; set; }

[JsonProperty("real")]
public int Real { get; set; }

[JsonProperty("virtual")]
public int Virtual { get; set; }

[JsonProperty("perms")]
public object Perms { get; set; }

[JsonProperty("created")]
public DateTime Created { get; set; }

[JsonProperty("updated")]
public DateTime Updated { get; set; }

[JsonProperty("cloak")]
public object Cloak { get; set; }

[JsonProperty("ban")]
public Ban Ban { get; set; }
}
12 changes: 12 additions & 0 deletions src/Gml.Web.Api.Domains/Sentry/SentryBugs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;
using GmlCore.Interfaces.Launcher;

namespace Gml.Web.Api.Domains.Sentry;

public class SentryBugs
{
public string Exception { get; set; }
public long CountUsers { get; set; }
public long Count { get; set; }
public IEnumerable<SentryGraphic> Graphics { get; set; }
}
9 changes: 9 additions & 0 deletions src/Gml.Web.Api.Domains/Sentry/SentryGraphic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Gml.Web.Api.Domains.Sentry;

public class SentryGraphic
{
public DateTime Month { get; set; }
public long Count { get; set; }
}
1 change: 1 addition & 0 deletions src/Gml.Web.Api.Domains/Settings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public class Settings
public string StorageLogin { get; set; }
public string StoragePassword { get; set; }
public StorageType StorageType { get; set; }
public TextureProtocol TextureProtocol { get; set; }
public bool RegistrationIsEnabled { get; set; }
}
1 change: 1 addition & 0 deletions src/Gml.Web.Api.Domains/Storage/StorageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ public class StorageSettings : IStorageSettings
public string? StorageHost { get; set; }
public string? StorageLogin { get; set; }
public string? StoragePassword { get; set; }
public TextureProtocol TextureProtocol { get; set; }
}
2 changes: 1 addition & 1 deletion src/Gml.Web.Api.Dto/Gml.Web.Api.Dto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.9.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Gml.Web.Api.Dto/Player/PlayerReadDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace Gml.Web.Api.Dto.Player;

public class PlayerReadDto
public class PlayerReadDto : PlayerTextureDto
{
public string Name { get; set; } = null!;
public string AccessToken { get; set; }
public string Uuid { get; set; }
public DateTime ExpiredDate { get; set; }
public string TextureSkinUrl { get; set; }
}
12 changes: 12 additions & 0 deletions src/Gml.Web.Api.Dto/Player/PlayerTextureDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using GmlCore.Interfaces.User;

namespace Gml.Web.Api.Dto.Player;

public class PlayerTextureDto : IPlayerTexture
{
public string TextureSkinUrl { get; set; } = null!;
public string TextureCloakUrl { get; set; } = null!;
public string TextureSkinGuid { get; set; } = null!;
public string TextureCloakGuid { get; set; } = null!;
public string FullSkinUrl { get; set; }
}
1 change: 1 addition & 0 deletions src/Gml.Web.Api.Dto/Profile/ProfileReadDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ProfileReadDto
public string LaunchVersion { get; set; }
public string IconBase64 { get; set; }
public string Background { get; set; }
public bool IsEnabled { get; set; }
public string JvmArguments { get; set; }
public string GameArguments { get; set; }
public ProfileState State { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Gml.Web.Api.Dto/Profile/ProfileReadInfoDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ProfileReadInfoDto
public string IconBase64 { get; set; }
public string Description { get; set; }
public string Arguments { get; set; }
public string IsEnabled { get; set; }
public string JvmArguments { get; set; }
public string GameArguments { get; set; }
public bool HasUpdate { get; set; }
Expand Down
11 changes: 11 additions & 0 deletions src/Gml.Web.Api.Dto/Sentry/BaseSentryError.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using Gml.Web.Api.Domains.Sentry;

namespace Gml.Web.Api.Dto.Sentry;

public class BaseSentryError
{
public IEnumerable<SentryBugs> Bugs { get; set; }
public long CountUsers { get; set; }
public long Count { get; set; }
}
43 changes: 43 additions & 0 deletions src/Gml.Web.Api.Dto/Sentry/SentryEventDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using Newtonsoft.Json;

namespace Gml.Web.Api.Dto.Sentry;

public class SentryEventDto
{
[JsonProperty("sdk")]
public Sdk Sdk { get; set; }

[JsonProperty("event_id")]
public string EventId { get; set; }

[JsonProperty("trace")]
public Trace Trace { get; set; }

[JsonProperty("sent_at")]
public DateTime SentAt { get; set; }
}

public class Sdk
{
[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("version")]
public string Version { get; set; }
}

public class Trace
{
[JsonProperty("trace_id")]
public string TraceId { get; set; }

[JsonProperty("public_key")]
public string PublicKey { get; set; }

[JsonProperty("release")]
public string Release { get; set; }

[JsonProperty("environment")]
public string Environment { get; set; }
}
13 changes: 13 additions & 0 deletions src/Gml.Web.Api.Dto/Sentry/SentryEventLengthDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Newtonsoft.Json;

namespace Gml.Web.Api.Dto.Sentry;

public class SentryEventLengthDto
{

[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("length")]
public int Length { get; set; }
}
16 changes: 16 additions & 0 deletions src/Gml.Web.Api.Dto/Sentry/SentryExceptionReadDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Collections.Generic;
using Gml.Web.Api.Domains.Sentry;
using GmlCore.Interfaces.Launcher;

namespace Gml.Web.Api.Dto.Sentry;

public class SentryExceptionReadDto
{
public string Exception { get; set; }
public long CountUsers { get; set; }
public long Count { get; set; }
public IEnumerable<SentryGraphic> Graphic { get; set; }
public IEnumerable<SentryOperationSystem> OperationSystems { get; set; }
public IBugInfo BugInfo { get; set; }
public string StackTrace { get; set; }
}
11 changes: 11 additions & 0 deletions src/Gml.Web.Api.Dto/Sentry/SentryFilterDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using GmlCore.Interfaces.Sentry;

namespace Gml.Web.Api.Dto.Sentry;

public class SentryFilterDto
{
public ProjectType ProjectType { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
Loading

0 comments on commit 939b67a

Please sign in to comment.