Giter Site home page Giter Site logo

Comments (7)

CDN18 avatar CDN18 commented on June 5, 2024 1

For the "Expose Mastodon API compatible version" part, there's an optional setting called instance-inject-mastodon-version.

Plus, /api/v2/instance returns source_url, which may be considered as another alternative.

from gotosocial.

technicat avatar technicat commented on June 5, 2024 1

For the "Expose Mastodon API compatible version" part, there's an optional setting called instance-inject-mastodon-version.

Plus, /api/v2/instance returns source_url, which may be considered as another alternative.

Thanks, I'm operating on the client side so can't control the instance configuration, but source_url is a good option. TootSDK is only using the v1 instance but I can add v2 to my fork and try it out.

edit: I just looked in the gotosocial code and saw instanceMastodonVersion is harcoded to 3.5.3 so I will do the same!

from gotosocial.

tsmethurst avatar tsmethurst commented on June 5, 2024 1

Perhaps another alternative would be to look at the node-info page for the 'software' value?

For example: https://gts.superseriousbusiness.org/nodeinfo/2.0 returns:

{
  "version": "2.0",
  "software": {
    "name": "gotosocial",
    "version": "0.15.0+git-15733cd"
  },
  "protocols": [
    "activitypub"
  ],
  "services": {
    "inbound": [],
    "outbound": []
  },
  "openRegistrations": true,
  "usage": {
    "users": {
      "total": 5
    },
    "localPosts": 2769
  },
  "metadata": {}
}

By comparison, https://mastodon.social/nodeinfo/2.0 returns:

{
  "version": "2.0",
  "software": {
    "name": "mastodon",
    "version": "4.3.0-nightly.2024-04-29"
  },
  "protocols": [
    "activitypub"
  ],
  "services": {
    "outbound": [],
    "inbound": []
  },
  "usage": {
    "users": {
      "total": 1927427,
      "activeMonth": 239944,
      "activeHalfyear": 622063
    },
    "localPosts": 89637022
  },
  "openRegistrations": true,
  "metadata": {
    "nodeName": "Mastodon",
    "nodeDescription": "The original server operated by the Mastodon gGmbH non-profit"
  }
}

from gotosocial.

technicat avatar technicat commented on June 5, 2024 1

Thanks, examining nodeinfo does look like a better approach to figuring out what platform you're dealing with before making any API queries, and the nodeinfo README lists many of the ones I'm dealing with.

https://github.com/jhass/nodeinfo

Edit: and I see this is what feditext is doing.

from gotosocial.

tsmethurst avatar tsmethurst commented on June 5, 2024

Shall I close this then, since we already have what you need? :)

from gotosocial.

technicat avatar technicat commented on June 5, 2024

Shall I close this then, since we already have what you need? :)

You can close this as a won't-fix, of course, but I wouldn't say I have what I need, more like I'm looking at workarounds. Currently I'm hardcoding the API version and string matching for "git" which is not so good for both parts.

Most gotosocial instances don't seem to have the mastodon version display flag turned on, and the one I found that does, displays a slightly older version (3.3.0) which also results in it being displayed as the GotoSocial version on its home page and FediDb, and that version string is just the version with no suffix so there's no way to distinguish from that string that it's gotosocial.

I'm working on querying for the v2 instance so I can get the source_url but that will only fix the platform issue and v2 instance was introduced with mastodon 4.0 so I don't know how many platforms have it implemented.

So I still think it would be preferable to have the version string conform to the pseudo-convention for Mastodon API-compatible platforms, and then you wouldn't need the instance-inject-mastodon-version option.

from gotosocial.

daenney avatar daenney commented on June 5, 2024

I'll go ahead and close this then. The nodeinfo is ideally what clients should use to figure out the implementation.

The instance-inject-mastodon-version thing is a crutch but it's been helpful to nudge some fidgetty clients. But most admin's don't enable it since, well, most clients don't need it πŸ˜„.

from gotosocial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.