From 4777fa69fbaa0379483ff6119c213d977ed99ec5 Mon Sep 17 00:00:00 2001 From: Alexa <53471801+Alexa-RR@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:47:12 +0300 Subject: [PATCH 1/4] Add December route cases --- DorkNet.sln | 15 ++ .../DorkNet.ApiRouteCoverage.csproj | 14 ++ tools/DorkNet.ApiRouteCoverage/Program.cs | 204 ++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 tools/DorkNet.ApiRouteCoverage/DorkNet.ApiRouteCoverage.csproj create mode 100644 tools/DorkNet.ApiRouteCoverage/Program.cs diff --git a/DorkNet.sln b/DorkNet.sln index 01601e1..b8818b0 100644 --- a/DorkNet.sln +++ b/DorkNet.sln @@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MigrateSqliteToPostgres", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.AdminMobile", "DorkNet.AdminMobile\DorkNet.AdminMobile.csproj", "{C2265F00-DFC5-4352-A94C-B887E3C0E5CA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.ApiRouteCoverage", "tools\DorkNet.ApiRouteCoverage\DorkNet.ApiRouteCoverage.csproj", "{AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -71,11 +73,24 @@ Global {C2265F00-DFC5-4352-A94C-B887E3C0E5CA}.Release|x64.Build.0 = Release|Any CPU {C2265F00-DFC5-4352-A94C-B887E3C0E5CA}.Release|x86.ActiveCfg = Release|Any CPU {C2265F00-DFC5-4352-A94C-B887E3C0E5CA}.Release|x86.Build.0 = Release|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Debug|x64.ActiveCfg = Debug|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Debug|x64.Build.0 = Debug|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Debug|x86.ActiveCfg = Debug|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Debug|x86.Build.0 = Debug|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Release|Any CPU.Build.0 = Release|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Release|x64.ActiveCfg = Release|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Release|x64.Build.0 = Release|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Release|x86.ActiveCfg = Release|Any CPU + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {70C60098-1B11-4C13-943B-A8A056429EAE} = {07C2787E-EAC7-C090-1BA3-A61EC2A24D84} + {AB8D33A2-8F4C-4E10-BD25-51343D20F7ED} = {07C2787E-EAC7-C090-1BA3-A61EC2A24D84} EndGlobalSection EndGlobal diff --git a/tools/DorkNet.ApiRouteCoverage/DorkNet.ApiRouteCoverage.csproj b/tools/DorkNet.ApiRouteCoverage/DorkNet.ApiRouteCoverage.csproj new file mode 100644 index 0000000..10a76b3 --- /dev/null +++ b/tools/DorkNet.ApiRouteCoverage/DorkNet.ApiRouteCoverage.csproj @@ -0,0 +1,14 @@ + + + + Exe + net9.0 + enable + enable + + + + + + + diff --git a/tools/DorkNet.ApiRouteCoverage/Program.cs b/tools/DorkNet.ApiRouteCoverage/Program.cs new file mode 100644 index 0000000..154ba34 --- /dev/null +++ b/tools/DorkNet.ApiRouteCoverage/Program.cs @@ -0,0 +1,204 @@ +using System.Reflection; +using System.Runtime.Loader; +using System.Text.RegularExpressions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Routing; + +var serverAssembly = LoadServerAssembly(args); +var routes = DiscoverRoutes(serverAssembly).OrderBy(r => r.Method).ThenBy(r => r.Template).ToArray(); +var failures = new List(); + +if (routes.Length == 0) + failures.Add("No HTTP controller routes were discovered."); + +foreach (var route in routes) +{ + if (string.IsNullOrWhiteSpace(route.Template)) + failures.Add($"{route.Source}: empty route template"); + + if (route.SamplePath.Contains('{') || route.SamplePath.Contains('}')) + failures.Add($"{route.Source}: unresolved route parameter in {route.SamplePath}"); + + if (route.SamplePath.Contains('[') || route.SamplePath.Contains(']')) + failures.Add($"{route.Source}: unresolved token in {route.SamplePath}"); + + if (!route.SamplePath.StartsWith('/')) + failures.Add($"{route.Source}: sample path must be absolute: {route.SamplePath}"); +} + +Console.WriteLine($"Discovered {routes.Length} HTTP route test cases."); +foreach (var route in routes) + Console.WriteLine($"{route.Method,-6} {route.SamplePath,-72} {route.Source}"); + +if (failures.Count == 0) + return 0; + +Console.Error.WriteLine(); +Console.Error.WriteLine("Route coverage failed:"); +foreach (var failure in failures) + Console.Error.WriteLine($"- {failure}"); +return 1; + +static Assembly LoadServerAssembly(string[] args) +{ + if (args.Length > 0) + return LoadAssemblyFromPath(Path.GetFullPath(args[0])); + + var repositoryRoot = FindRepositoryRoot(); + var candidates = new[] + { + Path.Combine(repositoryRoot, "DorkNet.Server", "bin", "Debug", "net9.0", "DorkNet.Server.dll"), + Path.Combine(repositoryRoot, "DorkNet.Server", "bin", "Release", "net9.0", "DorkNet.Server.dll") + }; + + var serverAssemblyPath = candidates.FirstOrDefault(File.Exists); + if (serverAssemblyPath is null) + { + throw new FileNotFoundException( + "Could not find a built DorkNet.Server assembly. Build DorkNet.Server first or pass the DLL path as the first argument.", + string.Join(Environment.NewLine, candidates)); + } + + return LoadAssemblyFromPath(serverAssemblyPath); +} + +static Assembly LoadAssemblyFromPath(string assemblyPath) +{ + var assemblyDirectory = Path.GetDirectoryName(assemblyPath) + ?? throw new DirectoryNotFoundException($"Could not resolve assembly directory for {assemblyPath}."); + + AssemblyLoadContext.Default.Resolving += (_, assemblyName) => + { + var dependencyPath = Path.Combine(assemblyDirectory, assemblyName.Name + ".dll"); + return File.Exists(dependencyPath) + ? AssemblyLoadContext.Default.LoadFromAssemblyPath(dependencyPath) + : null; + }; + + return AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath); +} + +static string FindRepositoryRoot() +{ + var current = new DirectoryInfo(AppContext.BaseDirectory); + while (current is not null) + { + if (File.Exists(Path.Combine(current.FullName, "DorkNet.Server", "DorkNet.Server.csproj"))) + return current.FullName; + + current = current.Parent; + } + + throw new DirectoryNotFoundException("Could not locate the repository root from the route coverage tool output path."); +} + +static IEnumerable DiscoverRoutes(Assembly serverAssembly) +{ + var controllerBaseType = typeof(ControllerBase); + foreach (var controller in serverAssembly.GetTypes() + .Where(t => !t.IsAbstract && controllerBaseType.IsAssignableFrom(t))) + { + var controllerName = ControllerName(controller); + var controllerRouteTemplates = controller.GetCustomAttributes(inherit: true) + .OfType() + .Select(a => a.Template) + .Where(t => !string.IsNullOrWhiteSpace(t)) + .Cast() + .DefaultIfEmpty("") + .ToArray(); + + foreach (var method in controller.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)) + { + var httpAttrs = method.GetCustomAttributes(inherit: true) + .OfType() + .ToArray(); + if (httpAttrs.Length == 0) + continue; + + foreach (var attr in httpAttrs) + { + var attrMethods = attr.HttpMethods.Any() + ? attr.HttpMethods + : new[] { "ANY" }; + var actionName = method.Name; + foreach (var httpMethod in attrMethods) + { + foreach (var controllerTemplate in controllerRouteTemplates) + { + var template = CombineTemplates(controllerTemplate, attr.Template); + template = ReplaceRouteTokens(template, controllerName, actionName); + yield return new RouteCase( + httpMethod.ToUpperInvariant(), + template, + ToSamplePath(template), + $"{controller.FullName}.{method.Name}"); + } + } + } + } + } +} + +static string ControllerName(Type controller) +{ + const string suffix = "Controller"; + return controller.Name.EndsWith(suffix, StringComparison.Ordinal) + ? controller.Name[..^suffix.Length] + : controller.Name; +} + +static string CombineTemplates(string? controllerTemplate, string? actionTemplate) +{ + controllerTemplate ??= ""; + actionTemplate ??= ""; + + if (actionTemplate.StartsWith("~/", StringComparison.Ordinal)) + return "/" + actionTemplate[2..].TrimStart('/'); + + if (actionTemplate.StartsWith("/", StringComparison.Ordinal)) + return "/" + actionTemplate.TrimStart('/'); + + var left = controllerTemplate.Trim('/'); + var right = actionTemplate.Trim('/'); + + if (string.IsNullOrEmpty(left) && string.IsNullOrEmpty(right)) + return "/"; + if (string.IsNullOrEmpty(left)) + return "/" + right; + if (string.IsNullOrEmpty(right)) + return "/" + left; + return "/" + left + "/" + right; +} + +static string ReplaceRouteTokens(string template, string controllerName, string actionName) +{ + return template + .Replace("[controller]", controllerName, StringComparison.OrdinalIgnoreCase) + .Replace("[action]", actionName, StringComparison.OrdinalIgnoreCase); +} + +static string ToSamplePath(string template) +{ + var path = RouteParameterRegex().Replace(template, match => + { + var constraint = match.Groups["constraint"].Value.ToLowerInvariant(); + if (constraint.Contains("long") || constraint.Contains("int")) + return "1"; + if (constraint.Contains("bool")) + return "true"; + if (constraint.Contains("guid")) + return "00000000-0000-0000-0000-000000000001"; + return "sample"; + }); + + path = Regex.Replace(path, "/+", "/"); + return path.StartsWith('/') ? path : "/" + path; +} + +internal sealed record RouteCase(string Method, string Template, string SamplePath, string Source); + +partial class Program +{ + [GeneratedRegex(@"\{[*]?(?[^}:=\?]+)(?:[^}=\?]+)?(?\?)?(?=[^}]+)?\}")] + private static partial Regex RouteParameterRegex(); +} From d998bf9b86a631e052a93f27af4be18351090c28 Mon Sep 17 00:00:00 2001 From: Alexa <53471801+Alexa-RR@users.noreply.github.com> Date: Mon, 15 Jun 2026 13:04:45 +0300 Subject: [PATCH 2/4] Harden December route cases --- tools/DorkNet.ApiRouteCoverage/Program.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/DorkNet.ApiRouteCoverage/Program.cs b/tools/DorkNet.ApiRouteCoverage/Program.cs index 154ba34..5710454 100644 --- a/tools/DorkNet.ApiRouteCoverage/Program.cs +++ b/tools/DorkNet.ApiRouteCoverage/Program.cs @@ -5,6 +5,10 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Routing; var serverAssembly = LoadServerAssembly(args); +var serverAssemblyWriteTime = File.GetLastWriteTimeUtc(serverAssembly.Location); +Console.WriteLine($"Using server assembly: {serverAssembly.Location}"); +Console.WriteLine($"Server assembly timestamp (UTC): {serverAssemblyWriteTime:O}"); + var routes = DiscoverRoutes(serverAssembly).OrderBy(r => r.Method).ThenBy(r => r.Template).ToArray(); var failures = new List(); @@ -51,15 +55,23 @@ static Assembly LoadServerAssembly(string[] args) Path.Combine(repositoryRoot, "DorkNet.Server", "bin", "Release", "net9.0", "DorkNet.Server.dll") }; - var serverAssemblyPath = candidates.FirstOrDefault(File.Exists); - if (serverAssemblyPath is null) + var existingCandidates = candidates.Where(File.Exists).ToArray(); + if (existingCandidates.Length == 0) { throw new FileNotFoundException( "Could not find a built DorkNet.Server assembly. Build DorkNet.Server first or pass the DLL path as the first argument.", string.Join(Environment.NewLine, candidates)); } - return LoadAssemblyFromPath(serverAssemblyPath); + if (existingCandidates.Length > 1) + { + throw new InvalidOperationException( + "Multiple DorkNet.Server assemblies were found. Pass the DLL path as the first argument so route coverage validates the intended build." + + Environment.NewLine + + string.Join(Environment.NewLine, existingCandidates)); + } + + return LoadAssemblyFromPath(existingCandidates[0]); } static Assembly LoadAssemblyFromPath(string assemblyPath) From 6e2b3979f198b2e312df990c768074343f64ba46 Mon Sep 17 00:00:00 2001 From: Alexa <53471801+Alexa-RR@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:27:27 +0300 Subject: [PATCH 3/4] Move microservices scaffold back to branch --- Dockerfile.service | 33 -------- DorkNet.Contracts/DorkNet.Contracts.csproj | 9 -- DorkNet.Contracts/DorkNetServiceMapOptions.cs | 26 ------ DorkNet.Contracts/ServiceContracts.cs | 19 ----- DorkNet.Contracts/ServiceNames.cs | 10 --- DorkNet.Gateway/DorkNet.Gateway.csproj | 14 ---- DorkNet.Gateway/Program.cs | 68 --------------- DorkNet.Gateway/appsettings.json | 17 ---- .../DorkNet.ServiceDefaults.csproj | 14 ---- .../DorkNetServiceDefaultsExtensions.cs | 37 -------- DorkNet.ServiceDefaults/DorkNetServiceInfo.cs | 3 - .../DorkNet.Services.Identity.csproj | 14 ---- DorkNet.Services.Identity/Program.cs | 29 ------- DorkNet.Services.Identity/appsettings.json | 8 -- .../DorkNet.Services.Notify.csproj | 14 ---- DorkNet.Services.Notify/Program.cs | 28 ------- DorkNet.Services.Notify/appsettings.json | 8 -- .../DorkNet.Services.Rooms.csproj | 14 ---- DorkNet.Services.Rooms/Program.cs | 31 ------- DorkNet.Services.Rooms/appsettings.json | 8 -- DorkNet.sln | 84 ------------------- docker-compose.microservices.yml | 71 ---------------- 22 files changed, 559 deletions(-) delete mode 100644 Dockerfile.service delete mode 100644 DorkNet.Contracts/DorkNet.Contracts.csproj delete mode 100644 DorkNet.Contracts/DorkNetServiceMapOptions.cs delete mode 100644 DorkNet.Contracts/ServiceContracts.cs delete mode 100644 DorkNet.Contracts/ServiceNames.cs delete mode 100644 DorkNet.Gateway/DorkNet.Gateway.csproj delete mode 100644 DorkNet.Gateway/Program.cs delete mode 100644 DorkNet.Gateway/appsettings.json delete mode 100644 DorkNet.ServiceDefaults/DorkNet.ServiceDefaults.csproj delete mode 100644 DorkNet.ServiceDefaults/DorkNetServiceDefaultsExtensions.cs delete mode 100644 DorkNet.ServiceDefaults/DorkNetServiceInfo.cs delete mode 100644 DorkNet.Services.Identity/DorkNet.Services.Identity.csproj delete mode 100644 DorkNet.Services.Identity/Program.cs delete mode 100644 DorkNet.Services.Identity/appsettings.json delete mode 100644 DorkNet.Services.Notify/DorkNet.Services.Notify.csproj delete mode 100644 DorkNet.Services.Notify/Program.cs delete mode 100644 DorkNet.Services.Notify/appsettings.json delete mode 100644 DorkNet.Services.Rooms/DorkNet.Services.Rooms.csproj delete mode 100644 DorkNet.Services.Rooms/Program.cs delete mode 100644 DorkNet.Services.Rooms/appsettings.json delete mode 100644 docker-compose.microservices.yml diff --git a/Dockerfile.service b/Dockerfile.service deleted file mode 100644 index a84bde7..0000000 --- a/Dockerfile.service +++ /dev/null @@ -1,33 +0,0 @@ -ARG DOTNET_VERSION=9.0 - -FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build -ARG PROJECT_PATH -WORKDIR /src - -COPY . . -RUN dotnet publish "${PROJECT_PATH}" -c Release -o /app/publish - -FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION} AS runtime -ARG APP_DLL -WORKDIR /app - -RUN apt-get update \ - && apt-get install -y --no-install-recommends curl \ - && rm -rf /var/lib/apt/lists/* - -USER app - -COPY --from=build --chown=app:app /app/publish . - -ENV ASPNETCORE_ENVIRONMENT=Production \ - ASPNETCORE_URLS=http://0.0.0.0:8080 \ - DOTNET_RUNNING_IN_CONTAINER=true \ - DOTNET_PRINT_TELEMETRY_MESSAGE=false \ - APP_DLL=${APP_DLL} - -EXPOSE 8080 - -HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \ - CMD curl --fail --silent http://localhost:8080/healthz || exit 1 - -ENTRYPOINT ["sh", "-c", "dotnet \"$APP_DLL\""] diff --git a/DorkNet.Contracts/DorkNet.Contracts.csproj b/DorkNet.Contracts/DorkNet.Contracts.csproj deleted file mode 100644 index 9623deb..0000000 --- a/DorkNet.Contracts/DorkNet.Contracts.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net9.0 - enable - enable - - - diff --git a/DorkNet.Contracts/DorkNetServiceMapOptions.cs b/DorkNet.Contracts/DorkNetServiceMapOptions.cs deleted file mode 100644 index cfb2244..0000000 --- a/DorkNet.Contracts/DorkNetServiceMapOptions.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace DorkNet.Contracts; - -public sealed class DorkNetServiceMapOptions -{ - public string Identity { get; set; } = "http://localhost:8081"; - public string Rooms { get; set; } = "http://localhost:8082"; - public string Notify { get; set; } = "http://localhost:8083"; - public string Monolith { get; set; } = "http://localhost:8084"; - - public IReadOnlyList Endpoints() - { - DorkNetServiceEndpoint[] endpoints = - [ - new(ServiceNames.Identity, Identity), - new(ServiceNames.Rooms, Rooms), - new(ServiceNames.Notify, Notify), - new(ServiceNames.Monolith, Monolith), - ]; - - return endpoints - .Where(endpoint => !string.IsNullOrWhiteSpace(endpoint.BaseUrl)) - .ToArray(); - } -} - -public sealed record DorkNetServiceEndpoint(string Name, string BaseUrl); diff --git a/DorkNet.Contracts/ServiceContracts.cs b/DorkNet.Contracts/ServiceContracts.cs deleted file mode 100644 index 216e6a2..0000000 --- a/DorkNet.Contracts/ServiceContracts.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace DorkNet.Contracts; - -public sealed record ServiceHealthResponse( - string Service, - string Status, - DateTimeOffset CheckedAtUtc); - -public sealed record ServiceCapabilityResponse( - string Service, - string[] Owns, - string[] PlannedPublicRoutes); - -public sealed record ServiceProbeResponse( - string Service, - string BaseUrl, - string Status, - int? StatusCode, - string? Error, - DateTimeOffset CheckedAtUtc); diff --git a/DorkNet.Contracts/ServiceNames.cs b/DorkNet.Contracts/ServiceNames.cs deleted file mode 100644 index 12dae24..0000000 --- a/DorkNet.Contracts/ServiceNames.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace DorkNet.Contracts; - -public static class ServiceNames -{ - public const string Gateway = "gateway"; - public const string Identity = "identity"; - public const string Rooms = "rooms"; - public const string Notify = "notify"; - public const string Monolith = "monolith"; -} diff --git a/DorkNet.Gateway/DorkNet.Gateway.csproj b/DorkNet.Gateway/DorkNet.Gateway.csproj deleted file mode 100644 index 8e34531..0000000 --- a/DorkNet.Gateway/DorkNet.Gateway.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net9.0 - enable - enable - - - - - - - - diff --git a/DorkNet.Gateway/Program.cs b/DorkNet.Gateway/Program.cs deleted file mode 100644 index b0b2808..0000000 --- a/DorkNet.Gateway/Program.cs +++ /dev/null @@ -1,68 +0,0 @@ -using DorkNet.Contracts; -using DorkNet.ServiceDefaults; -using Microsoft.Extensions.Options; - -var builder = WebApplication.CreateBuilder(args); -builder.Configuration.AddJsonFile("appsettings.Local.json", - optional: true, reloadOnChange: true); - -builder.AddDorkNetServiceDefaults(ServiceNames.Gateway); -builder.Services.Configure( - builder.Configuration.GetSection("DorkNet:Services")); - -var app = builder.Build(); - -app.MapDorkNetServiceDefaults(); - -app.MapGet("/", () => Results.Redirect("/healthz")); -app.MapGet("/internal/services", (IOptions options) => - Results.Ok(options.Value.Endpoints())); - -app.MapGet("/internal/services/health", async ( - IOptions options, - IHttpClientFactory httpClientFactory, - CancellationToken ct) => -{ - var client = httpClientFactory.CreateClient(); - var probes = new List(); - - foreach (var endpoint in options.Value.Endpoints()) - { - probes.Add(await ProbeServiceAsync(client, endpoint, ct)); - } - - return Results.Ok(probes); -}); - -app.Run(); - -static async Task ProbeServiceAsync( - HttpClient client, - DorkNetServiceEndpoint endpoint, - CancellationToken ct) -{ - var checkedAt = DateTimeOffset.UtcNow; - var baseUrl = endpoint.BaseUrl.TrimEnd('/'); - - try - { - using var response = await client.GetAsync($"{baseUrl}/internal/healthz", ct); - return new ServiceProbeResponse( - endpoint.Name, - endpoint.BaseUrl, - response.IsSuccessStatusCode ? "ok" : "unhealthy", - (int)response.StatusCode, - null, - checkedAt); - } - catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException) - { - return new ServiceProbeResponse( - endpoint.Name, - endpoint.BaseUrl, - "unreachable", - null, - ex.Message, - checkedAt); - } -} diff --git a/DorkNet.Gateway/appsettings.json b/DorkNet.Gateway/appsettings.json deleted file mode 100644 index 3daa59e..0000000 --- a/DorkNet.Gateway/appsettings.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning", - "System.Net.Http.HttpClient": "Warning" - } - }, - "DorkNet": { - "Services": { - "Identity": "http://localhost:8081", - "Rooms": "http://localhost:8082", - "Notify": "http://localhost:8083", - "Monolith": "http://localhost:8084" - } - } -} diff --git a/DorkNet.ServiceDefaults/DorkNet.ServiceDefaults.csproj b/DorkNet.ServiceDefaults/DorkNet.ServiceDefaults.csproj deleted file mode 100644 index 7ce055b..0000000 --- a/DorkNet.ServiceDefaults/DorkNet.ServiceDefaults.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net9.0 - enable - enable - - - - - - - - diff --git a/DorkNet.ServiceDefaults/DorkNetServiceDefaultsExtensions.cs b/DorkNet.ServiceDefaults/DorkNetServiceDefaultsExtensions.cs deleted file mode 100644 index 19ae748..0000000 --- a/DorkNet.ServiceDefaults/DorkNetServiceDefaultsExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using DorkNet.Contracts; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace DorkNet.ServiceDefaults; - -public static class DorkNetServiceDefaultsExtensions -{ - public static WebApplicationBuilder AddDorkNetServiceDefaults( - this WebApplicationBuilder builder, - string serviceName) - { - builder.Services.AddSingleton(new DorkNetServiceInfo(serviceName)); - builder.Services.AddHealthChecks(); - builder.Services.AddHttpClient(); - builder.Services.ConfigureHttpJsonOptions(opt => - opt.SerializerOptions.PropertyNamingPolicy = null); - - return builder; - } - - public static WebApplication MapDorkNetServiceDefaults(this WebApplication app) - { - app.MapHealthChecks("/healthz"); - app.MapGet("/internal/healthz", (DorkNetServiceInfo info) => - { - return Results.Ok(new ServiceHealthResponse( - info.Name, - "ok", - DateTimeOffset.UtcNow)); - }); - - return app; - } -} diff --git a/DorkNet.ServiceDefaults/DorkNetServiceInfo.cs b/DorkNet.ServiceDefaults/DorkNetServiceInfo.cs deleted file mode 100644 index 6e7f7c6..0000000 --- a/DorkNet.ServiceDefaults/DorkNetServiceInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace DorkNet.ServiceDefaults; - -public sealed record DorkNetServiceInfo(string Name); diff --git a/DorkNet.Services.Identity/DorkNet.Services.Identity.csproj b/DorkNet.Services.Identity/DorkNet.Services.Identity.csproj deleted file mode 100644 index 8e34531..0000000 --- a/DorkNet.Services.Identity/DorkNet.Services.Identity.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net9.0 - enable - enable - - - - - - - - diff --git a/DorkNet.Services.Identity/Program.cs b/DorkNet.Services.Identity/Program.cs deleted file mode 100644 index 1697272..0000000 --- a/DorkNet.Services.Identity/Program.cs +++ /dev/null @@ -1,29 +0,0 @@ -using DorkNet.Contracts; -using DorkNet.ServiceDefaults; - -var builder = WebApplication.CreateBuilder(args); -builder.Configuration.AddJsonFile("appsettings.Local.json", - optional: true, reloadOnChange: true); - -builder.AddDorkNetServiceDefaults(ServiceNames.Identity); - -var app = builder.Build(); - -app.MapDorkNetServiceDefaults(); -app.MapGet("/internal/identity/capabilities", () => - Results.Ok(new ServiceCapabilityResponse( - ServiceNames.Identity, - [ - "accounts", - "auth", - "platform-login", - "jwt-issuance", - ], - [ - "/account/*", - "/api/account/*", - "/api/platformlogin/*", - "/api/auth/*", - ]))); - -app.Run(); diff --git a/DorkNet.Services.Identity/appsettings.json b/DorkNet.Services.Identity/appsettings.json deleted file mode 100644 index 0c208ae..0000000 --- a/DorkNet.Services.Identity/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/DorkNet.Services.Notify/DorkNet.Services.Notify.csproj b/DorkNet.Services.Notify/DorkNet.Services.Notify.csproj deleted file mode 100644 index 8e34531..0000000 --- a/DorkNet.Services.Notify/DorkNet.Services.Notify.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net9.0 - enable - enable - - - - - - - - diff --git a/DorkNet.Services.Notify/Program.cs b/DorkNet.Services.Notify/Program.cs deleted file mode 100644 index 4e2f842..0000000 --- a/DorkNet.Services.Notify/Program.cs +++ /dev/null @@ -1,28 +0,0 @@ -using DorkNet.Contracts; -using DorkNet.ServiceDefaults; - -var builder = WebApplication.CreateBuilder(args); -builder.Configuration.AddJsonFile("appsettings.Local.json", - optional: true, reloadOnChange: true); - -builder.AddDorkNetServiceDefaults(ServiceNames.Notify); - -var app = builder.Build(); - -app.MapDorkNetServiceDefaults(); -app.MapGet("/internal/notify/capabilities", () => - Results.Ok(new ServiceCapabilityResponse( - ServiceNames.Notify, - [ - "signalr-edge", - "notification-fanout", - "presence", - "player-request-logs", - ], - [ - "/hub/v1", - "/api/notification/*", - "/player/*presence*", - ]))); - -app.Run(); diff --git a/DorkNet.Services.Notify/appsettings.json b/DorkNet.Services.Notify/appsettings.json deleted file mode 100644 index 0c208ae..0000000 --- a/DorkNet.Services.Notify/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/DorkNet.Services.Rooms/DorkNet.Services.Rooms.csproj b/DorkNet.Services.Rooms/DorkNet.Services.Rooms.csproj deleted file mode 100644 index 8e34531..0000000 --- a/DorkNet.Services.Rooms/DorkNet.Services.Rooms.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net9.0 - enable - enable - - - - - - - - diff --git a/DorkNet.Services.Rooms/Program.cs b/DorkNet.Services.Rooms/Program.cs deleted file mode 100644 index ed11f71..0000000 --- a/DorkNet.Services.Rooms/Program.cs +++ /dev/null @@ -1,31 +0,0 @@ -using DorkNet.Contracts; -using DorkNet.ServiceDefaults; - -var builder = WebApplication.CreateBuilder(args); -builder.Configuration.AddJsonFile("appsettings.Local.json", - optional: true, reloadOnChange: true); - -builder.AddDorkNetServiceDefaults(ServiceNames.Rooms); - -var app = builder.Build(); - -app.MapDorkNetServiceDefaults(); -app.MapGet("/internal/rooms/capabilities", () => - Results.Ok(new ServiceCapabilityResponse( - ServiceNames.Rooms, - [ - "rooms", - "subrooms", - "room-keys", - "matchmaking", - "discovery", - ], - [ - "/rooms/*", - "/api/rooms/*", - "/roomserver/*", - "/v1/find", - "/v1/join/*", - ]))); - -app.Run(); diff --git a/DorkNet.Services.Rooms/appsettings.json b/DorkNet.Services.Rooms/appsettings.json deleted file mode 100644 index 0c208ae..0000000 --- a/DorkNet.Services.Rooms/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/DorkNet.sln b/DorkNet.sln index dfcd048..01601e1 100644 --- a/DorkNet.sln +++ b/DorkNet.sln @@ -13,18 +13,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MigrateSqliteToPostgres", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.AdminMobile", "DorkNet.AdminMobile\DorkNet.AdminMobile.csproj", "{C2265F00-DFC5-4352-A94C-B887E3C0E5CA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.Contracts", "DorkNet.Contracts\DorkNet.Contracts.csproj", "{7D9E995E-5333-43B2-848B-3522C6C3D893}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.ServiceDefaults", "DorkNet.ServiceDefaults\DorkNet.ServiceDefaults.csproj", "{0A66087B-37DF-401D-AFAC-01E7324C2460}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.Gateway", "DorkNet.Gateway\DorkNet.Gateway.csproj", "{1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.Services.Identity", "DorkNet.Services.Identity\DorkNet.Services.Identity.csproj", "{E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.Services.Rooms", "DorkNet.Services.Rooms\DorkNet.Services.Rooms.csproj", "{3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DorkNet.Services.Notify", "DorkNet.Services.Notify\DorkNet.Services.Notify.csproj", "{5A6D7277-0974-4F12-AD9D-C705F5CFE19C}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -83,78 +71,6 @@ Global {C2265F00-DFC5-4352-A94C-B887E3C0E5CA}.Release|x64.Build.0 = Release|Any CPU {C2265F00-DFC5-4352-A94C-B887E3C0E5CA}.Release|x86.ActiveCfg = Release|Any CPU {C2265F00-DFC5-4352-A94C-B887E3C0E5CA}.Release|x86.Build.0 = Release|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Debug|x64.ActiveCfg = Debug|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Debug|x64.Build.0 = Debug|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Debug|x86.ActiveCfg = Debug|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Debug|x86.Build.0 = Debug|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Release|Any CPU.Build.0 = Release|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Release|x64.ActiveCfg = Release|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Release|x64.Build.0 = Release|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Release|x86.ActiveCfg = Release|Any CPU - {7D9E995E-5333-43B2-848B-3522C6C3D893}.Release|x86.Build.0 = Release|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Debug|x64.ActiveCfg = Debug|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Debug|x64.Build.0 = Debug|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Debug|x86.ActiveCfg = Debug|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Debug|x86.Build.0 = Debug|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Release|Any CPU.Build.0 = Release|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Release|x64.ActiveCfg = Release|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Release|x64.Build.0 = Release|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Release|x86.ActiveCfg = Release|Any CPU - {0A66087B-37DF-401D-AFAC-01E7324C2460}.Release|x86.Build.0 = Release|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Debug|x64.ActiveCfg = Debug|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Debug|x64.Build.0 = Debug|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Debug|x86.ActiveCfg = Debug|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Debug|x86.Build.0 = Debug|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Release|Any CPU.Build.0 = Release|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Release|x64.ActiveCfg = Release|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Release|x64.Build.0 = Release|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Release|x86.ActiveCfg = Release|Any CPU - {1A7D03D5-DAC5-474C-9A21-8F2EEF82396F}.Release|x86.Build.0 = Release|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Debug|x64.ActiveCfg = Debug|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Debug|x64.Build.0 = Debug|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Debug|x86.ActiveCfg = Debug|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Debug|x86.Build.0 = Debug|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Release|Any CPU.Build.0 = Release|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Release|x64.ActiveCfg = Release|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Release|x64.Build.0 = Release|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Release|x86.ActiveCfg = Release|Any CPU - {E85B21BA-ED08-4CED-ADB5-6B5E5ADEEBD1}.Release|x86.Build.0 = Release|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Debug|x64.ActiveCfg = Debug|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Debug|x64.Build.0 = Debug|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Debug|x86.ActiveCfg = Debug|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Debug|x86.Build.0 = Debug|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Release|Any CPU.Build.0 = Release|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Release|x64.ActiveCfg = Release|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Release|x64.Build.0 = Release|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Release|x86.ActiveCfg = Release|Any CPU - {3F01BA71-BD1E-461B-BCD0-F2E9CC92B640}.Release|x86.Build.0 = Release|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Debug|x64.ActiveCfg = Debug|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Debug|x64.Build.0 = Debug|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Debug|x86.ActiveCfg = Debug|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Debug|x86.Build.0 = Debug|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Release|Any CPU.Build.0 = Release|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Release|x64.ActiveCfg = Release|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Release|x64.Build.0 = Release|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Release|x86.ActiveCfg = Release|Any CPU - {5A6D7277-0974-4F12-AD9D-C705F5CFE19C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/docker-compose.microservices.yml b/docker-compose.microservices.yml deleted file mode 100644 index d502099..0000000 --- a/docker-compose.microservices.yml +++ /dev/null @@ -1,71 +0,0 @@ -services: - gateway: - build: - context: . - dockerfile: Dockerfile.service - args: - PROJECT_PATH: DorkNet.Gateway/DorkNet.Gateway.csproj - APP_DLL: DorkNet.Gateway.dll - environment: - DorkNet__Services__Identity: http://identity:8080 - DorkNet__Services__Rooms: http://rooms:8080 - DorkNet__Services__Notify: http://notify:8080 - DorkNet__Services__Monolith: "" - ports: - - "8080:8080" - depends_on: - - identity - - rooms - - notify - - identity: - build: - context: . - dockerfile: Dockerfile.service - args: - PROJECT_PATH: DorkNet.Services.Identity/DorkNet.Services.Identity.csproj - APP_DLL: DorkNet.Services.Identity.dll - depends_on: - - postgres - - redis - - rooms: - build: - context: . - dockerfile: Dockerfile.service - args: - PROJECT_PATH: DorkNet.Services.Rooms/DorkNet.Services.Rooms.csproj - APP_DLL: DorkNet.Services.Rooms.dll - environment: - S3__Endpoint: ${DORKNET_S3_ENDPOINT:-} - S3__AccessKey: ${DORKNET_S3_ACCESS_KEY:-} - S3__SecretKey: ${DORKNET_S3_SECRET_KEY:-} - S3__Region: ${DORKNET_S3_REGION:-garage} - depends_on: - - postgres - - redis - - notify: - build: - context: . - dockerfile: Dockerfile.service - args: - PROJECT_PATH: DorkNet.Services.Notify/DorkNet.Services.Notify.csproj - APP_DLL: DorkNet.Services.Notify.dll - depends_on: - - redis - - postgres: - image: postgres:16-alpine - environment: - POSTGRES_DB: dorknet - POSTGRES_USER: dorknet - POSTGRES_PASSWORD: dorknet_dev - volumes: - - microservices-postgres:/var/lib/postgresql/data - - redis: - image: redis:7-alpine - -volumes: - microservices-postgres: From 30e6ea3e8b7deceb7d4893489d40187e93203484 Mon Sep 17 00:00:00 2001 From: Alexa <53471801+Alexa-RR@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:55:34 +0300 Subject: [PATCH 4/4] Match server branding to logo --- .gitignore | 4 +- DorkNet.Server/admin-ui/index.html | 2 + .../admin-ui/public/brand/dorknet.svg | 71 +++++++++++++++++++ .../admin-ui/src/assets/dorknet.svg | 71 +++++++++++++++++++ .../admin-ui/src/components/BrandMark.tsx | 9 +++ .../admin-ui/src/components/Sidebar.tsx | 5 +- DorkNet.Server/admin-ui/src/pages/Login.tsx | 7 +- DorkNet.Server/admin-ui/src/vite-env.d.ts | 1 + DorkNet.Server/admin-ui/tailwind.config.js | 22 +++--- DorkNet.Server/site/index.html | 2 + DorkNet.Server/site/public/brand/dorknet.svg | 71 +++++++++++++++++++ DorkNet.Server/site/src/assets/dorknet.svg | 71 +++++++++++++++++++ .../site/src/components/BrandMark.tsx | 9 +++ DorkNet.Server/site/src/components/Header.tsx | 5 +- DorkNet.Server/site/src/pages/Home.tsx | 6 +- DorkNet.Server/site/src/vite-env.d.ts | 1 + DorkNet.Server/site/tailwind.config.js | 22 +++--- .../wwwroot/admin-legacy/brand/dorknet.svg | 71 +++++++++++++++++++ .../wwwroot/admin-legacy/index.html | 12 +++- DorkNet.Server/wwwroot/admin-legacy/style.css | 45 ++++++++---- DorkNet.Server/wwwroot/feed/brand/dorknet.svg | 71 +++++++++++++++++++ DorkNet.Server/wwwroot/feed/index.html | 4 +- DorkNet.Server/wwwroot/feed/style.css | 32 +++++---- 23 files changed, 552 insertions(+), 62 deletions(-) create mode 100644 DorkNet.Server/admin-ui/public/brand/dorknet.svg create mode 100644 DorkNet.Server/admin-ui/src/assets/dorknet.svg create mode 100644 DorkNet.Server/admin-ui/src/components/BrandMark.tsx create mode 100644 DorkNet.Server/admin-ui/src/vite-env.d.ts create mode 100644 DorkNet.Server/site/public/brand/dorknet.svg create mode 100644 DorkNet.Server/site/src/assets/dorknet.svg create mode 100644 DorkNet.Server/site/src/components/BrandMark.tsx create mode 100644 DorkNet.Server/site/src/vite-env.d.ts create mode 100644 DorkNet.Server/wwwroot/admin-legacy/brand/dorknet.svg create mode 100644 DorkNet.Server/wwwroot/feed/brand/dorknet.svg diff --git a/.gitignore b/.gitignore index 7ae432c..9ccb66d 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ dist$ZIPNAME.zip ## time someone rebuilds. Keep the source committed, regenerate output. DorkNet.Server/wwwroot/admin/index.html DorkNet.Server/wwwroot/admin/assets/ +DorkNet.Server/wwwroot/admin/brand/ DorkNet.Server/wwwroot/admin/*.map DorkNet.Server/admin-ui/node_modules/ DorkNet.Server/admin-ui/dist/ @@ -58,6 +59,7 @@ DorkNet.Server/admin-ui/tsconfig.tsbuildinfo ## Same reasoning as admin-ui above: hashed output, regenerate per build. DorkNet.Server/wwwroot/site/index.html DorkNet.Server/wwwroot/site/assets/ +DorkNet.Server/wwwroot/site/brand/ DorkNet.Server/wwwroot/site/*.map DorkNet.Server/site/node_modules/ DorkNet.Server/site/dist/ @@ -83,4 +85,4 @@ Recovered/ Recovered(*)/ -local-releases/** \ No newline at end of file +local-releases/** diff --git a/DorkNet.Server/admin-ui/index.html b/DorkNet.Server/admin-ui/index.html index ad0f540..a4c08af 100644 --- a/DorkNet.Server/admin-ui/index.html +++ b/DorkNet.Server/admin-ui/index.html @@ -4,7 +4,9 @@ + DorkNet Admin + diff --git a/DorkNet.Server/admin-ui/public/brand/dorknet.svg b/DorkNet.Server/admin-ui/public/brand/dorknet.svg new file mode 100644 index 0000000..2bf84c6 --- /dev/null +++ b/DorkNet.Server/admin-ui/public/brand/dorknet.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DorkNet.Server/admin-ui/src/assets/dorknet.svg b/DorkNet.Server/admin-ui/src/assets/dorknet.svg new file mode 100644 index 0000000..2bf84c6 --- /dev/null +++ b/DorkNet.Server/admin-ui/src/assets/dorknet.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DorkNet.Server/admin-ui/src/components/BrandMark.tsx b/DorkNet.Server/admin-ui/src/components/BrandMark.tsx new file mode 100644 index 0000000..553f1e3 --- /dev/null +++ b/DorkNet.Server/admin-ui/src/components/BrandMark.tsx @@ -0,0 +1,9 @@ +import logoUrl from '../assets/dorknet.svg'; + +export function BrandMark({ className = 'size-8' }: { className?: string }) { + return ( + + + + ); +} diff --git a/DorkNet.Server/admin-ui/src/components/Sidebar.tsx b/DorkNet.Server/admin-ui/src/components/Sidebar.tsx index 0c4d437..06f78a3 100644 --- a/DorkNet.Server/admin-ui/src/components/Sidebar.tsx +++ b/DorkNet.Server/admin-ui/src/components/Sidebar.tsx @@ -4,6 +4,7 @@ import { LayoutDashboard, Users, Building2, Activity, Megaphone, MessageSquare, Settings, X, } from './Icons'; +import { BrandMark } from './BrandMark'; // Consolidated navigation. Per-player moderation (bans, grants, gifts, // password resets) lives in the player detail modal; the old Bans / @@ -67,9 +68,9 @@ export function Sidebar({ open, onClose, onNavigate }: { open: boolean; onClose: <>
-
D
+
-
DorkNet
+
DorkNet
admin
diff --git a/DorkNet.Server/admin-ui/src/pages/Login.tsx b/DorkNet.Server/admin-ui/src/pages/Login.tsx index 0810509..1331df5 100644 --- a/DorkNet.Server/admin-ui/src/pages/Login.tsx +++ b/DorkNet.Server/admin-ui/src/pages/Login.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { api, ApiError } from '../lib/api'; import { notifyAuthChange, setSession } from '../lib/auth'; +import { BrandMark } from '../components/BrandMark'; interface LoginResponse { access_token: string; @@ -51,12 +52,12 @@ export function Login() { }; return ( -
+
-
D
+
-

DorkNet Admin

+

DorkNet Admin

Sign in with an admin account.

diff --git a/DorkNet.Server/admin-ui/src/vite-env.d.ts b/DorkNet.Server/admin-ui/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/DorkNet.Server/admin-ui/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/DorkNet.Server/admin-ui/tailwind.config.js b/DorkNet.Server/admin-ui/tailwind.config.js index 2a1ab9d..20a7568 100644 --- a/DorkNet.Server/admin-ui/tailwind.config.js +++ b/DorkNet.Server/admin-ui/tailwind.config.js @@ -20,17 +20,17 @@ export default { 950: '#0a0b0e', }, brand: { - DEFAULT: '#7c5cff', - 50: '#f1edff', - 100: '#e1d8ff', - 200: '#c5b6ff', - 300: '#a48dff', - 400: '#8d72ff', - 500: '#7c5cff', - 600: '#6948e3', - 700: '#5236b8', - 800: '#3e2989', - 900: '#2a1c5f', + DEFAULT: '#0b95c7', + 50: '#ecfbff', + 100: '#c8f3ff', + 200: '#8bedff', + 300: '#51e5ff', + 400: '#22cfee', + 500: '#0b95c7', + 600: '#087aa8', + 700: '#096083', + 800: '#0a465f', + 900: '#082f40', }, success: '#3ecf8e', warn: '#f4b740', diff --git a/DorkNet.Server/site/index.html b/DorkNet.Server/site/index.html index a8d15e6..00d5010 100644 --- a/DorkNet.Server/site/index.html +++ b/DorkNet.Server/site/index.html @@ -4,8 +4,10 @@ + DorkNet + diff --git a/DorkNet.Server/site/public/brand/dorknet.svg b/DorkNet.Server/site/public/brand/dorknet.svg new file mode 100644 index 0000000..2bf84c6 --- /dev/null +++ b/DorkNet.Server/site/public/brand/dorknet.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DorkNet.Server/site/src/assets/dorknet.svg b/DorkNet.Server/site/src/assets/dorknet.svg new file mode 100644 index 0000000..2bf84c6 --- /dev/null +++ b/DorkNet.Server/site/src/assets/dorknet.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DorkNet.Server/site/src/components/BrandMark.tsx b/DorkNet.Server/site/src/components/BrandMark.tsx new file mode 100644 index 0000000..553f1e3 --- /dev/null +++ b/DorkNet.Server/site/src/components/BrandMark.tsx @@ -0,0 +1,9 @@ +import logoUrl from '../assets/dorknet.svg'; + +export function BrandMark({ className = 'size-8' }: { className?: string }) { + return ( + + + + ); +} diff --git a/DorkNet.Server/site/src/components/Header.tsx b/DorkNet.Server/site/src/components/Header.tsx index a5ae394..b03ca4d 100644 --- a/DorkNet.Server/site/src/components/Header.tsx +++ b/DorkNet.Server/site/src/components/Header.tsx @@ -1,5 +1,6 @@ import { NavLink, Link, useLocation, useNavigate } from 'react-router-dom'; import { useEffect, useRef, useState } from 'react'; +import { BrandMark } from './BrandMark'; const NAV = [ { to: '/', label: 'Home', exact: true }, @@ -30,8 +31,8 @@ export function Header() {
- - DorkNet + + DorkNet