👔 Web finger now only serve opt-in fediverse publishers

This commit is contained in:
2025-12-31 18:57:25 +08:00
parent 413ae80c96
commit 6c8c52e3b2
2 changed files with 11 additions and 5 deletions

View File

@@ -150,7 +150,7 @@ public class ActivityPubActivityHandler(
activityId ?? "" activityId ?? ""
); );
logger.LogInformation("Handleed follow from {Actor} to {Target}. RelationshipState: Accepted", logger.LogInformation("Handled follow from {Actor} to {Target}. RelationshipState: Accepted",
actorUri, objectUri); actorUri, objectUri);
return true; return true;
} }
@@ -195,7 +195,7 @@ public class ActivityPubActivityHandler(
await db.SaveChangesAsync(); await db.SaveChangesAsync();
logger.LogInformation("Handleed accept from {Actor}", actorUri); logger.LogInformation("Handled accept from {Actor}", actorUri);
return true; return true;
} }
@@ -222,7 +222,7 @@ public class ActivityPubActivityHandler(
await db.SaveChangesAsync(); await db.SaveChangesAsync();
logger.LogInformation("Handleed reject from {Actor}", actorUri); logger.LogInformation("Handled reject from {Actor}", actorUri);
return true; return true;
} }
@@ -345,7 +345,7 @@ public class ActivityPubActivityHandler(
await db.SaveChangesAsync(); await db.SaveChangesAsync();
logger.LogInformation("Handleed like from {Actor}", actorUri); logger.LogInformation("Handled like from {Actor}", actorUri);
return true; return true;
} }
@@ -365,7 +365,7 @@ public class ActivityPubActivityHandler(
await db.SaveChangesAsync(); await db.SaveChangesAsync();
} }
logger.LogInformation("Handleed announce from {Actor}", actorUri); logger.LogInformation("Handled announce from {Actor}", actorUri);
return true; return true;
} }

View File

@@ -41,6 +41,12 @@ public class WebFingerController(
if (publisher == null) if (publisher == null)
return NotFound(); return NotFound();
var hasActor = await db.FediverseActors
.AnyAsync(a => a.PublisherId == publisher.Id);
if (!hasActor)
return NotFound();
var actorUrl = $"https://{Domain}/activitypub/actors/{username}"; var actorUrl = $"https://{Domain}/activitypub/actors/{username}";
var response = new WebFingerResponse var response = new WebFingerResponse