Custom domain handles on Bluesky (with Terraform!)
Bluesky is a new social network, decentralised and allowing you to own your custom handle, let's experiment with this feature.
Bluesky, the future trending social network? To be honest… no idea but I am always interested in exploring new services and understanding how they are working.
When asking to ChatGTP a quick brief about Bluesky:
Bluesky is a decentralized social network and microblogging platform conceptualized by former Twitter CEO Jack Dorsey. Initially founded by Twitter in 2019, Bluesky has since become an independent entity, operating as a public benefit LLC. It was created as part of Twitter's broader initiative to explore decentralized social media solutions.
The platform operates its own official network, Bluesky Social, which runs on proprietary software for its servers and client applications. As of 2023, part of the protocol implementation has been released under an MIT license, although neither the protocol nor the service claimed to use blockchain technology as of 2022.
Bluesky Social is designed to be a decentralized social media platform with the aim of creating an open social media ecosystem. This ecosystem is envisioned to enable developers to build and innovate, giving users more control over the services they use. Unlike Twitter, Bluesky isn't committed to any particular technology stack in its entirety and is exploring the use of blockchains for various use cases.
As of late 2023, Bluesky had reached 2 million users, despite remaining an invite-only app. The platform is working towards federation and becoming a truly open network, aiming to expand its reach and capabilities.
The development of Bluesky represents a significant move in the social media landscape, particularly as discussions around decentralization, user privacy, and content moderation continue to be prominent. Its growth and evolution will likely be closely watched by both users and industry experts alike.
When I am basically out of every social network except for Linkedin, I wanted to explore Bluesky as the new challenger and finally got my invitation code today.
I poked a little bit around and wanted to leverage the ability to create a custom handler. by default, you will be able to get something link: @username.bsky.social, working but the promise of the AT protocol (the protocol under the Bluesky app) is to be distributed and used from multiple networks so it best to have an identity abstracted from any network.
By default, you can easily change your handle from the settings page:
But if you want to use a custom domain, you need to play a little bit with your DNS config by creating a TXT record, for example, to get the @freier.fr handler.
But my family is more than one member so I wanted a more generic approach to let the family members confirm their handles.
Let’s say I want to create one DNS entry for each member of the family, I need to ask them their did (unique ID on the network) and assign the correct TXT record.
And because all my domains and users are managed by Terraform, it was fairly simple to add some automation:
a custom attribute for my Google Workspace users
Then each family member can assign their own did, triggering the creation of their TXT entry
resource "googleworkspace_schema" "bluesky" {
schema_name = "bluesky"
fields {
field_name = "handle"
field_type = "STRING"
}
fields {
field_name = "did"
field_type = "STRING"
}
}
Then I can output a list of all my users and their did:
output "bluesky_users" {
value = module.users.bluesky_users
}
---
bluesky_users = [
[
"niels",
"did:plc:5n3idnmeewspobgm6unjby37",
],
]
a TXT entry per family member
and finally, simply need to iterate over them to create the TXT records, allowing them to confirm their custom handles.
resource "cloudflare_record" "TXT_bluesky" {
count = length(var.bluesky_users)
zone_id = data.cloudflare_zone.freier_fr.id
name = "_atproto.${var.bluesky_users[count.index][0]}"
value = var.bluesky_users[count.index][1]
type = "TXT"
}
Again, no idea if Bluesky and AT Protocol are the future and social networking but as a geek, I am always more than happy to be prepared, hopefully you will be able to do the same for your organization/family!