From fe89cc6ef9c37169d0f388c38ef2b13d5f03c522 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Mon, 23 Sep 2024 13:54:07 +0300 Subject: [PATCH] Renamed CrashReportServer to CrashReport.Server --- .github/workflows/backend-docker.yml | 4 +-- .github/workflows/dotnet-format-daily.yml | 2 +- .../BUTR.CrashReport.Server.Base.csproj} | 9 ++--- .../Contexts/AppDbContext.cs | 6 ++-- .../Config/BaseEntityConfiguration.cs | 4 +-- .../Config/FileEntityConfiguration.cs | 4 +-- .../Contexts/Config/IdEntityConfiguration.cs | 4 +-- .../Config/JsonEntityConfiguration.cs | 4 +-- .../Extensions/HostExtensions.cs | 2 +- .../Extensions/TextExtensions.cs | 2 +- .../Extensions/UnicodeStream.cs | 2 +- .../Models/Database/FileEntity.cs | 2 +- .../Models/Database/IEntity.cs | 3 ++ .../Models/Database/IdEntity.cs | 2 +- .../Models/Database/JsonEntity.cs | 2 +- .../Options/AuthOptions.cs | 2 +- .../Options/CrashUploadOptions.cs | 2 +- .../Options/StorageOptions.cs | 2 +- .../Services/BasicUserValidationService.cs | 4 +-- .../Services/DatabaseMigrator.cs | 6 ++-- .../Services/FileIdGenerator.cs | 10 ++++-- .../Services/GZipCompressor.cs | 2 +- .../Services/HexGenerator.cs | 2 +- ...Server.sln => BUTR.CrashReport.Server.sln} | 8 ++--- .../BUTR.CrashReport.Server.v13.csproj} | 2 +- .../CrashReportUploadBodyV13.cs | 2 +- .../JsonHandlerV13.cs | 12 +++---- .../BUTR.CrashReport.Server.v14.csproj} | 2 +- .../CrashReportUploadBodyV14.cs | 2 +- .../HtmlHandlerV14.cs | 10 +++--- .../JsonHandlerV14.cs | 12 +++---- .../BUTR.CrashReport.Server.csproj} | 6 ++-- .../Controllers/CrashUploadController.cs | 8 ++--- .../Controllers/ReportController.cs | 14 ++++---- src/BUTR.CrashReport.Server/Dockerfile | 36 +++++++++++++++++++ .../20240224211446_Initial.Designer.cs | 22 ++++++------ .../Migrations/20240224211446_Initial.cs | 2 +- .../Migrations/AppDbContextModelSnapshot.cs | 22 ++++++------ .../Models/API/FileMetadata.cs | 2 +- .../Models/Sitemaps/ChangeFrequency.cs | 2 +- .../Models/Sitemaps/Sitemap.cs | 2 +- .../Models/Sitemaps/SitemapIndex.cs | 2 +- .../Models/Sitemaps/Url.cs | 2 +- .../Models/Sitemaps/Urlset.cs | 2 +- .../Models/TLSError.cs | 3 ++ .../Options/OtlpOptions.cs | 2 +- .../Program.cs | 6 ++-- .../Properties/launchSettings.json | 0 .../RequireHttpsAttribute.cs | 4 +-- .../Startup.cs | 12 +++---- .../Utils/CrashReportRawParser.cs | 2 +- .../appsettings.Development.json | 0 .../Models/Database/IEntity.cs | 3 -- src/BUTR.CrashReportServer/Dockerfile | 36 ------------------- src/BUTR.CrashReportServer/Models/TLSError.cs | 3 -- 55 files changed, 167 insertions(+), 158 deletions(-) rename src/{BUTR.CrashReportServer.Base/BUTR.CrashReportServer.Base.csproj => BUTR.CrashReport.Server.Base/BUTR.CrashReport.Server.Base.csproj} (73%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Contexts/AppDbContext.cs (82%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Contexts/Config/BaseEntityConfiguration.cs (80%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Contexts/Config/FileEntityConfiguration.cs (88%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Contexts/Config/IdEntityConfiguration.cs (86%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Contexts/Config/JsonEntityConfiguration.cs (88%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Extensions/HostExtensions.cs (95%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Extensions/TextExtensions.cs (95%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Extensions/UnicodeStream.cs (99%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Models/Database/FileEntity.cs (77%) create mode 100644 src/BUTR.CrashReport.Server.Base/Models/Database/IEntity.cs rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Models/Database/IdEntity.cs (83%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Models/Database/JsonEntity.cs (77%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Options/AuthOptions.cs (71%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Options/CrashUploadOptions.cs (84%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Options/StorageOptions.cs (60%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Services/BasicUserValidationService.cs (91%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Services/DatabaseMigrator.cs (96%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Services/FileIdGenerator.cs (86%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Services/GZipCompressor.cs (97%) rename src/{BUTR.CrashReportServer.Base => BUTR.CrashReport.Server.Base}/Services/HexGenerator.cs (96%) rename src/{BUTR.CrashReportServer.sln => BUTR.CrashReport.Server.sln} (88%) rename src/{BUTR.CrashReportServer.v13/BUTR.CrashReportServer.v13.csproj => BUTR.CrashReport.Server.v13/BUTR.CrashReport.Server.v13.csproj} (87%) rename src/{BUTR.CrashReportServer.v13 => BUTR.CrashReport.Server.v13}/CrashReportUploadBodyV13.cs (82%) rename src/{BUTR.CrashReportServer.v13 => BUTR.CrashReport.Server.v13}/JsonHandlerV13.cs (94%) rename src/{BUTR.CrashReportServer.v14/BUTR.CrashReportServer.v14.csproj => BUTR.CrashReport.Server.v14/BUTR.CrashReport.Server.v14.csproj} (88%) rename src/{BUTR.CrashReportServer.v14 => BUTR.CrashReport.Server.v14}/CrashReportUploadBodyV14.cs (82%) rename src/{BUTR.CrashReportServer.v14 => BUTR.CrashReport.Server.v14}/HtmlHandlerV14.cs (94%) rename src/{BUTR.CrashReportServer.v14 => BUTR.CrashReport.Server.v14}/JsonHandlerV14.cs (94%) rename src/{BUTR.CrashReportServer/BUTR.CrashReportServer.csproj => BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj} (92%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Controllers/CrashUploadController.cs (94%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Controllers/ReportController.cs (97%) create mode 100644 src/BUTR.CrashReport.Server/Dockerfile rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Migrations/20240224211446_Initial.Designer.cs (77%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Migrations/20240224211446_Initial.cs (98%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Migrations/AppDbContextModelSnapshot.cs (76%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Models/API/FileMetadata.cs (70%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Models/Sitemaps/ChangeFrequency.cs (88%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Models/Sitemaps/Sitemap.cs (85%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Models/Sitemaps/SitemapIndex.cs (87%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Models/Sitemaps/Url.cs (94%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Models/Sitemaps/Urlset.cs (86%) create mode 100644 src/BUTR.CrashReport.Server/Models/TLSError.cs rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Options/OtlpOptions.cs (92%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Program.cs (97%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Properties/launchSettings.json (100%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/RequireHttpsAttribute.cs (94%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Startup.cs (96%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/Utils/CrashReportRawParser.cs (99%) rename src/{BUTR.CrashReportServer => BUTR.CrashReport.Server}/appsettings.Development.json (100%) delete mode 100644 src/BUTR.CrashReportServer.Base/Models/Database/IEntity.cs delete mode 100644 src/BUTR.CrashReportServer/Dockerfile delete mode 100644 src/BUTR.CrashReportServer/Models/TLSError.cs diff --git a/.github/workflows/backend-docker.yml b/.github/workflows/backend-docker.yml index 2037903..b5d0e46 100644 --- a/.github/workflows/backend-docker.yml +++ b/.github/workflows/backend-docker.yml @@ -47,7 +47,7 @@ jobs: with: builder: ${{ steps.buildx.outputs.name }} context: ./ - file: ./src/BUTR.CrashReportServer/Dockerfile + file: ./src/BUTR.CrashReport.Server/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ghcr.io/butr/crashreportserver:latest @@ -61,5 +61,5 @@ jobs: uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.TOKEN_GPR }} - repository: BUTR/BUTR.CrashReportServer + repository: BUTR/BUTR.CrashReport.Server event-type: deploy-docker-image diff --git a/.github/workflows/dotnet-format-daily.yml b/.github/workflows/dotnet-format-daily.yml index 3e80b96..486cfdf 100644 --- a/.github/workflows/dotnet-format-daily.yml +++ b/.github/workflows/dotnet-format-daily.yml @@ -12,5 +12,5 @@ jobs: - name: Code Formatting uses: butr/actions-code-format-setup@v1 with: - workspace: "src/BUTR.CrashReportServer.sln" + workspace: "src/BUTR.CrashReport.Server.sln" github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/BUTR.CrashReportServer.Base/BUTR.CrashReportServer.Base.csproj b/src/BUTR.CrashReport.Server.Base/BUTR.CrashReport.Server.Base.csproj similarity index 73% rename from src/BUTR.CrashReportServer.Base/BUTR.CrashReportServer.Base.csproj rename to src/BUTR.CrashReport.Server.Base/BUTR.CrashReport.Server.Base.csproj index 9f075f4..9214df6 100644 --- a/src/BUTR.CrashReportServer.Base/BUTR.CrashReportServer.Base.csproj +++ b/src/BUTR.CrashReport.Server.Base/BUTR.CrashReport.Server.Base.csproj @@ -1,12 +1,13 @@ - + net8.0 - enable enable - Library - BUTR.CrashReportServer + + + + diff --git a/src/BUTR.CrashReportServer.Base/Contexts/AppDbContext.cs b/src/BUTR.CrashReport.Server.Base/Contexts/AppDbContext.cs similarity index 82% rename from src/BUTR.CrashReportServer.Base/Contexts/AppDbContext.cs rename to src/BUTR.CrashReport.Server.Base/Contexts/AppDbContext.cs index 12783c7..b013594 100644 --- a/src/BUTR.CrashReportServer.Base/Contexts/AppDbContext.cs +++ b/src/BUTR.CrashReport.Server.Base/Contexts/AppDbContext.cs @@ -1,9 +1,9 @@ -using BUTR.CrashReportServer.Contexts.Config; -using BUTR.CrashReportServer.Models.Database; +using BUTR.CrashReport.Server.Contexts.Config; +using BUTR.CrashReport.Server.Models.Database; using Microsoft.EntityFrameworkCore; -namespace BUTR.CrashReportServer.Contexts; +namespace BUTR.CrashReport.Server.Contexts; public class AppDbContext : DbContext { diff --git a/src/BUTR.CrashReportServer.Base/Contexts/Config/BaseEntityConfiguration.cs b/src/BUTR.CrashReport.Server.Base/Contexts/Config/BaseEntityConfiguration.cs similarity index 80% rename from src/BUTR.CrashReportServer.Base/Contexts/Config/BaseEntityConfiguration.cs rename to src/BUTR.CrashReport.Server.Base/Contexts/Config/BaseEntityConfiguration.cs index 657de69..8e7e09c 100644 --- a/src/BUTR.CrashReportServer.Base/Contexts/Config/BaseEntityConfiguration.cs +++ b/src/BUTR.CrashReport.Server.Base/Contexts/Config/BaseEntityConfiguration.cs @@ -1,9 +1,9 @@ -using BUTR.CrashReportServer.Models.Database; +using BUTR.CrashReport.Server.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace BUTR.CrashReportServer.Contexts.Config; +namespace BUTR.CrashReport.Server.Contexts.Config; public abstract class BaseEntityConfiguration : IEntityTypeConfiguration where TEntity : class, IEntity { diff --git a/src/BUTR.CrashReportServer.Base/Contexts/Config/FileEntityConfiguration.cs b/src/BUTR.CrashReport.Server.Base/Contexts/Config/FileEntityConfiguration.cs similarity index 88% rename from src/BUTR.CrashReportServer.Base/Contexts/Config/FileEntityConfiguration.cs rename to src/BUTR.CrashReport.Server.Base/Contexts/Config/FileEntityConfiguration.cs index f6319cb..8eae98f 100644 --- a/src/BUTR.CrashReportServer.Base/Contexts/Config/FileEntityConfiguration.cs +++ b/src/BUTR.CrashReport.Server.Base/Contexts/Config/FileEntityConfiguration.cs @@ -1,9 +1,9 @@ -using BUTR.CrashReportServer.Models.Database; +using BUTR.CrashReport.Server.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace BUTR.CrashReportServer.Contexts.Config; +namespace BUTR.CrashReport.Server.Contexts.Config; public class FileEntityConfiguration : BaseEntityConfiguration { diff --git a/src/BUTR.CrashReportServer.Base/Contexts/Config/IdEntityConfiguration.cs b/src/BUTR.CrashReport.Server.Base/Contexts/Config/IdEntityConfiguration.cs similarity index 86% rename from src/BUTR.CrashReportServer.Base/Contexts/Config/IdEntityConfiguration.cs rename to src/BUTR.CrashReport.Server.Base/Contexts/Config/IdEntityConfiguration.cs index 69e5a26..5fbb6ed 100644 --- a/src/BUTR.CrashReportServer.Base/Contexts/Config/IdEntityConfiguration.cs +++ b/src/BUTR.CrashReport.Server.Base/Contexts/Config/IdEntityConfiguration.cs @@ -1,9 +1,9 @@ -using BUTR.CrashReportServer.Models.Database; +using BUTR.CrashReport.Server.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace BUTR.CrashReportServer.Contexts.Config; +namespace BUTR.CrashReport.Server.Contexts.Config; public class IdEntityConfiguration : BaseEntityConfiguration { diff --git a/src/BUTR.CrashReportServer.Base/Contexts/Config/JsonEntityConfiguration.cs b/src/BUTR.CrashReport.Server.Base/Contexts/Config/JsonEntityConfiguration.cs similarity index 88% rename from src/BUTR.CrashReportServer.Base/Contexts/Config/JsonEntityConfiguration.cs rename to src/BUTR.CrashReport.Server.Base/Contexts/Config/JsonEntityConfiguration.cs index 95f9821..7970729 100644 --- a/src/BUTR.CrashReportServer.Base/Contexts/Config/JsonEntityConfiguration.cs +++ b/src/BUTR.CrashReport.Server.Base/Contexts/Config/JsonEntityConfiguration.cs @@ -1,9 +1,9 @@ -using BUTR.CrashReportServer.Models.Database; +using BUTR.CrashReport.Server.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace BUTR.CrashReportServer.Contexts.Config; +namespace BUTR.CrashReport.Server.Contexts.Config; public class JsonEntityConfiguration : BaseEntityConfiguration { diff --git a/src/BUTR.CrashReportServer.Base/Extensions/HostExtensions.cs b/src/BUTR.CrashReport.Server.Base/Extensions/HostExtensions.cs similarity index 95% rename from src/BUTR.CrashReportServer.Base/Extensions/HostExtensions.cs rename to src/BUTR.CrashReport.Server.Base/Extensions/HostExtensions.cs index 158c135..9782023 100644 --- a/src/BUTR.CrashReportServer.Base/Extensions/HostExtensions.cs +++ b/src/BUTR.CrashReport.Server.Base/Extensions/HostExtensions.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Extensions; +namespace BUTR.CrashReport.Server.Extensions; public static class HostExtensions { diff --git a/src/BUTR.CrashReportServer.Base/Extensions/TextExtensions.cs b/src/BUTR.CrashReport.Server.Base/Extensions/TextExtensions.cs similarity index 95% rename from src/BUTR.CrashReportServer.Base/Extensions/TextExtensions.cs rename to src/BUTR.CrashReport.Server.Base/Extensions/TextExtensions.cs index f9de062..2290285 100644 --- a/src/BUTR.CrashReportServer.Base/Extensions/TextExtensions.cs +++ b/src/BUTR.CrashReport.Server.Base/Extensions/TextExtensions.cs @@ -2,7 +2,7 @@ using System.IO; using System.Text; -namespace BUTR.CrashReportServer.Extensions; +namespace BUTR.CrashReport.Server.Extensions; public static class TextExtensions { diff --git a/src/BUTR.CrashReportServer.Base/Extensions/UnicodeStream.cs b/src/BUTR.CrashReport.Server.Base/Extensions/UnicodeStream.cs similarity index 99% rename from src/BUTR.CrashReportServer.Base/Extensions/UnicodeStream.cs rename to src/BUTR.CrashReport.Server.Base/Extensions/UnicodeStream.cs index f007cfb..c8f6f3d 100644 --- a/src/BUTR.CrashReportServer.Base/Extensions/UnicodeStream.cs +++ b/src/BUTR.CrashReport.Server.Base/Extensions/UnicodeStream.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Extensions; +namespace BUTR.CrashReport.Server.Extensions; public sealed class UnicodeStream : Stream { diff --git a/src/BUTR.CrashReportServer.Base/Models/Database/FileEntity.cs b/src/BUTR.CrashReport.Server.Base/Models/Database/FileEntity.cs similarity index 77% rename from src/BUTR.CrashReportServer.Base/Models/Database/FileEntity.cs rename to src/BUTR.CrashReport.Server.Base/Models/Database/FileEntity.cs index 94c7a80..b4fd4ae 100644 --- a/src/BUTR.CrashReportServer.Base/Models/Database/FileEntity.cs +++ b/src/BUTR.CrashReport.Server.Base/Models/Database/FileEntity.cs @@ -1,4 +1,4 @@ -namespace BUTR.CrashReportServer.Models.Database; +namespace BUTR.CrashReport.Server.Models.Database; public sealed record FileEntity : IEntity { diff --git a/src/BUTR.CrashReport.Server.Base/Models/Database/IEntity.cs b/src/BUTR.CrashReport.Server.Base/Models/Database/IEntity.cs new file mode 100644 index 0000000..3bf6d36 --- /dev/null +++ b/src/BUTR.CrashReport.Server.Base/Models/Database/IEntity.cs @@ -0,0 +1,3 @@ +namespace BUTR.CrashReport.Server.Models.Database; + +public interface IEntity { } \ No newline at end of file diff --git a/src/BUTR.CrashReportServer.Base/Models/Database/IdEntity.cs b/src/BUTR.CrashReport.Server.Base/Models/Database/IdEntity.cs similarity index 83% rename from src/BUTR.CrashReportServer.Base/Models/Database/IdEntity.cs rename to src/BUTR.CrashReport.Server.Base/Models/Database/IdEntity.cs index 7a51fc1..8436238 100644 --- a/src/BUTR.CrashReportServer.Base/Models/Database/IdEntity.cs +++ b/src/BUTR.CrashReport.Server.Base/Models/Database/IdEntity.cs @@ -1,6 +1,6 @@ using System; -namespace BUTR.CrashReportServer.Models.Database; +namespace BUTR.CrashReport.Server.Models.Database; public sealed record IdEntity : IEntity { diff --git a/src/BUTR.CrashReportServer.Base/Models/Database/JsonEntity.cs b/src/BUTR.CrashReport.Server.Base/Models/Database/JsonEntity.cs similarity index 77% rename from src/BUTR.CrashReportServer.Base/Models/Database/JsonEntity.cs rename to src/BUTR.CrashReport.Server.Base/Models/Database/JsonEntity.cs index 5e5400e..5757e6b 100644 --- a/src/BUTR.CrashReportServer.Base/Models/Database/JsonEntity.cs +++ b/src/BUTR.CrashReport.Server.Base/Models/Database/JsonEntity.cs @@ -1,4 +1,4 @@ -namespace BUTR.CrashReportServer.Models.Database; +namespace BUTR.CrashReport.Server.Models.Database; public sealed record JsonEntity : IEntity { diff --git a/src/BUTR.CrashReportServer.Base/Options/AuthOptions.cs b/src/BUTR.CrashReport.Server.Base/Options/AuthOptions.cs similarity index 71% rename from src/BUTR.CrashReportServer.Base/Options/AuthOptions.cs rename to src/BUTR.CrashReport.Server.Base/Options/AuthOptions.cs index ccfb4d3..02fcfcb 100644 --- a/src/BUTR.CrashReportServer.Base/Options/AuthOptions.cs +++ b/src/BUTR.CrashReport.Server.Base/Options/AuthOptions.cs @@ -1,4 +1,4 @@ -namespace BUTR.CrashReportServer.Options; +namespace BUTR.CrashReport.Server.Options; public record AuthOptions { diff --git a/src/BUTR.CrashReportServer.Base/Options/CrashUploadOptions.cs b/src/BUTR.CrashReport.Server.Base/Options/CrashUploadOptions.cs similarity index 84% rename from src/BUTR.CrashReportServer.Base/Options/CrashUploadOptions.cs rename to src/BUTR.CrashReport.Server.Base/Options/CrashUploadOptions.cs index 362a493..a018905 100644 --- a/src/BUTR.CrashReportServer.Base/Options/CrashUploadOptions.cs +++ b/src/BUTR.CrashReport.Server.Base/Options/CrashUploadOptions.cs @@ -1,4 +1,4 @@ -namespace BUTR.CrashReportServer.Options; +namespace BUTR.CrashReport.Server.Options; public record CrashUploadOptions { diff --git a/src/BUTR.CrashReportServer.Base/Options/StorageOptions.cs b/src/BUTR.CrashReport.Server.Base/Options/StorageOptions.cs similarity index 60% rename from src/BUTR.CrashReportServer.Base/Options/StorageOptions.cs rename to src/BUTR.CrashReport.Server.Base/Options/StorageOptions.cs index d40170a..6ba73ce 100644 --- a/src/BUTR.CrashReportServer.Base/Options/StorageOptions.cs +++ b/src/BUTR.CrashReport.Server.Base/Options/StorageOptions.cs @@ -1,4 +1,4 @@ -namespace BUTR.CrashReportServer.Options; +namespace BUTR.CrashReport.Server.Options; public record StorageOptions { diff --git a/src/BUTR.CrashReportServer.Base/Services/BasicUserValidationService.cs b/src/BUTR.CrashReport.Server.Base/Services/BasicUserValidationService.cs similarity index 91% rename from src/BUTR.CrashReportServer.Base/Services/BasicUserValidationService.cs rename to src/BUTR.CrashReport.Server.Base/Services/BasicUserValidationService.cs index 6cc45fd..8526e8b 100644 --- a/src/BUTR.CrashReportServer.Base/Services/BasicUserValidationService.cs +++ b/src/BUTR.CrashReport.Server.Base/Services/BasicUserValidationService.cs @@ -1,6 +1,6 @@ using AspNetCore.Authentication.Basic; -using BUTR.CrashReportServer.Options; +using BUTR.CrashReport.Server.Options; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -8,7 +8,7 @@ using System; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Services; +namespace BUTR.CrashReport.Server.Services; public sealed class BasicUserValidationService : IBasicUserValidationService { diff --git a/src/BUTR.CrashReportServer.Base/Services/DatabaseMigrator.cs b/src/BUTR.CrashReport.Server.Base/Services/DatabaseMigrator.cs similarity index 96% rename from src/BUTR.CrashReportServer.Base/Services/DatabaseMigrator.cs rename to src/BUTR.CrashReport.Server.Base/Services/DatabaseMigrator.cs index c337527..edc0127 100644 --- a/src/BUTR.CrashReportServer.Base/Services/DatabaseMigrator.cs +++ b/src/BUTR.CrashReport.Server.Base/Services/DatabaseMigrator.cs @@ -1,6 +1,6 @@ /* -using BUTR.CrashReportServer.Contexts; -using BUTR.CrashReportServer.Models.Database; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -13,7 +13,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Services; +namespace BUTR.CrashReport.Server.Services; public sealed class DatabaseMigrator : BackgroundService { diff --git a/src/BUTR.CrashReportServer.Base/Services/FileIdGenerator.cs b/src/BUTR.CrashReport.Server.Base/Services/FileIdGenerator.cs similarity index 86% rename from src/BUTR.CrashReportServer.Base/Services/FileIdGenerator.cs rename to src/BUTR.CrashReport.Server.Base/Services/FileIdGenerator.cs index 5cb40d9..4e8a636 100644 --- a/src/BUTR.CrashReportServer.Base/Services/FileIdGenerator.cs +++ b/src/BUTR.CrashReport.Server.Base/Services/FileIdGenerator.cs @@ -1,6 +1,12 @@ -using BUTR.CrashReportServer.Contexts; +using BUTR.CrashReport.Server.Contexts; -namespace BUTR.CrashReportServer.Services; +using Microsoft.Extensions.Logging; + +using System; +using System.Linq; +using System.Threading; + +namespace BUTR.CrashReport.Server.Services; public class FileIdGenerator { diff --git a/src/BUTR.CrashReportServer.Base/Services/GZipCompressor.cs b/src/BUTR.CrashReport.Server.Base/Services/GZipCompressor.cs similarity index 97% rename from src/BUTR.CrashReportServer.Base/Services/GZipCompressor.cs rename to src/BUTR.CrashReport.Server.Base/Services/GZipCompressor.cs index d2e21f7..fc34afb 100644 --- a/src/BUTR.CrashReportServer.Base/Services/GZipCompressor.cs +++ b/src/BUTR.CrashReport.Server.Base/Services/GZipCompressor.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Services; +namespace BUTR.CrashReport.Server.Services; public sealed class GZipCompressor { diff --git a/src/BUTR.CrashReportServer.Base/Services/HexGenerator.cs b/src/BUTR.CrashReport.Server.Base/Services/HexGenerator.cs similarity index 96% rename from src/BUTR.CrashReportServer.Base/Services/HexGenerator.cs rename to src/BUTR.CrashReport.Server.Base/Services/HexGenerator.cs index 84964a5..d90c1d6 100644 --- a/src/BUTR.CrashReportServer.Base/Services/HexGenerator.cs +++ b/src/BUTR.CrashReport.Server.Base/Services/HexGenerator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Security.Cryptography; -namespace BUTR.CrashReportServer.Services; +namespace BUTR.CrashReport.Server.Services; public sealed class HexGenerator { diff --git a/src/BUTR.CrashReportServer.sln b/src/BUTR.CrashReport.Server.sln similarity index 88% rename from src/BUTR.CrashReportServer.sln rename to src/BUTR.CrashReport.Server.sln index bf30c9b..ff98004 100644 --- a/src/BUTR.CrashReportServer.sln +++ b/src/BUTR.CrashReport.Server.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BUTR.CrashReportServer", "BUTR.CrashReportServer\BUTR.CrashReportServer.csproj", "{EB9235FA-522C-4484-8093-0310489EEB5C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BUTR.CrashReport.Server", "BUTR.CrashReport.Server\BUTR.CrashReport.Server.csproj", "{EB9235FA-522C-4484-8093-0310489EEB5C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{B256B262-B6DE-4DD3-83B9-6C6DDB81EAEA}" ProjectSection(SolutionItems) = preProject @@ -21,11 +21,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ..\.github\workflows\deploy-self-hosted.yml = ..\.github\workflows\deploy-self-hosted.yml EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.CrashReportServer.v13", "BUTR.CrashReportServer.v13\BUTR.CrashReportServer.v13.csproj", "{5CFD15FB-578C-455D-8BED-3462C333B5FE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.CrashReport.Server.v13", "BUTR.CrashReport.Server.v13\BUTR.CrashReport.Server.v13.csproj", "{5CFD15FB-578C-455D-8BED-3462C333B5FE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.CrashReportServer.v14", "BUTR.CrashReportServer.v14\BUTR.CrashReportServer.v14.csproj", "{0448DA45-5D06-4D7B-9F0D-37BCB26BD82F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.CrashReport.Server.v14", "BUTR.CrashReport.Server.v14\BUTR.CrashReport.Server.v14.csproj", "{0448DA45-5D06-4D7B-9F0D-37BCB26BD82F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.CrashReportServer.Base", "BUTR.CrashReportServer.Base\BUTR.CrashReportServer.Base.csproj", "{1EB86E89-9CEE-465D-8F0F-69BB0D06A3DA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.CrashReport.Server.Base", "BUTR.CrashReport.Server.Base\BUTR.CrashReport.Server.Base.csproj", "{1EB86E89-9CEE-465D-8F0F-69BB0D06A3DA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/BUTR.CrashReportServer.v13/BUTR.CrashReportServer.v13.csproj b/src/BUTR.CrashReport.Server.v13/BUTR.CrashReport.Server.v13.csproj similarity index 87% rename from src/BUTR.CrashReportServer.v13/BUTR.CrashReportServer.v13.csproj rename to src/BUTR.CrashReport.Server.v13/BUTR.CrashReport.Server.v13.csproj index fea4449..752fdd0 100644 --- a/src/BUTR.CrashReportServer.v13/BUTR.CrashReportServer.v13.csproj +++ b/src/BUTR.CrashReport.Server.v13/BUTR.CrashReport.Server.v13.csproj @@ -26,7 +26,7 @@ - + diff --git a/src/BUTR.CrashReportServer.v13/CrashReportUploadBodyV13.cs b/src/BUTR.CrashReport.Server.v13/CrashReportUploadBodyV13.cs similarity index 82% rename from src/BUTR.CrashReportServer.v13/CrashReportUploadBodyV13.cs rename to src/BUTR.CrashReport.Server.v13/CrashReportUploadBodyV13.cs index 1844ef8..4408900 100644 --- a/src/BUTR.CrashReportServer.v13/CrashReportUploadBodyV13.cs +++ b/src/BUTR.CrashReport.Server.v13/CrashReportUploadBodyV13.cs @@ -2,6 +2,6 @@ using System.Collections.Generic; -namespace BUTR.CrashReportServer.v13; +namespace BUTR.CrashReport.Server.v13; public sealed record CrashReportUploadBodyV13(CrashReportModel CrashReport, ICollection LogSources); \ No newline at end of file diff --git a/src/BUTR.CrashReportServer.v13/JsonHandlerV13.cs b/src/BUTR.CrashReport.Server.v13/JsonHandlerV13.cs similarity index 94% rename from src/BUTR.CrashReportServer.v13/JsonHandlerV13.cs rename to src/BUTR.CrashReport.Server.v13/JsonHandlerV13.cs index 267d617..97182e7 100644 --- a/src/BUTR.CrashReportServer.v13/JsonHandlerV13.cs +++ b/src/BUTR.CrashReport.Server.v13/JsonHandlerV13.cs @@ -1,9 +1,9 @@ using BUTR.CrashReport.Renderer.Html; -using BUTR.CrashReportServer.Contexts; -using BUTR.CrashReportServer.Extensions; -using BUTR.CrashReportServer.Models.Database; -using BUTR.CrashReportServer.Options; -using BUTR.CrashReportServer.Services; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Extensions; +using BUTR.CrashReport.Server.Models.Database; +using BUTR.CrashReport.Server.Options; +using BUTR.CrashReport.Server.Services; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -20,7 +20,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.v13; +namespace BUTR.CrashReport.Server.v13; public class JsonHandlerV13 { diff --git a/src/BUTR.CrashReportServer.v14/BUTR.CrashReportServer.v14.csproj b/src/BUTR.CrashReport.Server.v14/BUTR.CrashReport.Server.v14.csproj similarity index 88% rename from src/BUTR.CrashReportServer.v14/BUTR.CrashReportServer.v14.csproj rename to src/BUTR.CrashReport.Server.v14/BUTR.CrashReport.Server.v14.csproj index b7c4439..44ded51 100644 --- a/src/BUTR.CrashReportServer.v14/BUTR.CrashReportServer.v14.csproj +++ b/src/BUTR.CrashReport.Server.v14/BUTR.CrashReport.Server.v14.csproj @@ -27,7 +27,7 @@ - + diff --git a/src/BUTR.CrashReportServer.v14/CrashReportUploadBodyV14.cs b/src/BUTR.CrashReport.Server.v14/CrashReportUploadBodyV14.cs similarity index 82% rename from src/BUTR.CrashReportServer.v14/CrashReportUploadBodyV14.cs rename to src/BUTR.CrashReport.Server.v14/CrashReportUploadBodyV14.cs index e82a913..818bbb5 100644 --- a/src/BUTR.CrashReportServer.v14/CrashReportUploadBodyV14.cs +++ b/src/BUTR.CrashReport.Server.v14/CrashReportUploadBodyV14.cs @@ -2,6 +2,6 @@ using System.Collections.Generic; -namespace BUTR.CrashReportServer.v14; +namespace BUTR.CrashReport.Server.v14; public sealed record CrashReportUploadBodyV14(CrashReportModel CrashReport, ICollection LogSources); \ No newline at end of file diff --git a/src/BUTR.CrashReportServer.v14/HtmlHandlerV14.cs b/src/BUTR.CrashReport.Server.v14/HtmlHandlerV14.cs similarity index 94% rename from src/BUTR.CrashReportServer.v14/HtmlHandlerV14.cs rename to src/BUTR.CrashReport.Server.v14/HtmlHandlerV14.cs index 0e7ea41..acc9678 100644 --- a/src/BUTR.CrashReportServer.v14/HtmlHandlerV14.cs +++ b/src/BUTR.CrashReport.Server.v14/HtmlHandlerV14.cs @@ -1,9 +1,9 @@ using BUTR.CrashReport.Bannerlord.Parser; using BUTR.CrashReport.Models; -using BUTR.CrashReportServer.Contexts; -using BUTR.CrashReportServer.Models.Database; -using BUTR.CrashReportServer.Options; -using BUTR.CrashReportServer.Services; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Models.Database; +using BUTR.CrashReport.Server.Options; +using BUTR.CrashReport.Server.Services; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -20,7 +20,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.v14; +namespace BUTR.CrashReport.Server.v14; public class HtmlHandlerV14 { diff --git a/src/BUTR.CrashReportServer.v14/JsonHandlerV14.cs b/src/BUTR.CrashReport.Server.v14/JsonHandlerV14.cs similarity index 94% rename from src/BUTR.CrashReportServer.v14/JsonHandlerV14.cs rename to src/BUTR.CrashReport.Server.v14/JsonHandlerV14.cs index 54ba66d..a9b06d2 100644 --- a/src/BUTR.CrashReportServer.v14/JsonHandlerV14.cs +++ b/src/BUTR.CrashReport.Server.v14/JsonHandlerV14.cs @@ -1,9 +1,9 @@ using BUTR.CrashReport.Renderer.Html; -using BUTR.CrashReportServer.Contexts; -using BUTR.CrashReportServer.Extensions; -using BUTR.CrashReportServer.Models.Database; -using BUTR.CrashReportServer.Options; -using BUTR.CrashReportServer.Services; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Extensions; +using BUTR.CrashReport.Server.Models.Database; +using BUTR.CrashReport.Server.Options; +using BUTR.CrashReport.Server.Services; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -20,7 +20,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.v14; +namespace BUTR.CrashReport.Server.v14; public class JsonHandlerV14 { diff --git a/src/BUTR.CrashReportServer/BUTR.CrashReportServer.csproj b/src/BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj similarity index 92% rename from src/BUTR.CrashReportServer/BUTR.CrashReportServer.csproj rename to src/BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj index c75d106..af15cc4 100644 --- a/src/BUTR.CrashReportServer/BUTR.CrashReportServer.csproj +++ b/src/BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj @@ -35,9 +35,9 @@ - - - + + + diff --git a/src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs b/src/BUTR.CrashReport.Server/Controllers/CrashUploadController.cs similarity index 94% rename from src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs rename to src/BUTR.CrashReport.Server/Controllers/CrashUploadController.cs index 4d88a8a..426208d 100644 --- a/src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs +++ b/src/BUTR.CrashReport.Server/Controllers/CrashUploadController.cs @@ -1,6 +1,6 @@ -using BUTR.CrashReportServer.Options; -using BUTR.CrashReportServer.v13; -using BUTR.CrashReportServer.v14; +using BUTR.CrashReport.Server.Options; +using BUTR.CrashReport.Server.v13; +using BUTR.CrashReport.Server.v14; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -12,7 +12,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Controllers; +namespace BUTR.CrashReport.Server.Controllers; [ApiController] [Route("/services")] diff --git a/src/BUTR.CrashReportServer/Controllers/ReportController.cs b/src/BUTR.CrashReport.Server/Controllers/ReportController.cs similarity index 97% rename from src/BUTR.CrashReportServer/Controllers/ReportController.cs rename to src/BUTR.CrashReport.Server/Controllers/ReportController.cs index 84dc8aa..f489741 100644 --- a/src/BUTR.CrashReportServer/Controllers/ReportController.cs +++ b/src/BUTR.CrashReport.Server/Controllers/ReportController.cs @@ -1,9 +1,9 @@ -using BUTR.CrashReportServer.Contexts; -using BUTR.CrashReportServer.Models; -using BUTR.CrashReportServer.Models.API; -using BUTR.CrashReportServer.Models.Sitemaps; -using BUTR.CrashReportServer.Options; -using BUTR.CrashReportServer.Services; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Models; +using BUTR.CrashReport.Server.Models.API; +using BUTR.CrashReport.Server.Models.Sitemaps; +using BUTR.CrashReport.Server.Options; +using BUTR.CrashReport.Server.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -23,7 +23,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Controllers; +namespace BUTR.CrashReport.Server.Controllers; [ApiController] [Route("/report")] diff --git a/src/BUTR.CrashReport.Server/Dockerfile b/src/BUTR.CrashReport.Server/Dockerfile new file mode 100644 index 0000000..7b3b235 --- /dev/null +++ b/src/BUTR.CrashReport.Server/Dockerfile @@ -0,0 +1,36 @@ +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS restore +ARG TARGETARCH +WORKDIR /build + +COPY ["src/BUTR.CrashReport.Server.Base/BUTR.CrashReport.Server.Base.csproj", "src/BUTR.CrashReport.Server.Base/"] +COPY ["src/BUTR.CrashReport.Server.v13/BUTR.CrashReport.Server.v13.csproj", "src/BUTR.CrashReport.Server.v13/"] +COPY ["src/BUTR.CrashReport.Server.v14/BUTR.CrashReport.Server.v14.csproj", "src/BUTR.CrashReport.Server.v14/"] +COPY ["src/BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj", "src/BUTR.CrashReport.Server/"] +COPY ["src/nuget.config", "src/"] + +RUN dotnet restore "src/BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj" -a $TARGETARCH; + +COPY ["src/BUTR.CrashReport.Server.Base/", "src/BUTR.CrashReport.Server.Base/"] +COPY ["src/BUTR.CrashReport.Server.v13/", "src/BUTR.CrashReport.Server.v13/"] +COPY ["src/BUTR.CrashReport.Server.v14/", "src/BUTR.CrashReport.Server.v14/"] +COPY ["src/BUTR.CrashReport.Server/", "src/BUTR.CrashReport.Server/"] + +#COPY [".git/HEAD", ".git/HEAD"] +#COPY [".git/config", ".git/config"] +#COPY [".git/refs/heads/", ".git/refs/heads/"] + + +FROM restore AS publish +ARG TARGETARCH +WORKDIR /build + +RUN dotnet publish "src/BUTR.CrashReport.Server/BUTR.CrashReport.Server.csproj" -c Release -a $TARGETARCH -o /app/publish; + + +FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS final +WORKDIR /app +COPY --from=publish /app/publish . + +LABEL org.opencontainers.image.source="https://github.com/BUTR/BUTR.CrashReport.Server" +EXPOSE 8080/tcp +ENTRYPOINT ["dotnet", "BUTR.CrashReport.Server.dll"] \ No newline at end of file diff --git a/src/BUTR.CrashReportServer/Migrations/20240224211446_Initial.Designer.cs b/src/BUTR.CrashReport.Server/Migrations/20240224211446_Initial.Designer.cs similarity index 77% rename from src/BUTR.CrashReportServer/Migrations/20240224211446_Initial.Designer.cs rename to src/BUTR.CrashReport.Server/Migrations/20240224211446_Initial.Designer.cs index ab8b0ad..92b67fe 100644 --- a/src/BUTR.CrashReportServer/Migrations/20240224211446_Initial.Designer.cs +++ b/src/BUTR.CrashReport.Server/Migrations/20240224211446_Initial.Designer.cs @@ -1,6 +1,6 @@ // using System; -using BUTR.CrashReportServer.Contexts; +using BUTR.CrashReport.Server.Contexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; @@ -9,7 +9,7 @@ #nullable disable -namespace BUTR.CrashReportServer.Migrations +namespace BUTR.CrashReport.Server.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20240224211446_Initial")] @@ -25,7 +25,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.FileEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.FileEntity", b => { b.Property("FileId") .HasColumnType("text") @@ -42,7 +42,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("file_entity", (string)null); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.IdEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.IdEntity", b => { b.Property("FileId") .HasColumnType("text") @@ -67,7 +67,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("id_entity", (string)null); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.JsonEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.JsonEntity", b => { b.Property("FileId") .HasColumnType("text") @@ -83,22 +83,22 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("json_entity", (string)null); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.FileEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.FileEntity", b => { - b.HasOne("BUTR.CrashReportServer.Models.Database.IdEntity", "Id") + b.HasOne("BUTR.CrashReport.Server.Models.Database.IdEntity", "Id") .WithOne() - .HasForeignKey("BUTR.CrashReportServer.Models.Database.FileEntity", "FileId") + .HasForeignKey("BUTR.CrashReport.Server.Models.Database.FileEntity", "FileId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Id"); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.JsonEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.JsonEntity", b => { - b.HasOne("BUTR.CrashReportServer.Models.Database.IdEntity", "Id") + b.HasOne("BUTR.CrashReport.Server.Models.Database.IdEntity", "Id") .WithOne() - .HasForeignKey("BUTR.CrashReportServer.Models.Database.JsonEntity", "FileId") + .HasForeignKey("BUTR.CrashReport.Server.Models.Database.JsonEntity", "FileId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); diff --git a/src/BUTR.CrashReportServer/Migrations/20240224211446_Initial.cs b/src/BUTR.CrashReport.Server/Migrations/20240224211446_Initial.cs similarity index 98% rename from src/BUTR.CrashReportServer/Migrations/20240224211446_Initial.cs rename to src/BUTR.CrashReport.Server/Migrations/20240224211446_Initial.cs index af35e66..b43384d 100644 --- a/src/BUTR.CrashReportServer/Migrations/20240224211446_Initial.cs +++ b/src/BUTR.CrashReport.Server/Migrations/20240224211446_Initial.cs @@ -4,7 +4,7 @@ #nullable disable -namespace BUTR.CrashReportServer.Migrations +namespace BUTR.CrashReport.Server.Migrations { /// public partial class Initial : Migration diff --git a/src/BUTR.CrashReportServer/Migrations/AppDbContextModelSnapshot.cs b/src/BUTR.CrashReport.Server/Migrations/AppDbContextModelSnapshot.cs similarity index 76% rename from src/BUTR.CrashReportServer/Migrations/AppDbContextModelSnapshot.cs rename to src/BUTR.CrashReport.Server/Migrations/AppDbContextModelSnapshot.cs index 718bda8..d85247f 100644 --- a/src/BUTR.CrashReportServer/Migrations/AppDbContextModelSnapshot.cs +++ b/src/BUTR.CrashReport.Server/Migrations/AppDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using BUTR.CrashReportServer.Contexts; +using BUTR.CrashReport.Server.Contexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; @@ -8,7 +8,7 @@ #nullable disable -namespace BUTR.CrashReportServer.Migrations +namespace BUTR.CrashReport.Server.Migrations { [DbContext(typeof(AppDbContext))] partial class AppDbContextModelSnapshot : ModelSnapshot @@ -22,7 +22,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.FileEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.FileEntity", b => { b.Property("FileId") .HasColumnType("text") @@ -39,7 +39,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("file_entity", (string)null); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.IdEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.IdEntity", b => { b.Property("FileId") .HasColumnType("text") @@ -64,7 +64,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("id_entity", (string)null); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.JsonEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.JsonEntity", b => { b.Property("FileId") .HasColumnType("text") @@ -80,22 +80,22 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("json_entity", (string)null); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.FileEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.FileEntity", b => { - b.HasOne("BUTR.CrashReportServer.Models.Database.IdEntity", "Id") + b.HasOne("BUTR.CrashReport.Server.Models.Database.IdEntity", "Id") .WithOne() - .HasForeignKey("BUTR.CrashReportServer.Models.Database.FileEntity", "FileId") + .HasForeignKey("BUTR.CrashReport.Server.Models.Database.FileEntity", "FileId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Id"); }); - modelBuilder.Entity("BUTR.CrashReportServer.Models.Database.JsonEntity", b => + modelBuilder.Entity("BUTR.CrashReport.Server.Models.Database.JsonEntity", b => { - b.HasOne("BUTR.CrashReportServer.Models.Database.IdEntity", "Id") + b.HasOne("BUTR.CrashReport.Server.Models.Database.IdEntity", "Id") .WithOne() - .HasForeignKey("BUTR.CrashReportServer.Models.Database.JsonEntity", "FileId") + .HasForeignKey("BUTR.CrashReport.Server.Models.Database.JsonEntity", "FileId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); diff --git a/src/BUTR.CrashReportServer/Models/API/FileMetadata.cs b/src/BUTR.CrashReport.Server/Models/API/FileMetadata.cs similarity index 70% rename from src/BUTR.CrashReportServer/Models/API/FileMetadata.cs rename to src/BUTR.CrashReport.Server/Models/API/FileMetadata.cs index bb45231..86d972f 100644 --- a/src/BUTR.CrashReportServer/Models/API/FileMetadata.cs +++ b/src/BUTR.CrashReport.Server/Models/API/FileMetadata.cs @@ -1,5 +1,5 @@ using System; -namespace BUTR.CrashReportServer.Models.API; +namespace BUTR.CrashReport.Server.Models.API; public sealed record FileMetadata(string File, Guid Id, byte Version, DateTimeOffset Date); \ No newline at end of file diff --git a/src/BUTR.CrashReportServer/Models/Sitemaps/ChangeFrequency.cs b/src/BUTR.CrashReport.Server/Models/Sitemaps/ChangeFrequency.cs similarity index 88% rename from src/BUTR.CrashReportServer/Models/Sitemaps/ChangeFrequency.cs rename to src/BUTR.CrashReport.Server/Models/Sitemaps/ChangeFrequency.cs index 0477991..8379e1e 100644 --- a/src/BUTR.CrashReportServer/Models/Sitemaps/ChangeFrequency.cs +++ b/src/BUTR.CrashReport.Server/Models/Sitemaps/ChangeFrequency.cs @@ -1,7 +1,7 @@ using System; using System.Xml.Serialization; -namespace BUTR.CrashReportServer.Models.Sitemaps; +namespace BUTR.CrashReport.Server.Models.Sitemaps; [Serializable] public enum ChangeFrequency diff --git a/src/BUTR.CrashReportServer/Models/Sitemaps/Sitemap.cs b/src/BUTR.CrashReport.Server/Models/Sitemaps/Sitemap.cs similarity index 85% rename from src/BUTR.CrashReportServer/Models/Sitemaps/Sitemap.cs rename to src/BUTR.CrashReport.Server/Models/Sitemaps/Sitemap.cs index a8775b2..7c76097 100644 --- a/src/BUTR.CrashReportServer/Models/Sitemaps/Sitemap.cs +++ b/src/BUTR.CrashReport.Server/Models/Sitemaps/Sitemap.cs @@ -1,6 +1,6 @@ using System.Xml.Serialization; -namespace BUTR.CrashReportServer.Models.Sitemaps; +namespace BUTR.CrashReport.Server.Models.Sitemaps; [XmlRoot(ElementName = "sitemap", Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")] public class Sitemap diff --git a/src/BUTR.CrashReportServer/Models/Sitemaps/SitemapIndex.cs b/src/BUTR.CrashReport.Server/Models/Sitemaps/SitemapIndex.cs similarity index 87% rename from src/BUTR.CrashReportServer/Models/Sitemaps/SitemapIndex.cs rename to src/BUTR.CrashReport.Server/Models/Sitemaps/SitemapIndex.cs index 8fcf167..9bb669e 100644 --- a/src/BUTR.CrashReportServer/Models/Sitemaps/SitemapIndex.cs +++ b/src/BUTR.CrashReport.Server/Models/Sitemaps/SitemapIndex.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Xml.Serialization; -namespace BUTR.CrashReportServer.Models.Sitemaps; +namespace BUTR.CrashReport.Server.Models.Sitemaps; [XmlRoot(ElementName = "sitemapindex", Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")] public class SitemapIndex diff --git a/src/BUTR.CrashReportServer/Models/Sitemaps/Url.cs b/src/BUTR.CrashReport.Server/Models/Sitemaps/Url.cs similarity index 94% rename from src/BUTR.CrashReportServer/Models/Sitemaps/Url.cs rename to src/BUTR.CrashReport.Server/Models/Sitemaps/Url.cs index 6127d3d..8581404 100644 --- a/src/BUTR.CrashReportServer/Models/Sitemaps/Url.cs +++ b/src/BUTR.CrashReport.Server/Models/Sitemaps/Url.cs @@ -1,7 +1,7 @@ using System; using System.Xml.Serialization; -namespace BUTR.CrashReportServer.Models.Sitemaps; +namespace BUTR.CrashReport.Server.Models.Sitemaps; [XmlRoot(ElementName = "url", Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")] public class Url diff --git a/src/BUTR.CrashReportServer/Models/Sitemaps/Urlset.cs b/src/BUTR.CrashReport.Server/Models/Sitemaps/Urlset.cs similarity index 86% rename from src/BUTR.CrashReportServer/Models/Sitemaps/Urlset.cs rename to src/BUTR.CrashReport.Server/Models/Sitemaps/Urlset.cs index c82a70a..37b4154 100644 --- a/src/BUTR.CrashReportServer/Models/Sitemaps/Urlset.cs +++ b/src/BUTR.CrashReport.Server/Models/Sitemaps/Urlset.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Xml.Serialization; -namespace BUTR.CrashReportServer.Models.Sitemaps; +namespace BUTR.CrashReport.Server.Models.Sitemaps; [XmlRoot(ElementName = "urlset", Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")] public class Urlset diff --git a/src/BUTR.CrashReport.Server/Models/TLSError.cs b/src/BUTR.CrashReport.Server/Models/TLSError.cs new file mode 100644 index 0000000..336fa29 --- /dev/null +++ b/src/BUTR.CrashReport.Server/Models/TLSError.cs @@ -0,0 +1,3 @@ +namespace BUTR.CrashReport.Server.Models; + +public record TLSError(string Message); \ No newline at end of file diff --git a/src/BUTR.CrashReportServer/Options/OtlpOptions.cs b/src/BUTR.CrashReport.Server/Options/OtlpOptions.cs similarity index 92% rename from src/BUTR.CrashReportServer/Options/OtlpOptions.cs rename to src/BUTR.CrashReport.Server/Options/OtlpOptions.cs index a66c73a..4ce20cd 100644 --- a/src/BUTR.CrashReportServer/Options/OtlpOptions.cs +++ b/src/BUTR.CrashReport.Server/Options/OtlpOptions.cs @@ -1,6 +1,6 @@ using OpenTelemetry.Exporter; -namespace BUTR.CrashReportServer.Options; +namespace BUTR.CrashReport.Server.Options; public sealed record OtlpOptions { diff --git a/src/BUTR.CrashReportServer/Program.cs b/src/BUTR.CrashReport.Server/Program.cs similarity index 97% rename from src/BUTR.CrashReportServer/Program.cs rename to src/BUTR.CrashReport.Server/Program.cs index a2c856f..5074c32 100644 --- a/src/BUTR.CrashReportServer/Program.cs +++ b/src/BUTR.CrashReport.Server/Program.cs @@ -1,4 +1,6 @@ -using BUTR.CrashReportServer.Options; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Extensions; +using BUTR.CrashReport.Server.Options; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -20,7 +22,7 @@ using System.Security.Authentication; using System.Threading.Tasks; -namespace BUTR.CrashReportServer; +namespace BUTR.CrashReport.Server; public static class Program { diff --git a/src/BUTR.CrashReportServer/Properties/launchSettings.json b/src/BUTR.CrashReport.Server/Properties/launchSettings.json similarity index 100% rename from src/BUTR.CrashReportServer/Properties/launchSettings.json rename to src/BUTR.CrashReport.Server/Properties/launchSettings.json diff --git a/src/BUTR.CrashReportServer/RequireHttpsAttribute.cs b/src/BUTR.CrashReport.Server/RequireHttpsAttribute.cs similarity index 94% rename from src/BUTR.CrashReportServer/RequireHttpsAttribute.cs rename to src/BUTR.CrashReport.Server/RequireHttpsAttribute.cs index 3816482..f1f97e9 100644 --- a/src/BUTR.CrashReportServer/RequireHttpsAttribute.cs +++ b/src/BUTR.CrashReport.Server/RequireHttpsAttribute.cs @@ -1,4 +1,4 @@ -using BUTR.CrashReportServer.Models; +using BUTR.CrashReport.Server.Models; using Microsoft.AspNetCore.Connections.Features; using Microsoft.AspNetCore.Http; @@ -8,7 +8,7 @@ using System; using System.Security.Authentication; -namespace BUTR.CrashReportServer; +namespace BUTR.CrashReport.Server; [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)] public sealed class HttpsProtocolAttribute : Attribute, IAuthorizationFilter, IOrderedFilter diff --git a/src/BUTR.CrashReportServer/Startup.cs b/src/BUTR.CrashReport.Server/Startup.cs similarity index 96% rename from src/BUTR.CrashReportServer/Startup.cs rename to src/BUTR.CrashReport.Server/Startup.cs index d70c3da..b7eb5d4 100644 --- a/src/BUTR.CrashReportServer/Startup.cs +++ b/src/BUTR.CrashReport.Server/Startup.cs @@ -1,10 +1,10 @@ using AspNetCore.Authentication.Basic; -using BUTR.CrashReportServer.Contexts; -using BUTR.CrashReportServer.Options; -using BUTR.CrashReportServer.Services; -using BUTR.CrashReportServer.v13; -using BUTR.CrashReportServer.v14; +using BUTR.CrashReport.Server.Contexts; +using BUTR.CrashReport.Server.Options; +using BUTR.CrashReport.Server.Services; +using BUTR.CrashReport.Server.v13; +using BUTR.CrashReport.Server.v14; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -27,7 +27,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace BUTR.CrashReportServer; +namespace BUTR.CrashReport.Server; public class Startup { diff --git a/src/BUTR.CrashReportServer/Utils/CrashReportRawParser.cs b/src/BUTR.CrashReport.Server/Utils/CrashReportRawParser.cs similarity index 99% rename from src/BUTR.CrashReportServer/Utils/CrashReportRawParser.cs rename to src/BUTR.CrashReport.Server/Utils/CrashReportRawParser.cs index fa941bf..dcd38ac 100644 --- a/src/BUTR.CrashReportServer/Utils/CrashReportRawParser.cs +++ b/src/BUTR.CrashReport.Server/Utils/CrashReportRawParser.cs @@ -13,7 +13,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BUTR.CrashReportServer.Utils; +namespace BUTR.CrashReport.Server.Utils; public static class CrashReportRawParser { diff --git a/src/BUTR.CrashReportServer/appsettings.Development.json b/src/BUTR.CrashReport.Server/appsettings.Development.json similarity index 100% rename from src/BUTR.CrashReportServer/appsettings.Development.json rename to src/BUTR.CrashReport.Server/appsettings.Development.json diff --git a/src/BUTR.CrashReportServer.Base/Models/Database/IEntity.cs b/src/BUTR.CrashReportServer.Base/Models/Database/IEntity.cs deleted file mode 100644 index d06f23b..0000000 --- a/src/BUTR.CrashReportServer.Base/Models/Database/IEntity.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace BUTR.CrashReportServer.Models.Database; - -public interface IEntity { } \ No newline at end of file diff --git a/src/BUTR.CrashReportServer/Dockerfile b/src/BUTR.CrashReportServer/Dockerfile deleted file mode 100644 index 0c668a8..0000000 --- a/src/BUTR.CrashReportServer/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS restore -ARG TARGETARCH -WORKDIR /build - -COPY ["src/BUTR.CrashReportServer.Base/BUTR.CrashReportServer.Base.csproj", "src/BUTR.CrashReportServer.Base/"] -COPY ["src/BUTR.CrashReportServer.v13/BUTR.CrashReportServer.v13.csproj", "src/BUTR.CrashReportServer.v13/"] -COPY ["src/BUTR.CrashReportServer.v14/BUTR.CrashReportServer.v14.csproj", "src/BUTR.CrashReportServer.v14/"] -COPY ["src/BUTR.CrashReportServer/BUTR.CrashReportServer.csproj", "src/BUTR.CrashReportServer/"] -COPY ["src/nuget.config", "src/"] - -RUN dotnet restore "src/BUTR.CrashReportServer/BUTR.CrashReportServer.csproj" -a $TARGETARCH; - -COPY ["src/BUTR.CrashReportServer.Base/", "src/BUTR.CrashReportServer.Base/"] -COPY ["src/BUTR.CrashReportServer.v13/", "src/BUTR.CrashReportServer.v13/"] -COPY ["src/BUTR.CrashReportServer.v14/", "src/BUTR.CrashReportServer.v14/"] -COPY ["src/BUTR.CrashReportServer/", "src/BUTR.CrashReportServer/"] - -#COPY [".git/HEAD", ".git/HEAD"] -#COPY [".git/config", ".git/config"] -#COPY [".git/refs/heads/", ".git/refs/heads/"] - - -FROM restore AS publish -ARG TARGETARCH -WORKDIR /build - -RUN dotnet publish "src/BUTR.CrashReportServer/BUTR.CrashReportServer.csproj" -c Release -a $TARGETARCH -o /app/publish; - - -FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS final -WORKDIR /app -COPY --from=publish /app/publish . - -LABEL org.opencontainers.image.source="https://github.com/BUTR/BUTR.CrashReportServer" -EXPOSE 8080/tcp -ENTRYPOINT ["dotnet", "BUTR.CrashReportServer.dll"] \ No newline at end of file diff --git a/src/BUTR.CrashReportServer/Models/TLSError.cs b/src/BUTR.CrashReportServer/Models/TLSError.cs deleted file mode 100644 index f13aba7..0000000 --- a/src/BUTR.CrashReportServer/Models/TLSError.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace BUTR.CrashReportServer.Models; - -public record TLSError(string Message); \ No newline at end of file