• thisisawayoflife@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    7 months ago

    You do it via a webfinger. But the service itself has to request a specific resource in order to route it correctly. For example, mastodon and pixelfed ask for the same resource, so both services will end up getting the same service’s account.

  • stinerman [Ohio]@midwest.social
    link
    fedilink
    English
    arrow-up
    8
    ·
    7 months ago

    No, not in the example that you’ve set up. The username is always @user@domain. This is like asking if you can have the same email address on Gmail and Hotmail or whatever. You can have the same user part, but not the domain.

    People that have used user@x.domain and also user@y.domain is allowed because they’re different domain names.

    • wander1236@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      2
      ·
      7 months ago

      Technically you sort of can do that with email. Most providers let you verify you own the other email and then use the other provider’s SMTP to send from a different address.

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    English
    arrow-up
    5
    ·
    7 months ago

    Matrix and ActivityPub are different protocols. You cannot use them interchangeably. However, you can register the same user@server for both Matrix and Mastodon/Lemmy, and theoretically you even could set up some kind of single sign-on that’ll let you use the same login system for access to either.

    The hard part is using the same account for Lemmy and Mastodon. ActivityPub is built for interoperability, but it doesn’t have a universal shared account design.

    Theoretically, in the “you’ll have to write a couple of thousand lines of code to hack together a prototype” sense, you could unify multiple services. I’ve theorised about such a service before.

    What you would need is a separate piece of software that will a) receive incoming posts from other servers and redistribute them to multiple services (Lemmy, Mastodon, etc.), b) catch outgoing posts and use whatever means necessary to also make all other services for the same account aware of the post and c) ensure that the necessary signing keys are the same across all services.

    The first part should be relatively easy to do. The second will rewuire modifying code on all services, of use some kind of man-in-the-middle attack on your own outgoing traffic and modifying the database directly. The third part can probably be done by copying one field in a database and pasting it over another.

    Alternatively, you could take another approach: reimplementing the Mastodon API into Lemmy, or the Lemmy API into Mastodon. That’s not exactly trivial (putting the Lemmy API onto Mastodon would probably be easier but comment chains would be broken without Fedifetcher) but the frontends and apps are separate from the backends, so it’s all very much possible if you put in the effort.

    ActivityPub itself describes a client-server protocol that should theoretically be independent of server implementations. If all services would implement this protocol, it wouldn’t matter what app or server you use, because all apps would be able to connect to all servers and exchange all kinds of messaging. Unfortunately, the C2S spec is rather underdefined (it provides no standardised way to log in, for example…) and I think there are only two or three server projects with partial support. Client support is even worse, I believe there’s one Android app and a few web interfaces that look unfinished. Most ActivityPub services operate through either the Mastodon API or their own bespoke API when it comes to server users actually posting content.

    I’m not sure if such a system would be very usable. Lemmy behaves very weirdly when it comes to ActivityPub traffic (using boosts to ensure every post and comment reaches every server) so following Lemmy from Mastodon isn’t a great experience at the moment.

    If you don’t care to interact with Lemmy servers from Mastodon or vice versa, you could abuse the webfinger protocol. If you tell Lemmy servers that user@server is located at user@lemmy.server and Mastodon servers that user@server is located as user@mastodon.server, you’ll still appear as user@server on either and you’ll probably be able to reach most ActivityPub servers without any issues. However, this does mean that Mastodon users will no longer be able to interact with you on Lemmy and vice versa. You’ll also end up with some overhead, as every server connecting to yours now needs to be fingerprinted to check if it’s Lemmy/Kbin or Mastodon/other.

    • muntedcrocodile@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      Thank you for the very detailed explanation. I figured for services using a different protocal would be easyer as they can be handled almost independantly.

      Would i need to modify the code of every services to man in the middle myself surly since i control the private key i can just do it after it leaves the service then if i pipe that back to my “universal” incoming it would distribute it to the relevent services?

      I dont understand why the last approach breaks mastadon-lemmy interaction? It seems like the best solution if it wasnt for that.

      • Skull giver@popplesburger.hilciferous.nl
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 months ago

        Would i need to modify the code of every services to man in the middle myself surly since i control the private key i can just do it after it leaves the service then if i pipe that back to my “universal” incoming it would distribute it to the relevent services?

        If you do a perfect MitM (which is quite hard and requires constant modifications as software you’re MitMing updates) you wouldn’t need to change anything about the applications you’re running. I don’t think that’s very viable, though.

        I dont understand why the last approach breaks mastadon-lemmy interaction? It seems like the best solution if it wasnt for that.

        The way Webfinger works is that a remote server fetches details about the correct destination for messages once and then uses that to post a bunch of updates. If you tell every Lemmy server to post to user@lemmy.server, the Lemmy servers wouldn’t be able to post to user@mastodon.server.

  • bogdugg@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 months ago

    I don’t know if there’s a service that provides both functions. I’m sure there’s a way to do it - Lemmy posts are already accessible through Mastodon. Currently, I assume you would need the instance itself to offer both services under one account.

    • muntedcrocodile@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 months ago

      Well i recently got myself a new server and domain and was going to self host all my things though it would be cool to have the same username and domain across services without needing to do subdomain shenanigans.