Pasture: Smithereen 1.0.3, and failed server descriptions retried
Smithereen joins the pasture (tools/pasture/peers/smithereen.sh): its image on the shared MySQL, with imgproxy and a file server behind Caddy, a JDK trust store with the pasture's CA, accounts from its signup form, and a password grant for a local application. scenarios/smithereen.sh drives its VKontakte-like API: friends as mutual follows, wall posts, comments, likes, reposts (quotes there), polls, edits, deletions, private messages, the unfollow and statistics, 30 checks. A post on someone else's wall never reaches PrivaPub, since Smithereen sends it only to servers whose actors publish a wall: G-0009, waiting for the owner. PrivaPub: a server description that failed (Smithereen serves no NodeInfo until it has a description) frees its week, so the server's next arrival asks again instead of a week later. The shared Postgres takes 400 connections: at 100 the village seed ran it dry (Sharkey's API answered 500, Misskey dropped deliveries). The seeder records a follow that stands from an earlier seed when the step itself fails, so the checker no longer expects that follower to see nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
7b0377c85f
commit
5f150b7a59
12 files changed
+367
-5
No files matched your search
@@ -206,6 +206,30 @@ namespace PrivaPub.Tests.Statistics
|
||||
Assert.False((await DB.Default.Find<RemoteInstanceSnapshot>().Match(s => s.Host == gone).ExecuteSingleAsync(token)).Reachable);
|
||||
}
|
||||
|
||||
// a server whose NodeInfo failed is asked again on its next arrival, not a week later
|
||||
[Fact]
|
||||
public async Task A_failed_description_frees_its_weeks_key_and_a_good_one_keeps_it()
|
||||
{
|
||||
var token = TestContext.Current.CancellationToken;
|
||||
var broken = $"broken{Guid.NewGuid():N}.example";
|
||||
var fine = $"fine{Guid.NewGuid():N}.example";
|
||||
ServeServer("/" + fine, "smithereen", v2: false);
|
||||
var queue = new JobQueue();
|
||||
async Task Run(string host)
|
||||
{
|
||||
var key = InstanceDescriber.DedupeKey(host, DateTime.UtcNow);
|
||||
Assert.True(await queue.Enqueue(JobKind.DescribeInstance, host, host, key, token));
|
||||
var job = await DB.Default.Find<Job>().Match(j => j.DedupeKey == key).ExecuteSingleAsync(token);
|
||||
await new PeerDescriber(Peer.Http(), default, default, _peer.A + "/" + host).Handle(job, token);
|
||||
}
|
||||
|
||||
await Run(broken);
|
||||
await Run(fine);
|
||||
|
||||
Assert.True(await queue.Enqueue(JobKind.DescribeInstance, broken, broken, InstanceDescriber.DedupeKey(broken, DateTime.UtcNow), token));
|
||||
Assert.False(await queue.Enqueue(JobKind.DescribeInstance, fine, fine, InstanceDescriber.DedupeKey(fine, DateTime.UtcNow), token));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task A_crawled_server_never_downgrades_a_touched_one_and_robots_are_obeyed()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user