Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement NodeInfo endpoint #10079

Closed
wants to merge 6 commits into from

Conversation

@msdos621
Copy link
Contributor

commented Feb 20, 2019

This addresses #6739

This is my attempt to implement the node info protocol found here https://github.com/jhass/nodeinfo . I have also followed pleroma's lead and tried to add similar metaData.

You can see this changes in action on my instance
https://banana.dog/.well-known/nodeinfo

{
  "links": [
    {
      "rel": "http://nodeinfo.diaspora.software/ns/schema/2.0",
      "href": "https://banana.dog/nodeinfo/2.0"
    },
    {
      "rel": "http://nodeinfo.diaspora.software/ns/schema/2.1",
      "href": "https://banana.dog/nodeinfo/2.1"
    }
  ]
}

https://banana.dog/nodeinfo/2.1

{
  "version": "2.1",
  "usage": {
    "users": {
      "total": 58,
      "activeHalfyear": 26,
      "activeMonth": 14
    },
    "localPosts": 11932
  },
  "software": {
    "version": "2.7.1.cerberus",
    "name": "mastodon",
    "repository": "https://github.com/usbsnowcrash/mastodon"
  },
  "services": {
    "outbound": [],
    "inbound": []
  },
  "protocols": [
    "ostatus",
    "activitypub"
  ],
  "openRegistrations": true,
  "metaData": {
    "nodeName": "Banana.dog",
    "nodeDescription": "\\u003cp\\u003e\r\nOfficially endorsed by \\u003ca href=\"https://mastodon.social/@Gargron/100059130444127703\"\\u003e@Gargron\\u003c/a\\u003e as a joke instance (along with \\u003ca href=\"https://freedom.horse/about\"\\u003efreedom.horse\\u003c/a\\u003e).  Things that make banana.dog unique as an instance.\r\n\\u003cul\\u003e\r\n\\u003cli\\u003eFederates with TOR servers\\u003c/li\\u003e\r\n\\u003cli\\u003eStays up to date, often running newest mastodon code\\u003c/li\\u003e\r\n\\u003cli\\u003eUnique color scheme\\u003c/li\\u003e\r\n\\u003cli\\u003eStrictly enforced \\u003ca href=\"https://banana.dog/about/more\"\\u003erules\\u003c/a\\u003e\\u003c/li\\u003e\r\n\\u003cli\\u003eA BananaDogInc company.  Visit our other sites sites including \\u003ca href=\"https://betamax.video\"\\u003ebetaMax.video\\u003c/a\\u003e, \\u003ca href=\"https://psychicdebugging.com\"\\u003epsychicdebugging\\u003c/a\\u003e and \\u003ca href=\"https://somebody.once.told.me.the.world.is.gonnaroll.me/\"\\u003egonnaroll\\u003c/a\\u003e\\u003c/li\\u003e\r\n\\u003c/ul\\u003e\r\n\\u003c/p\\u003e\r\n\\u003cp\\u003e\r\n\\u003cem\\u003eWho we are looking for:\\u003c/em\\u003e\r\nThis instance only allows senior toot engineers. If you have at least 10+ years of mastodon experience please apply here (https://banana.dog). We are looking for rockstar ninja rocket scientists and we offer unlimited PTO as well as a fully stocked snack bar (with soylent). We are a lean, agile, remote friendly mastodon startup that pays in the bottom 25% for senior tooters. All new members get equity via an innovative ICO call BananaCoin.\r\n\\u003c/p\\u003e\r\n\\u003cp\\u003e\r\n\\u003cem\\u003eThe interview process\\u003c/em\\u003e\r\nTo join we have a take home exam that involves you writing several hundred toots that we can use to screen you.  We will then throw these away during your interview so that we can do a technical screening where we use a whiteboard to evaluate your ability to re-toot memes and shitpost in front of a panel.  This panel will be composed of senior tooters who are all 30 year old cis white males (coincidence).\r\n\\u003c/p\\u003e\r\n\\u003cp\\u003e\r\n\\u003cem\\u003eHere are the reasons you may want to join:\\u003c/em\\u003e\r\nWe are an agile tooting startup (a tootup). That means for every senior tooter we have a designer, a UX person, a product manager, project manager and scrum master. We meet for 15min every day and plan twice a week in a 3 hour meeting but it’s cool because you get lunch and have to attend. Our tooters love it, I would know if they didn’t since we all have standing desks in an open office layouts d can hear everything!\r\n\\u003c/p\\u003e\r\n\\u003cp\\u003e\r\n\\u003ca href=\"https://www.patreon.com/bePatron?u=178864\" data-patreon-widget-type=\"become-patron-button\"\\u003eSupport our sites on Patreon\\u003c/a\\u003e\r\n\\u003c/p\\u003e\r\n\r\n",
    "nodeTerms": "",
    "siteContactEmail": "",
    "domain_count": 3506,
    "features": [
      "mastodon_api",
      "mastodon_api_streaming"
    ],
    "invitesEnabled": true,
    "federation": {
      "reject_media": [],
      "reject_reports": [
        "wagesofsinisdeath.com",
        "honey.church",
        "mobile.co",
        "neckbeard.xyz"
      ],
      "silence": [
        "pl.smuglo.li",
        "rainbowdash.net",
        "shitposter.club",
        "freezepeach.xyz",
        "social.heldscal.la",
        "woofer.alfter.us",
        "social.au2pb.net",
        "gorf.club",
        "sealion.club",
        "gs.smuglo.li",
        "unsafe.space",
        "pawoo.net",
        "mstdn.jp",
        "mstdn.maud.io",
        "wrongthink.net",
        "libertarianism.club",
        "mastodon-train.info",
        "music.pawoo.net",
        "oransns.com",
        "knzk.me",
        "mastodon.cloud",
        "mastodon.motcha.tech",
        "unnerv.jp",
        "gamelinks007.net",
        "lainternet.online",
        "switter.at",
        "voluntaryism.club",
        "toot.love",
        "social.hidamari.blue",
        "social.homunyan.com",
        "anitwitter.moe",
        "ika.moe",
        "admins.town",
        "bofa.lol",
        "wagesofsinisdeath.com",
        "honey.church",
        "gameliberty.club",
        "albin.social",
        "newjack.city",
        "mobile.co",
        "neckbeard.xyz",
        "humblr.social",
        "hotwife.social"
      ],
      "suspend": [
        "porntoot.com",
        "preteengirls.biz",
        "pleroma.cucked.me",
        "social.allthefallen.ninja",
        "baraag.net",
        "rapefeminists.network",
        "gasthe.lgbt"
      ]
    }
  }
}
JY and others added 4 commits Feb 19, 2019
Add nodeinfo to mastodon proper (#4)
* Add nodeinfo endpoint

* dont commit stuff from my local dev

* consistant naming since we implimented 2.1 schema
Add some additional node info stuff (#5)
* Add nodeinfo endpoint

* dont commit stuff from my local dev

* consistant naming since we implimented 2.1 schema

* expanding this to include federation info
@Shleeble

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

edit: actually.... sharing blocks is a great idea

@@ -13,6 +13,10 @@ class InstancePresenter
to: Setting
)

def active_count(timespan: Time.zone.now - 1.month..Time.zone.now)
Status.select('distinct (account_id)').where(local: true, created_at: timespan).count

This comment has been minimized.

Copy link
@nightpool

nightpool Feb 20, 2019

Collaborator

users that log on and don't post are still active.

This comment has been minimized.

Copy link
@msdos621

msdos621 Feb 20, 2019

Author Contributor

I wasn't sure exactly how to determine that since a user could stay logged in for a long period of time? I welcome suggestions from anyone who knows the schema better than me.

This comment has been minimized.

Copy link
@nightpool

nightpool Feb 20, 2019

Collaborator

That's why we track statistics explicitly in ActivityTracker

@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Feb 20, 2019

We've mentioned a couple of time that we're not really interesting in implementing nodeinfo—the spec itself is extremely inconsistent, not extensible, and doesn't work well with our existing statistic collection system (and we don't see a ton of value in the stats it does collect, like activeHalfyear)

