Repository navigation
Serve NodeInfo 2.0 and 2.1 while federation is on - #496
Conversation
Fediverse servers and directories read /.well-known/nodeinfo to learn what software a site runs and how big it is; without it JustJournal shows up as unknown software. The figures count every account, the accounts that logged in within 30 and 180 days, and public entries, the same totals the site statistics already publish. They are counted at most once an hour. openRegistrations follows userAllowNew, which sign-up already obeys. The version comes from Spring Boot build-info. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideThe PR adds federation-gated NodeInfo 2.0/2.1 discovery and documents, generating software version data from Maven build metadata and reporting cached site-wide usage statistics, with repository support and targeted controller/service tests. Sequence diagram for federation-gated NodeInfo discovery and documentssequenceDiagram
participant Crawler
participant NodeInfoController
participant FederationPolicy
participant NodeInfoService
participant BuildProperties
participant Settings
Crawler->>NodeInfoController: GET /.well-known/nodeinfo
NodeInfoController->>FederationPolicy: isEnabled()
alt federation enabled
NodeInfoController->>Settings: getBaseUri()
NodeInfoController-->>Crawler: 200 JSON links for 2.0 and 2.1
Crawler->>NodeInfoController: GET /nodeinfo/2.1
NodeInfoController->>FederationPolicy: isEnabled()
NodeInfoController->>BuildProperties: getIfAvailable()
NodeInfoController->>NodeInfoService: usage()
NodeInfoService-->>NodeInfoController: cached or recounted Usage
NodeInfoController->>Settings: isUserAllowNew(), getSiteName()
NodeInfoController-->>Crawler: 200 JSON with profile content type and CORS
else federation disabled
NodeInfoController-->>Crawler: 404 Not Found
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Nov 2, 2026 9:09p.m. | Review ↗ | |
| Java | Nov 2, 2026 9:09p.m. | Review ↗ | |
| Shell | Nov 2, 2026 9:09p.m. | Review ↗ | |
| JavaScript | Nov 2, 2026 9:09p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Fediverse servers and directories read NodeInfo to learn what software a site runs and how big it is. JustJournal had none, so it showed up as unknown software.
Endpoints
GET /.well-known/nodeinfolinks the 2.0 and 2.1 documents, always over https.GET /nodeinfo/2.0andGET /nodeinfo/2.1return the documents. The content type isapplication/jsonwith the schemaprofile. 2.1 addssoftware.repositoryandsoftware.homepage.activitypub.federation.enabledis off, all three return 404.Access-Control-Allow-Origin: *, as the figures are public.What it reports
justjournal, with the version from Spring Bootbuild-info. This adds abuild-infoexecution tospring-boot-maven-plugin; without build information, as in an IDE, the version isunknown.activitypub. Outbound services:atom1.0andrss2.0.openRegistrations: follows the existinguserAllowNewsetting, which sign-up already obeys. No new config.users.totalcounts every account, not only journals that federate (your choice). It is the same total the site statistics already publish.activeMonthandactiveHalfyearcount users whoselastloginis within 30 and 180 days.localPostscounts public entries, as the site statistics do.metadata.nodeName: the site name, when it is set.Testing
NodeInfoControllerTests(6) andNodeInfoServiceTests(2). They cover both documents, discovery, closed sign-up, missing build information, the 404s with federation off and unknown schema versions, and the hourly recount.spring-boot:build-infowritesbuild.version=3.2.1.countByLastLoginAfterquery on MySQL 8;🤖 Generated with Claude Code
Summary by Sourcery
Expose standards-compliant NodeInfo metadata while federation is enabled.
New Features:
Enhancements:
Build:
Tests: