比如您在 Mastodon 系统上的用户名为: @[email protected] ,现在您可以申请一下域名后缀的别名:
示例:[email protected] | [email protected] 都指向到了 @[email protected]
如果您拥有自己的域名,但是没有部署 Mastodon 或者其他 Fediverse 的应用程序。可以为自己的域名设置别名。需要用到 Cloudflare Worker ,参考项目: https://github.com/willin/fediverse-alias
Fork 或者 Clone 该项目:
git clone https://github.com/willin/fediverse-alias.git
编辑 wrangler.toml
:
name = "fediverse-alias" compatibility_date = "2023-01-01" # 修改为你自己的路由 routes = [ { pattern = "yourdomain.com/.well-known/webfinger*", zone_name = "yourdomain.com" } # 如果有多个,继续添加 ] [[d1_databases]] binding = "DB" database_name = "dns" # 修改为你刚创建的数据库 ID database_id = "xxx"
修改 migrations/0011_seeds.sql
:
-- 这里是一个示例: INSERT INTO aliases(`alias`,`account`,`owner`) VALUES('[email protected]','[email protected]',''); -- 多条记录在此处添加
执行:
npm run deploy npm run migration
维护者 Owner: Willin Wang
如果您对本项目感兴趣,可以通过以下方式支持我:
Donation ways:
Apache-2.0
![]() | 1 justin2018 2023-12-24 11:38:56 +08:00 |
![]() | 2 willin OP @justin2018 就几行代码 |
3 SharkIng 2024-04-05 11:35:32 +08:00 有演示么?做好之后是什么效果? |