https://blog.maartenballiauw.be/post/2022/11/05/mastodon-own-donain-without-hosting-server.html * Maarten Balliauw {blog} * About me * Talks & Presentations * Contact * Archive * Disclaimer Mastodon on your own domain without hosting a server Maarten Balliauw Maarten Balliauw Loves web and HTTP, C#, Kotlin, Azure and application performance. Developer Advocate at JetBrains. Frequent speaker at and organizer of various community events. Likes brewing his own beer. Follow * Antwerp, Belgium * Twitter * LinkedIn * Mastodon * Github Mastodon on your own domain without hosting a server November 05, 2022 Edit on GitHub Like many in the past week, I have been having a serious look at Mastodon as an alternative to Twitter. Mastodon is a social network that is distributed across many servers that have their own smaller communities, and federate with other servers to provide a more "global" social network. There are many servers out there that you can choose from. Alternatively, you can also self-host your Mastodon server, or use one of many hosted instances, "Mastodon as a service". In recent hours, I have seen many people wanting to host their own servers, which is great fun! Self-hosting also has the added benefit of being able to have a Mastodon account on your own domain, and you own your data. Now, I don't really care about that (yet?). I ran my own mail server back in the day and am very happy with someone running it for me now. The same goes with Mastodon: I trust the folks at Mastodon.online, the server I joined, to do a much better job at this than I will ever do. However, there is one thing I would like my own server for: discoverability. Much like with e-mail, I want folks to have an easy address to find me, and one that I can keep giving out to everyone even if later I switch to a different Mastodon server. A bit like e-mail forwarding to your ISP's e-mail service. The good news is: you can use your own domain and share it with other folks. It will link to your actual account. Go on, try it. Search for @[email protected], and you will find my @ [email protected]. How to discover Mastodon account via custom domain Reading "how to implement a basic ActivityPub server", there are a couple of things that stand out: * Mastodon (and others) use ActivityPub as their protocol to communicate between "actors". * Actors are discovered using WebFinger, a way to attach information to an email address, or other online resource. Since discovery is what I was after, WebFinger seemed like the only thing I would need to implement. WebFinger lives on /.well-known/webfinger on a server. For Mastodon, your server will be queried for accounts using an endpoint that looks like this: GET /.well-known/webfinger?resource=acct:[email protected] And indeed, if I look at my Mastodon server's webfinger for my account, I get a response back! GET https://mastodon.online/.well-known/webfinger?resource=acct:[email protected] { "subject": "acct:[email protected]", "aliases": [ "https://mastodon.online/@maartenballiauw", "https://mastodon.online/users/maartenballiauw" ], "links": [ { "rel": "http://webfinger.net/rel/profile-page", "type": "text/html", "href": "https://mastodon.online/@maartenballiauw" }, { "rel": "self", "type": "application/activity+json", "href": "https://mastodon.online/users/maartenballiauw" }, { "rel": "http://ostatus.org/schema/1.0/subscribe", "template": "https://mastodon.online/authorize_interaction?uri={uri}" } ] } Sweet! The next thing I tried was simply copy-pasting this JSON output to my own server under .well-known/webfinger, and things magically started working. In other words, if you want to be discovered on Mastodon using your own domain, you can do so by copying the contents of https:///.well-known/webfinger?resource=acct:@ to https:///.well-known/ webfinger. One caveat: this approach works much like a catch-all e-mail address. @[email protected] will match, unless you add a bit more scripting to only show a result for resources you want to be discoverable. Bonus: Discovering folks from Twitter Discoverability, at this stage, is one of the things that matter to get a proper social graph going. Over the past days, there were a couple of tools I found very useful in finding Twitter folks on Mastodon: * Twitodon learns about which Twitter account matches a Mastodon account, from folks using this service. * Fedifinder and Debirdify scan Twitter accounts and checks if there is a Mastodon account in their profile data. Good luck! And give @[email protected] a follow if you make the jump to Mastodon. Edit: Seems there is a GitHub issue which requests custom domains as well. Tags: General, Social media, Web Updated: November 05, 2022 Edit on GitHub Share on Twitter Facebook LinkedIn Previous Next Leave a Comment avatar [ ] [ ] [ ] Leave response 0 responses You May Also Enjoy Rate limiting in web applications - Concepts and approaches October 03, 2022 Your web application is running fine, and your users are behaving as expected. Life is good! Read more >> ASP.NET Core rate limiting middleware in .NET 7 September 26, 2022 Rate limiting is a way to control the amount of traffic that a web application or API receives, by limiting the number of requests that can be made in a given period of time. This can help to improve the performance of the site or application, and to prevent it from becoming unresponsive. Read more >> How to test ASP.NET Core Minimal APIs June 07, 2022 How do you test that your ASP.NET Core Minimal API behaves as expected? Do you need to deploy your application? Can you write tests with frameworks like xUnit, NUnit, or MSTest? Read more >> Techniques and tools to update your C# project - Migrating to nullable reference types - Part 4 May 03, 2022 Previously, we saw how you can help the compiler's flow analysis understand your code, by annotating your code for nullability. Read more >> * Follow: * Twitter * GitHub * Feed (c) 2022 Maarten Balliauw {blog}. Powered by Jekyll & Minimal Mistakes.