Fetch remote nodeinfo in the background and show it as pleroma.instance #8001

Open
lambadalambda wants to merge 5 commits from lambadalambda/pleroma:feature/instance-nodeinfo into develop

Instance.get_or_update_metadata (#7230 / !3853) stores a server's nodeinfo software, but nothing calls it, and the API part was left for later. This finishes it, in the shape Akkoma already uses:

  • A remote post schedules NodeInfoFetcherWorker for its server, after the transaction. At most once a day per server, checked through a new instances cache.
  • The fetch now also keeps metadata.features (bounded). It reads only nodeinfo links on the server itself, limits answers to 50 KB, keeps the old data when a fetch fails, and upserts the row.
  • Remote accounts get pleroma.instance: {name, nodeinfo: {software: {name, version, repository}, metadata: {features}}}, like Akkoma's akkoma.instance. null for local accounts and unknown servers.
  • config :pleroma, :instances_nodeinfo, enabled: true (as in Akkoma). Documented in the cheatsheet, description.exs and the API differences.

Use case: a frontend can tell that the author's server shows no emoji reactions (Mastodon), or no custom ones.

`Instance.get_or_update_metadata` (#7230 / !3853) stores a server's nodeinfo software, but nothing calls it, and the API part was left for later. This finishes it, in the shape Akkoma already uses: - A remote post schedules `NodeInfoFetcherWorker` for its server, after the transaction. At most once a day per server, checked through a new `instances` cache. - The fetch now also keeps `metadata.features` (bounded). It reads only nodeinfo links on the server itself, limits answers to 50 KB, keeps the old data when a fetch fails, and upserts the row. - Remote accounts get `pleroma.instance`: `{name, nodeinfo: {software: {name, version, repository}, metadata: {features}}}`, like Akkoma's `akkoma.instance`. `null` for local accounts and unknown servers. - `config :pleroma, :instances_nodeinfo, enabled: true` (as in Akkoma). Documented in the cheatsheet, description.exs and the API differences. Use case: a frontend can tell that the author's server shows no emoji reactions (Mastodon), or no custom ones.
Instance.get_or_update_metadata had no caller. A remote post now
schedules a NodeInfoFetcherWorker for its server (at most daily, through
an instances cache). The fetch keeps nodeinfo metadata.features, reads
only links on the server itself, limits answers to 50 KB, keeps old data
when it fails and upserts the row.
MastodonAPI: show the server's nodeinfo on remote accounts as pleroma.instance
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline was successful
dec192e28e
The shape follows Akkoma's akkoma.instance: name, and nodeinfo with
software and metadata.features.
Mix: pleroma.instance refresh_nodeinfo fetches the nodeinfo of all known servers
Some checks failed
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline is pending
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline is pending
ci/woodpecker/pr/changelog Pipeline was canceled
ci/woodpecker/pr/lint Pipeline was canceled
91eb1add5f
For the first run after an upgrade. The task starts the instances cache.
Mix: refresh_nodeinfo covers servers with posts in the last 30 days (--days)
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline was successful
2d2c2cc8d3
Merge branch 'develop' into feature/instance-nodeinfo
Some checks failed
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.17 Pipeline failed
9f8f2da05c
Some checks failed
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.17 Pipeline failed
This pull request has changes conflicting with the target branch.
  • lib/mix/pleroma.ex
  • lib/pleroma/application.ex
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feature/instance-nodeinfo:lambadalambda-feature/instance-nodeinfo
git switch lambadalambda-feature/instance-nodeinfo

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff lambadalambda-feature/instance-nodeinfo
git switch lambadalambda-feature/instance-nodeinfo
git rebase develop
git switch develop
git merge --ff-only lambadalambda-feature/instance-nodeinfo
git switch lambadalambda-feature/instance-nodeinfo
git rebase develop
git switch develop
git merge --no-ff lambadalambda-feature/instance-nodeinfo
git switch develop
git merge --squash lambadalambda-feature/instance-nodeinfo
git switch develop
git merge --ff-only lambadalambda-feature/instance-nodeinfo
git switch develop
git merge lambadalambda-feature/instance-nodeinfo
git push origin develop
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma!8001
No description provided.