BlueSky Custom Handles
webbinaro/flarum-bluesky-handles
Enables your Flarum users to set their Bluesky handles to use a sub-domain of your site. I.e. @username.example.com vs the default bluesky domain.
- Downloads
- 19
- Version control
- github.com/eddiewebb/flarum-bluesky-handles
BlueSky Custom Handles
A Flarum extension. Enables your Flarum users to set their Bluesky handles to use a sub-domain of your site. I.e. @username.example.com vs the default bluesky domain.
Installation
Install with composer:
composer require webbinaro/flarum-bluesky-handles:"*"
Updating
composer update webbinaro/flarum-bluesky-handles:"*"
php flarum migrate
php flarum cache:clear
Requires FOF/Masquerade
This extension depends on a custom bio field provided by FOF/Masquerade. Setting details below.
- Create a new field, type
Advanced
- Set name as
Bluesky DID
or similar - Set validation rule as
regex:/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/
- Set icon to
fas-brands fa-bluesky
User entry
Users can find their DID on their Bluesky Profile > Settings > Handle > Custom Handle
Users can enter it on Flarum > Profile > Edit Profile
Wildcard Domain Support - Handle requirements
Bluesky will try to resolve subdomains matching requested user handles.
I.e. @eddie.adkadv.com will attempt to resolve https://eddie.adkadv.com
This means you will need to configure your webserver (nginx, apache) to convert these into requests on a specific API endpoint /api/bluesky/<subdomain>
- Add wildcard to your DNS Settings as a new A and AAAA record
- Update your webserver to route all subdomains to documented API.
- Update your SSL Certificates to handle wildcard domains.
Nginx Example
You can add a new server block to nginx to listen to wildcard domains, excluding known ones.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# listen for any subdomains EXCEPT gear.
server_name ~^(?<slug>(?!other-suddomain-to-exclude)\w+)\.example\.com$;
if ( $request_uri ~ ^/.well-known/atproto-did ) {
# send atproto did verification requests to custom endpoint
return $scheme://example.com/api/bluesky/$slug;
}
# send all other requests to subpath of user profile
return $scheme://example.com/u/$slug$request_uri;
# Requires SSL, so make sure you have a wildcard enabled cert
# This DNS validation
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}
Links
Versions
-
Version 1.0.3.
Likely works with Flarum v1.8.9.
Unlikely to work with Flarum v2.0.0-beta.1.
-
3 additional versions.
-
Extension created.