@msdos621

This comment has been minimized.

Copy link
Contributor Author

commented Feb 20, 2019

@nightpool Feel free to reject this PR if nodeinfo is not something mastodon wishes to pursue. I figured y'all were still open since the original issue was still open. Its also worth noting that the a lot of servers do implement it ¯_(ツ)_/¯

@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Feb 20, 2019

The original issue is "Expose instance metadata as json-ld" and we're still looking for a good way to do that in a standardized fashion

@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Feb 20, 2019

Having something that a lot of servers implement is nice, but I wouldn't want to cargo cult a bad standard just because it's popular. nodeinfo is basically haphazardly structured json with a couple of arbitrary properties—of the servers that you implement it, i would love to see what selection of properties each actually implements. For example, I know pleroma has a ton of information in their metadata field that's not actually standardized by nodeinfo—and your proposed solution does as well. How is that any better then the existing state of the world?

At least in the current state of the world you can never get confused because mastodon's nodeName means a slightly different thing then pleroma's nodeName

@msdos621

This comment has been minimized.

Copy link
Contributor Author

commented Feb 20, 2019

Let me know if this is a non starter and I'll close. I like following what the other servers are doing and I thought I'd offer it up since I already did the work in another fork.

@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Feb 20, 2019

I'm open to hearing counter-arguments if people have them

