定制 webbinaro/flarum-bluesky-handles 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webbinaro/flarum-bluesky-handles

最新稳定版本:1.0.3

Composer 安装命令:

composer require 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.

关键字:

README 文档

README

Latest Stable Version Total Downloads

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.

Bluesky user settings with verified custom 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.

  1. Create a new field, type Advanced
  2. Set name as Bluesky DID or similar
  3. Set validation rule as regex:/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/
  4. Set icon to fas-brands fa-bluesky

Example Masquerade Settings

User entry

Users can find their DID on their Bluesky Profile > Settings > Handle > Custom Handle

Users can enter it on Flarum > Profile > Edit Profile

Example user entry

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>

  1. Add wildcard to your DNS Settings as a new A and AAAA record
  2. Update your webserver to route all subdomains to documented API.
  3. 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

统计信息

  • 总下载量: 96
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-1.0-or-later
  • 更新时间: 2024-11-22