feat(server): run on the real archive engine

ArchiveModule registers the archive engine as the server's ingest, its
proxy/thumbnail locator and its job handlers (through the new
IJobHandlerProvider); Program.cs passes it to ServerHost.Build. The
server opens its archive through ArchiveService so archive.json always
exists. The server's path-safety helper is renamed ArchivePathGuard to
stop clashing with the archive layout's ArchivePaths, and the server
migration is renumbered 0003. An end-to-end test uploads a photo, finds
it in the layout and fetches the thumbnail built by the queued job.
CI's PostgreSQL jobs now run the server tests too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 13:00:38 +00:00
1 parent 8f54bd8804
commit ac9a150027
15 files changed
+150 -22

No files matched your search

@@ -0,0 +1,23 @@
using Titano.Core.Imaging.Decoders;
using Titano.Data;
using Titano.Data.Archiving;
using Titano.Data.Jobs;
namespace Titano.Server.Storage;
/// <summary>
/// The archive engine behind the server (BRIEF §7, §14.4): ingest of verified uploads, lookup of proxies and
/// thumbnails, and its job handlers (scan, rebuild, verify, import, thumbnails, proxies, maintenance). Decoding is
/// managed only (BRIEF §4.2).
/// </summary>
public static class ArchiveModule
{
public static void Register(IServiceCollection services)
{
services.AddSingleton(sp => new ArchiveService(sp.GetRequiredService<TitanoDatabase>(),
new ArchiveServiceOptions { Decoder = DecoderFactory.CreateServer(), Owner = "server@" + Environment.MachineName }));
services.AddSingleton<IArchiveIngest>(sp => sp.GetRequiredService<ArchiveService>().Ingest);
services.AddSingleton<IJobHandlerProvider>(sp => sp.GetRequiredService<ArchiveService>());
services.AddSingleton<IFrameAssetLocator, ArchiveAssetLocator>();
}
}