Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Federation: @domain@domain names fail to be recognised, delivered to #6505

Closed
2 tasks done
aral opened this issue Feb 18, 2018 · 2 comments
Closed
2 tasks done

Federation: @domain@domain names fail to be recognised, delivered to #6505

aral opened this issue Feb 18, 2018 · 2 comments
Labels
api REST API, Streaming API, Web Push API

Comments

@aral
Copy link

aral commented Feb 18, 2018

I am building a federated personal web site where there is no concept of users (there is only one person, who owns the site). Therefore, the addressing system is just @domain, not user@domain.

Since Mastodon uses WebFinger, I have to pretend that there’s a “user” there. As I want to be able to federate with systems that Mastodon that are multi-tenant and yet I also want people to be able to address me with my domain alone (e.g., @ar.al instead of @aral@ar.al), the convention on our system will be that, for federation with multi-tenant services, the “username” will be set to the domain.

So, in my WebFinger link, I’m returning:

<https://${domain}/.well-known/webfinger?resource=acct%3A${domain}%40${domain}>; rel="lrdd"; type="application/xrd+xml", <https://${domain}/>; rel="alternate"; type="application/activity+json"

(Where ${domain} is the domain – e.g., ar.al)

(My preferredUsername in the Actor object is also the domain.)

This works initially and Mastodon is able to follow my account (I get follow and unfollow activities properly). It also works intuitively with autocompletion when I’m writing a toot (so I can start typing @domain and my account is found).

However:

  1. The toot does not get sent (tested with a direct message).
  2. When I look at the composed toot, the name is not clickable and neither is it truncated to just the “username” (I see the full @domain@domain displayed in the toot.)

@Gargron Thoughts? This is pretty crucial for what I’m building :)


  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • This bug happens on a 2.2.0
@aral aral changed the title Federation: @domain@domain names seem to fail Federation: @domain@domain names fail to be recognised, delivered to Feb 18, 2018
@puckipedia
Copy link
Contributor

puckipedia commented Feb 28, 2018

Mastodon currently does not have support for this, I think you're hitting a small snag in an assumption:

preferredUsername, on Mastodon instances, is in the format /\A[a-z0-9_]+\z/i. While this isn't enforced for remote instances, the regex used to determine mentions basically does enforce it: /@(([a-z0-9_]+)(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i

I'm assuming that this is why mentions aren't recognized as one, and why DMs aren't federated.

Sidenote: I'm wondering if using the domain as preferredUsername is the best thing to do, tbh. After all, not everyone will have access to a novelty domain, and e.g. I prefer just @puckipedia over e.g. @puckipedia.com. However: I do feel that the mention regex might have to be loosened up a bit, to allow for this situation to occur. I am actually slightly surprised that full stops aren't in the regex already...

@wxcafe wxcafe added question api REST API, Streaming API, Web Push API labels Mar 2, 2018
@SoniEx2
Copy link

SoniEx2 commented Mar 17, 2018

I'd love if it was @@domain instead. I mean, really, why not?

@Gargron Gargron closed this as completed Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API, Streaming API, Web Push API
Projects
None yet
Development

No branches or pull requests

5 participants