From d0a13d9cc2a9949e82bfef6ea3c818d6f4f9574c Mon Sep 17 00:00:00 2001 From: thepra Date: Sat, 3 Oct 2026 12:30:05 +0200 Subject: [PATCH] M11: the planner accepts reserved test names for seeds on a test network, as the crawler does for peers Found by the pasture's crawler scenario: a mastodon.test seed was dropped before it was ever planned. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ELjqpznMFMNrJoJUj6K5p2 --- PrivaPub/Federation/Crawler/Crawler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PrivaPub/Federation/Crawler/Crawler.cs b/PrivaPub/Federation/Crawler/Crawler.cs index 116bee2..daeea9c 100644 --- a/PrivaPub/Federation/Crawler/Crawler.cs +++ b/PrivaPub/Federation/Crawler/Crawler.cs @@ -28,12 +28,14 @@ namespace PrivaPub.Federation.Crawler readonly IJobQueue _queue; readonly IDomainBlocks _blocks; readonly IOptionsMonitor _options; + readonly IOptionsMonitor _federation; - public CrawlPlanner(IJobQueue queue, IDomainBlocks blocks, IOptionsMonitor options) + public CrawlPlanner(IJobQueue queue, IDomainBlocks blocks, IOptionsMonitor options, IOptionsMonitor federation = default) { _queue = queue; _blocks = blocks; _options = options; + _federation = federation; } public JobKind Kind => JobKind.CrawlPlan; @@ -55,7 +57,7 @@ namespace PrivaPub.Federation.Crawler if (!crawler.Enabled) return JobOutcome.Done; var now = DateTime.UtcNow; - foreach (var seed in PeerHosts.Filter(crawler.Seeds ?? new(), host => !_blocks.IsSuspended(host))) + foreach (var seed in PeerHosts.Filter(crawler.Seeds ?? new(), host => !_blocks.IsSuspended(host), _federation?.CurrentValue.AllowPrivateNetworks == true)) await DB.Default.Update() .Match(i => i.Host == seed) .Modify(b => b.SetOnInsert(i => i.Seen, "crawled"))