Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Add node info endpoint #38

Closed
wants to merge 9 commits into from
Closed

Add node info endpoint #38

wants to merge 9 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 19, 2019

This closes #21

I didn't implement all of the same metadata as pleroma (the metadata stuff is all optional). Specifically I didn't implement the federation node since I was unsure how to translate domain blocks/silences the fields pleroma is outputting.

edits
After talking it thru I now have the federation nodes

You can see this changes in action on my instance:

CW: lots of very bad instance names

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"
      ]
    }
  }
}

@kaniini
Copy link

kaniini commented Feb 19, 2019

fediverse.network implements 2.0 right now, so it would be good to support both.

as for translating the blocks/silences, you should add your own fields for that, under the federation object. we can extend fediverse.network for viewing those fields fairly easily.

@ghost ghost closed this Feb 19, 2019
@kaniini
Copy link

kaniini commented Feb 19, 2019

is there some reason this was closed?

@ghost
Copy link
Author

ghost commented Feb 19, 2019

@kaniini I am working on implementing your suggestions (2.0 support and federation information). I will reopen once those are done.

@ghost ghost reopened this Feb 19, 2019
@kaniini
Copy link

kaniini commented Feb 20, 2019

you should probably add the ability to disable the block disclosure as Pleroma has, but it looks pretty good.

@ariasuni
Copy link
Contributor

Yeah, some instances don’t disclose their instance block and silence to avoid being harassed for defamation or things like that.

@ghost
Copy link
Author

ghost commented Feb 20, 2019

@ariasuni Thats a good point. Maybe an admin setting to choose wether to disclose this info?

@clarfonthey clarfonthey modified the milestones: 0.x.x, 1.x.x Feb 20, 2019
@clarfonthey clarfonthey added V-feature-bump New features and additions that require a feature (version) bump C-api API (component) labels Feb 20, 2019
@clarfonthey
Copy link
Member

Because this is going to require more discussion on what should be disclosed and how this should be configured, I definitely don't think we should merge this before 1.0. That said, there may be some minimal version we could add before 1.0 that excludes all of the controversial data, although I'm not sure what such a minimal set is.

@clarfonthey
Copy link
Member

Also FWIW I edited your post to include a content warning for all of the silenced/suspended instance names. Caught me a bit by surprise when I scrolled down the post.

@ghost
Copy link
Author

ghost commented Feb 20, 2019

@clarfon Let me know what y'all think, I could just exclude the federation node from the metadata for now since its optional and we could decide to add it back in the future.

@kaniini
Copy link

kaniini commented Feb 20, 2019

fwiw you could probably use an environment setting to control the disclosure. i think that is how the other mastodon settings work that are configured from the panel.

@ghost
Copy link
Author

ghost commented Feb 21, 2019

I'll keep this PR fresh and mergeable until we make a decision. It would be really easy to add an admin option to control the sharing of domain block data.

@ghost
Copy link
Author

ghost commented Mar 2, 2019

I also tried to PR this to upstream mastodon but...I'm pretty sure its going nowhere mastodon/mastodon#10079

Some of the comments are worth noting and thinking about (like removing the activeHalfyear activeMonths nodes)

@kaniini
Copy link

kaniini commented May 18, 2019

any status on this? would be nice to have for fediverse.network and other crawlers

@mal0ki
Copy link
Member

mal0ki commented May 18, 2019

@kaniini no status because we've not started actually putting stuff into a first release yet.
That work is starting next week, and with that we'll make sure to get some updates on the pull requests and stuff here over the next 14 days. Seeing where things fit in.

@kaniini
Copy link

kaniini commented May 18, 2019

cool. thanks for the update. was just wondering what was going on. will try to drop in on mattermost sometime.

@clarfonthey
Copy link
Member

So in terms of merging this, I think that if we started by showing the barest amount of info and the potentially questionable stuff were left behind an opt-in setting for now, that should be good to merge in. We can iron out the details post-1.0.

@ghost
Copy link
Author

ghost commented May 21, 2019

@clarfon Let me know what should / shouldn't go in and I can update. I might also have some other updates from when I tried to PR it upstream.

@kaniini
Copy link

kaniini commented May 22, 2019

mainly the instance blocks I guess

@clarfonthey
Copy link
Member

I don't mind leaving in the code to display the instance blocks, although it should be commented out or hidden behind an opt-in config option. Also, I feel that the logic on stating whether registrations are open needs to be changed due to the addition of registration requests in the latest version.

@clarfonthey clarfonthey modified the milestones: v0.0.x (pre-release after 0.1), v0.1.0 (Pre-Release 1.0) May 25, 2019
@clarfonthey clarfonthey added B-fediverse (Benefits) fediverse and non-mastodon instances K-fediverse-extensions (Kind) is non-standard fediverse features and removed V-feature-bump New features and additions that require a feature (version) bump labels May 25, 2019
@clarfonthey clarfonthey closed this Jun 9, 2019
@clarfonthey
Copy link
Member

While the project is still small, we decided to rename the master branch to main. Unfortunately, you're going to have to reopen this PR on that branch.

@ghost ghost deleted the nodeinfo branch July 9, 2019 23:10
@rhaamo
Copy link

rhaamo commented Jul 12, 2019

What's the status of this ? (on florence side, and PR-side)

Can this PR be respin as-is ?

@mal0ki
Copy link
Member

mal0ki commented Jul 12, 2019

What's the status of this ? (on florence side, and PR-side)

Can this PR be respin as-is ?

I think it could be added again as was, yes, but it needed to be submitted again because we renamed the branch.

@rhaamo
Copy link

rhaamo commented Jul 12, 2019

Ok thanks !

I can try to get that submitted in the next 2/3 days if nobody does it before that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B-fediverse (Benefits) fediverse and non-mastodon instances C-api API (component) K-fediverse-extensions (Kind) is non-standard fediverse features
Development

Successfully merging this pull request may close these issues.

5 participants