Peertube: HTML and AP formats use different account ids, leading to incompatible URLs

Created on 23 May 2018  路  10Comments  路  Source: Chocobozzz/PeerTube

When viewing a video, the account it links to looks something like https://peertube.mastodon.host/accounts/1328

going to that page shows the right videos and data:

image

but when plugging that URL into another AP system, like mastodon, it suddenly fails to work:

image

nightpool@neo:~$ curl -H "Accept: application/ld+json" https://peertube.mastodon.host/accounts/1328
{"error":"Account not found"}

It turns out that when you webfinger the account, it actually returns a completely different URL: https://peertube.mastodon.host/accounts/sandhawke

However, when you look at it in a browser, this just renders a blank page:

image

this URL incompatibility makes it really hard for users to find accounts that they may be interested in following, especially since as far as I can tell, peertube doesn't have any sort of remote follow button yet. Many mastodon users are used to using the search bar to resolve URL content when they want to interact with it from their local instance.

Type

Most helpful comment

Strictly speaking, there is no requirement that viewing the actor URI ever render HTML. But I agree this is probably what users expect. Redirects, depending upon content negotiation, to the "equivalent" page for that content-type seem reasonable.

All 10 comments

Thanks for the issue @nightpool

Just have a question: if you curl an account id (for example 1328) that is on another server, should we return a 301 to the origin URL of this actor or a 404?

hmm. I could see both arguments. I'd vote for 301 off the top of my head, but maybe there are consequences to that I'm not thinking of at the moment.

but the thing that's important is that the web interface is consistent with always showing the user the "correct" url.

also, what happens when someone names themselves 1337 or whatever? does the user with that id then become inaccessible?

Edit : said crap, sorry.

Okay so with this commit https://github.com/Chocobozzz/PeerTube/commit/ad9e39fb815d85e5e718c40540fa75471474fa17, now we only use account names (and host for remote actors) in client routes (like the AP routes) : /accounts/chocobozzz or /accounts/[email protected]. It fixes the consistency issue with AP routes and the issue when the actor has only numbers in his username (because /accounts/:idNumber is not a valid route anymore).

That's good, but it doesn't solve the part where the user wants to do an ActivityPub query on /accounts/[email protected].

@cwebber Do you have any thoughts on https://github.com/Chocobozzz/PeerTube/issues/584#issuecomment-391701147?

Strictly speaking, there is no requirement that viewing the actor URI ever render HTML. But I agree this is probably what users expect. Redirects, depending upon content negotiation, to the "equivalent" page for that content-type seem reasonable.

@cwebber as i understand it, the question is about remote user accounts. i.e. should https://peertube.mastodon.host/accounts/[email protected] 301 to https://example.com/accounts/chocobozzz

Anyway, uniting the client and AP routes was the main thing I was worried about here, so i think the main concern is resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filmaidykai picture filmaidykai  路  3Comments

Angedestenebres picture Angedestenebres  路  3Comments

ufm picture ufm  路  3Comments

kabo picture kabo  路  3Comments

Jorropo picture Jorropo  路  3Comments