tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.49k stars 390 forks source link

Wrong name displayed when WEB_DOMAIN != LOCAL_DOMAIN #688

Open ctron opened 6 years ago

ctron commented 6 years ago

I have set up my instance in a way that WEB_DOMAIN=mastodon.dentrassi.de and LOCAL_DOMAIN=dentrassi.de.

The redirect and federation seem to work. However Tusky created my new user as @ctron@mastodon.dentrassi.de instead of @ctron@dentrassi.de. And it seems there is no way to change this.


charlag commented 6 years ago

Hi. Thanks for reporting. I've never seen an instance like this. Is this even okay for the Mastodon? It's not entirely clear what was the expected result and what should we change, could you elaborate please?

ctron commented 6 years ago

I've never seen an instance like this. Is this even okay for the Mastodon?

Yes it is, there is some documentation here: https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md

So the expected result would be that while the URL to the server is "mastodon.dentrassi.de", the domain of the instance still is "dentrassi.de".

charlag commented 6 years ago

This means that we should make requests to the longer address but everywhere it should be displayed as a shorter one, is this correct?

On Tue, 19 Jun 2018, 20:13 Jens Reimann, notifications@github.com wrote:

I've never seen an instance like this. Is this even okay for the Mastodon?

Yes it is, there is some documentation here: https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md

So the expected result would be that while the URL to the server is " mastodon.dentrassi.de", the domain of the instance still is "dentrassi.de ".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tuskyapp/Tusky/issues/688#issuecomment-398494510, or mute the thread https://github.com/notifications/unsubscribe-auth/AC9KBluD22tycfUAd_vAbPIofNd_DFvTks5t-T9QgaJpZM4UtrTj .

ctron commented 6 years ago

This means that we should make requests to the longer address but everywhere it should be displayed as a shorter one, is this correct?

Sounds good. I think this should be implemented according to the "webfinger" protocol which the document describes. Which would translate from the short name, to the longer request URI.

ClearlyClaire commented 6 years ago

The acct: URI in this case would be ctron@dentrassi.de. The WEB_DOMAIN being different should not change anything to how you handle anything client-side, unless you try to reconstruct an acct: URI from an account URL, but you should not do that, as the Mastodon REST API should provide you with all the URIs you need without you needing to do any guesswork, as far as I know.

connyduck commented 6 years ago

Yes we are constructing our own names because we have only one column in the database for domain, we need to add another field for this.

ClearlyClaire commented 6 years ago

Oh, it's about the user's own identifier, not people they interact with. Hm, in this case, I'm not completely sure the API presents something useful? The WebUI doesn't really care about that, it never uses the user's domain… but a multi-account client…

connyduck commented 6 years ago

Ok I just checked, the api does not include the domain. https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#account

acct | Equals username for local users, includes @domain for remote ones

damn it

connyduck commented 6 years ago

Looks like we would have to add an additional call to GET /api/v1/instance if we want to fix this issue.

viscountexx commented 1 year ago

Hi! I'm chiming in to say that I run into this issue due to a GoToSocial instance I'm admining. We made the decision to host it at gts.LOCAL_DOMAIN because of GoToSocial's current bare-bones structure and wanting to have proper instance About pages and links to clients. Is this still only held up by making one call? It should only need to happen once and then be stored for the account, right?