Access control options for /tag/some-hashtag endpoints?

I have my instance set to let unauthenticated users only view the public timeline, and a side effect of this is that any /tag/whatever URL throws a 401 (at least in Akkoma-flavor pleroma-fe)

Thanks to the fact that Mastodon (or really all/most AP implementations?) converts hashtags into URLs pointing to the poster’s instance, occasionally ppl will click a hashtag in one of my posts & then send me a screenshot of a 401 error, which is annoying for them and for me :slight_smile:

My ideal would be that AP would be different & that hashtags in posts would be converted to URLs pointing to a hashtag endpoint on the reader’s instance, but I’m pretty sure we can’t fix that in this forum. (that’d sure be nice tho)

However, I’m wondering if it’d be possible to either suppress the 401 for /tag/whatever endpoints, or (and this is a heavier lift) have /tag/whatever endpoints implicitly obey the restrict-unauthenticated settings such that /tag/whatever would only show posts from the public timeline to unauthenticated users if that’s the setting, rather than just throwing a 401.

this annoys me also. In my mind, clicking a hashtag to search should return searches from your local (reader’s) instance.

hashtags in posts would be converted to URLs pointing to a hashtag endpoint on the reader’s instance

this is how akkoma works , we do that

sounds like an issue with external software

I think I’m even more confused now! :slight_smile:

Where does hashtag conversion to links happen in Akkoma – inbound, or outbound? And if a hashtag comes in from, let’s say Mastodon, and it’s already converted to a URL (pointing to the poster’s instance) then I guess it stays that way? Because I definitely see hashtags in posts that have come from Masto that are pointing to the poster’s instance. I’ll have to keep my eyes out for a post from another Akko instance with a hashtag in it :slight_smile:

I feel like I’d be interested in having that be configurable – not a high priority, but something that I’d find useful.

Or I guess more specifically: is this called on outbound posts before they leave my instance, or on inbound posts as part of formatting them for display to me?

OMG and I just realized that when I hover a hashtag in pleroma-fe my browser shows me the URL as being an URL to the poster’s instance, but when I click it it goes to my instance. But also if I right-click and do ‘open in new tab’ it goes to the poster’s instance.

This seems . . . confusing. Kind of neat (if you know what to expect) but also confusing ¯_(ツ)_/¯

1 Like

I was about to say that it does this. Highly annoying for a mastodon user though where it treats it as an external link. I don;t understand why they even need to be links, to me the FE should see it as a hashtag (with no url) and process it locally on the viewers instance. I don’t pretend to know how the backend works, just as a user this makes more sense to me.

okay… hashtags in posts from GoToSocial load a new page on their instance with that hashtag search. How is this a thing after hashtags being used just fine on AP for half a decade. :expressionless:

Using AkkomaFE.

Do you have an example of a GoToSocial post like that?

For the technical part:
Afaik, hashtags are added in the AP object with the tag key and type “Hashtag”. And when they are also added in the content (which s generally the case for micro blogging), the a element gets a class mention and hashtag, and a rel tag[1]. Front-ends can then decide to handle these differently. (I’m unsure what of these Akkoma checks exactly.)

Maybe GoToSocial doesn’t handle this completely like Akkoma-FE expects, but I need an example to check it out.

[1] A Note (ie post) containing just a hashtag “#cofe” would have something like this for content and tag

{
  "content": "<p><a href=\"https://remote-instance.example.org/tags/Cofe\" class=\"mention hashtag\" rel=\"tag\">#<span>Cofe</span></a> </p>",
  "tag": [
    {
      "type": "Hashtag",
      "href": "remote-instance.example.org/tags/Cofe",
      "name": "#cofe"
    }
  ]
}

image

This post hashtag tries to open https://menoize.nohost.me/tags/captainrex which doesnt load for me

Link to OP (as I have my instance locked down) https://menoize.nohost.me/@pink/statuses/01HAAE3DYP53TBDAC7TMN8H0K8
Search for and open from your instance to test, I suppose.

I’m going to assume a bunch of stuff is actually GoToSocial issues, as the tags page opened doesnt even list posts with those tags even though there clearly is at least one. I’ll update my other Post about profile pics/emoji with the same assumption.

i have additional information here since gargron came to me with a buggo

our HTML scrubber was being mean and removing our rel, which may have been causing the routing issues their side

fixed in develop

2 Likes

noticed it attempted to load hashtags in a new window on their platform from Streams (I think this is what it is?) example https://the.talesofmy.life/item/3c6a322c-283c-425c-8cb2-2dcd1f6cacfa

I have authenticated fetch on, no timelines/profiles visible to unauthenticated.
Running develop.