@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Feb 20, 2019

i would also be open to implementing it without the metadata and user activity statistics fields, since those are my main concerns about the current standard

@deutrino

This comment has been minimized.

Copy link

commented Feb 21, 2019

It improves the current state of the world by making life a little easier for developers of apps / alternate front ends, stats aggregators / instance choosers, etc.

@msdos621 msdos621 referenced this pull request Mar 2, 2019
@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Mar 4, 2019

@usbsnowcrash easier how? what functionality does this provide to apps/alternate frontends?

@msdos621

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

@nightpool why are you tagging me. I’m not the one who wrote the comment saying it was making life easier. I implemented this because it seemed to be something everyone else was already doing.

@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Mar 4, 2019

Sorry, that was my fault, fatfingered the tag. "Everyone else is doing it" is a bad reason for adding code, it just leads to more bloat. Are you okay with me editing the PR to remove the metadata section?

@msdos621

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

@nightpool go for it! As I said earlier I offered it up since I already did the work for Florence.

@trwnh

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2019

My reservation is mostly for the reasons given regarding nodeinfo's inconsistency. Also, isn't there some information already presented via /api/v1/instance? Perhaps that endpoint could be expanded. That would prevent reliance on a nonstandard presentation. At the same time, this is probably something that should be hammered out as a more general spec...

@kaniini

This comment has been minimized.

Copy link
Contributor

commented Mar 17, 2019

The metadata part is the most important part, since it provides disclosure of things like blocks. Yes, NodeInfo sucks, but it's reasonably standard at this point.

@Gargron

This comment has been minimized.

Copy link
Member

commented Mar 17, 2019

I have previously stated my position on automatic disclosure of domain blocks. Even if you discard issues that arise from malicious actors being made aware of themselves having been blocked (which sparked conflict on the fediverse plenty of times), and providing real-time feedback for their evasion tactics, I am also worried about the legal implications of publicly pointing to domains that host illegal content

@kaniini

This comment has been minimized.

Copy link
Contributor

commented Mar 17, 2019

Mastodon's block behavior already provides immediate feedback: if your own instance knows you're blocked, it starts lying to you about what data is available and also throwing server errors when you try to interact, which basically contradicts what you say about not providing real-time feedback.

Publishing lists of blocked instances is legally protected by 18 USC 230 in the US and similar legislation in the EU and elsewhere, and frankly, users have the right to know what they are signing up for ahead of time. In Pleroma, it is possible to disable the disclosures if wanted, obviously that should be the same case here, but if someone is "shopping around" for an instance, they should be able to know whether they can talk to their friends or not.

@msdos621

This comment has been minimized.

Copy link
Contributor Author

commented Mar 22, 2019

I am closing this as it seems there isn't much desire for it from the maintainers.

@msdos621 msdos621 closed this Mar 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.