feat(website): stand up SOR.Website public game site

Adds the complete SOR.Website ASP.NET Core Razor Pages project:

Security architecture:
- SecurityHeadersMiddleware sets strict CSP (script-src/style-src 'self',
  form-action 'self', frame-ancestors 'none', object-src 'none')
  — all XSS injection is dead on arrival
- __Host- cookie prefix on session + CSRF cookies (forces Secure, Path=/,
  no Domain — prevents subdomain-compromise cookie theft)
- Anti-forgery tokens on every POST by default (Razor Pages default)
- AuthorizeFolder("/Account") — unauthenticated access to any /account/*
  redirected to login at the routing layer, no per-page [Authorize] needed
- Rate limiting per-IP: login (10/5min), register (5/hr), reset (3/15min)
- Open redirect prevention: all returnUrl values checked with Url.IsLocalUrl
- Anti-enumeration: ForgotPassword/Register never reveal whether email exists
- Account lockout: 5 failed login attempts → 30min lockout
- ChangePasswordAsync requires current password before accepting new one
- Leaderboard only projects DisplayName + RankScore (email/ID never exposed)
- Data Protection keys in Redis (shared key ring across pods)
- ForwardedHeaders middleware for accurate IP under TLS-terminating ingress

Pages implemented:
- Public: Home, Story, How To Play, Cards (catalog + detail), Leaderboard,
  AI Assets (explanation + report), News, Support, Privacy, Terms, Webclient
- Auth: Login, Register, Logout (POST-only), ForgotPassword, ResetPassword,
  VerifyEmail — all with rate limiting and anti-enumeration controls
- Account (auth-gated): Overview, Profile (display name), Security
  (change password), Game stats

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-04-22 19:51:04 -04:00
co-authored by Claude Happy
parent 08ef638950
commit c972b8687e
56 changed files with 4121 additions and 0 deletions
@@ -0,0 +1,79 @@
@page
@model IndexModel
@{
ViewData["Title"] = "AI Asset Disclosure";
ViewData["MetaDescription"] = "Aeternalis AI asset usage disclosure. How AI tools are used, reviewed, and tracked.";
}
<div class="page-header">
<div class="container">
<h1>AI Asset Disclosure</h1>
<p class="page-subtitle">How AI tools are used in Aeternalis, and how we track them.</p>
</div>
</div>
<div class="container prose-page">
<section class="prose-section">
<h2>Summary</h2>
<p>
Some visual and audio assets in Aeternalis were created with the assistance of AI generation tools.
Every AI-assisted asset has been reviewed and modified by a human before being used in the game.
This page explains how and why, and links to the full asset report.
</p>
</section>
<section class="prose-section">
<h2>Asset Categories That May Use AI Assistance</h2>
<ul>
<li><strong>Card art (2D illustrations)</strong> — some card art was generated or edited with AI tools.</li>
<li><strong>Placeholder assets</strong> — early development assets may be AI-generated pending final art.</li>
<li><strong>Promotional imagery</strong> — some marketing images may use AI assistance.</li>
</ul>
</section>
<section class="prose-section">
<h2>Asset Categories That Do Not Use AI Generation</h2>
<ul>
<li>Game rules, card text, and mechanics.</li>
<li>Lore, story, and world-building content.</li>
<li>Code and game systems.</li>
<li>3D board models (hand-crafted geometry).</li>
</ul>
</section>
<section class="prose-section">
<h2>Human Review and Editing Process</h2>
<p>
No AI-generated asset enters the game without human review. Reviewers check for:
inappropriate content, factual or lore inconsistencies, visual quality, and alignment
with the game's aesthetic. Assets may be edited, reprompted, or replaced entirely.
</p>
<p>
The status of each asset (Active, Replaced, Placeholder, Deprecated) is tracked in
the full report below.
</p>
</section>
<section class="prose-section">
<h2>Player-Facing Impact</h2>
<p>
AI-assisted assets are used for visual presentation only and have no effect on gameplay,
card mechanics, rules, or balance. The game's competitive systems are entirely human-designed.
</p>
</section>
<section class="prose-section">
<h2>Reporting and Contact</h2>
<p>
If you notice an asset that appears to be AI-generated but is not listed in the report,
or if you have questions about our AI asset policy, please contact us via the
<a href="/support">support page</a>.
</p>
</section>
<div class="prose-cta">
<a href="/ai-assets/report" class="btn btn-primary">View Full Asset Report</a>
</div>
</div>
@@ -0,0 +1,8 @@
namespace SOR.Website.Pages.AiAssets;
using Microsoft.AspNetCore.Mvc.RazorPages;
public sealed class IndexModel : PageModel
{
public void OnGet() { }
}
@@ -0,0 +1,87 @@
@page
@model ReportModel
@{
ViewData["Title"] = "AI Asset Report";
ViewData["MetaDescription"] = "Full searchable report of AI-assisted assets in Aeternalis.";
}
<div class="page-header">
<div class="container">
<h1>AI Asset Report</h1>
<p class="page-subtitle">@Model.TotalCount AI-assisted asset@(Model.TotalCount == 1 ? "" : "s") on record.</p>
</div>
</div>
<div class="container">
<form method="get" class="search-form" novalidate>
<div class="form-group form-inline">
<label for="search">Search assets</label>
<input type="search"
id="search"
name="search"
value="@Model.Search"
placeholder="Object key or prefix"
class="form-control"
maxlength="200">
<button type="submit" class="btn btn-primary">Search</button>
@if (!string.IsNullOrWhiteSpace(Model.Search))
{
<a href="/ai-assets/report" class="btn btn-ghost">Clear</a>
}
</div>
</form>
@if (!Model.Records.Any())
{
<div class="empty-state">
<p>No AI-assisted assets found@(!string.IsNullOrWhiteSpace(Model.Search) ? " matching your search" : "").</p>
</div>
}
else
{
<div class="table-wrapper">
<table class="data-table" aria-label="AI asset report">
<thead>
<tr>
<th scope="col">Object Key</th>
<th scope="col">Prefix</th>
<th scope="col">Type</th>
<th scope="col">Uploaded</th>
</tr>
</thead>
<tbody>
@foreach (var record in Model.Records)
{
<tr>
@* All values auto-encoded by Razor — no XSS *@
<td class="mono">@record.ObjectKey</td>
<td>@record.Prefix</td>
<td>@(record.ContentType ?? "—")</td>
<td>@record.UploadedAt.ToString("yyyy-MM-dd")</td>
</tr>
}
</tbody>
</table>
</div>
@if (Model.TotalPages > 1)
{
<nav class="pagination" aria-label="Page navigation">
@if (Model.CurrentPage > 1)
{
<a href="?page=@(Model.CurrentPage - 1)&search=@Model.Search" class="pagination-btn">Previous</a>
}
<span class="pagination-info">Page @Model.CurrentPage of @Model.TotalPages</span>
@if (Model.CurrentPage < Model.TotalPages)
{
<a href="?page=@(Model.CurrentPage + 1)&search=@Model.Search" class="pagination-btn">Next</a>
}
</nav>
}
}
<div class="report-footer">
<a href="/ai-assets" class="btn btn-ghost">AI Asset Overview</a>
</div>
</div>
@@ -0,0 +1,57 @@
namespace SOR.Website.Pages.AiAssets;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using SOR.Database.Contexts;
using SOR.Database.Entities.Catalog;
/// <summary>
/// Full searchable AI asset report sourced from the CdnUploadRecord table.
/// Records with IsAiGenerated = true are the AI-assisted assets.
///
/// Security controls:
/// - Read-only query from catalog — no user input modifies data.
/// - Search parameter used in a parameterized EF Core query only.
/// - Pagination prevents resource exhaustion.
/// </summary>
public sealed class ReportModel(CatalogDbContext catalog) : PageModel
{
public const int PageSize = 50;
public IReadOnlyList<CdnUploadRecord> Records { get; private set; } = [];
public int TotalCount { get; private set; }
public int CurrentPage { get; private set; } = 1;
public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
public string? Search { get; private set; }
public int PageNumber { get; private set; } = 1;
public async Task OnGetAsync(
[Microsoft.AspNetCore.Mvc.FromQuery] string? search,
[Microsoft.AspNetCore.Mvc.FromQuery] int page = 1)
{
Search = search;
PageNumber = Math.Max(1, page);
CurrentPage = PageNumber;
var query = catalog.CdnUploadRecords
.Where(r => r.IsAiGenerated)
.AsNoTracking();
if (!string.IsNullOrWhiteSpace(search))
{
var term = search.Trim();
query = query.Where(r =>
EF.Functions.ILike(r.ObjectKey, $"%{term}%") ||
EF.Functions.ILike(r.Prefix, $"%{term}%"));
}
TotalCount = await query.CountAsync();
Records = await query
.OrderByDescending(r => r.UploadedAt)
.Skip((CurrentPage - 1) * PageSize)
.Take(PageSize)
.ToListAsync();
}
}