Add link labyrinth, static robots.txt and robots bait paths
Build and deploy / build (push) Successful in 1m28s
Build and deploy / deploy (push) Successful in 20s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Opus 5.5 committed 2026-11-16 23:57:52 +01:00
1 parent b7027e2a72
commit a25072e6fb
29 files changed
+774 -34

No files matched your search

@@ -14,6 +14,7 @@ public static class RuntimeSettingsParser
private const int MaxDelayMs = 30_000;
private const int MaxChunkSize = 4096;
private const int MaxHeadStartSize = 65_536;
private const int MaxLinkSpacing = 4096;
public static RuntimeSettingsParseResult Parse(RuntimeSettingsInput input)
{
@@ -59,6 +60,8 @@ public static class RuntimeSettingsParser
var minChunk = ParseInt(input.MinChunkSize, nameof(input.MinChunkSize), 1, MaxChunkSize, errors);
var maxChunk = ParseInt(input.MaxChunkSize, nameof(input.MaxChunkSize), 1, MaxChunkSize, errors);
var headStart = ParseInt(input.HeadStartSize, nameof(input.HeadStartSize), 0, MaxHeadStartSize, errors);
var linkSpacing = ParseInt(input.LinkSpacing, nameof(input.LinkSpacing), 0, MaxLinkSpacing, errors);
var baits = ParseBaitPaths(input.BaitPaths, nameof(input.BaitPaths), errors);
var hold = ParseTimeSpan(input.MaxHoldDuration, nameof(input.MaxHoldDuration), MinHold, MaxHold, errors);
if (minDelay > maxDelay)
@@ -85,10 +88,32 @@ public static class RuntimeSettingsParser
maxChunk!.Value,
headStart!.Value,
input.MatchPath,
linkSpacing!.Value,
baits!,
hold!.Value),
errors);
}
private static string? ParseBaitPaths(string? raw, string field, Dictionary<string, string> errors)
{
var entries = BaitPaths.Split(raw);
var normalized = entries.Select(BaitPaths.Normalize).ToList();
if (normalized.Any(entry => entry is null))
{
errors[field] = "Pfade wie /backup-2024/, ohne Leerzeichen; nicht /robots.txt und nicht unter den Labyrinth-Ordnern (wiki, docs, blog, backup …).";
return null;
}
var distinct = normalized.OfType<string>().Distinct().ToList();
if (distinct.Count > BaitPaths.MaxCount)
{
errors[field] = $"Höchstens {BaitPaths.MaxCount} Pfade.";
return null;
}
return string.Join(',', distinct);
}
private static TimeSpan? ParseTimeSpan(
string? raw,
string field,