Perlsky 是一个 Perl 5 实现的 at 协议个人数据服务器。
Perlsky Is a Perl 5 Implementation of an at Protocol Personal Data Server

原始链接: https://tangled.org/alice.mosphere.at/perlsky

PerlSky 是一个用 Perl 5 实现的 AT 协议个人数据服务器 (PDS),最初是一个玩笑,但最终发展成了一个令人惊讶的强大项目。它旨在实现高精度和与官方 Bluesky PDS 的兼容性,但使用风险自负。 它支持核心 PDS 功能,包括账户管理(创建、身份验证、删除)、OAuth、仓库和同步功能(包括 firehose 和导入/导出)、blob 存储以及审核工具(删除、标签)。值得注意的是,它会将未知的请求代理到 Bluesky 的服务,并通过 Prometheus 提供指标。 PerlSky 经过严格测试。可以针对官方 PDS 进行验证,并使用 `atproto-smoke` 工具进行端到端浏览器冒烟测试。它还包括针对官方加密向量和 PLC 身份标准的测试。 提供有关使用 TLS、systemd 和反向代理设置的部署文档。有关代码结构、端点一致性和测试程序的详细信息,请参阅项目的文档。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Perlsky 是一个 Perl 5 实现的 at 协议个人数据服务器 (tangled.org) 13 分,由 mooreds 2 小时前发布 | 隐藏 | 过去的 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

An AT Protocol Personal Data Server written in Perl 5 that has been extensively tested and aims for accuracy and parity with the official PDS. Nonetheless, use it at your own risk.

perlsky-screenshot

Why#

Look, it started as a joke and then quickly got out of hand.

Quick start#

# install dependencies (Debian/Ubuntu)
apt-get install -y cpanminus libcbor-xs-perl libcryptx-perl \
  libdbd-sqlite3-perl libio-socket-ssl-perl
cpanm --notest [email protected]

# run locally
PERLSKY_CONFIG=config.json perl script/perlsky daemon -l http://127.0.0.1:7755

# check it's alive
curl http://127.0.0.1:7755/_health

For a real deployment with TLS, systemd, and reverse proxy setup, see docs/DEPLOYMENT.md.

What's implemented#

  • Accounts and authcreateAccount, createSession, refresh tokens, invite codes, email updates, password changes, account deletion. Both did:web and did:plc account methods.
  • OAuth — built-in ATProto OAuth provider surface. Modern clients (like Tangled) can authenticate directly against your PDS using PAR, PKCE, private_key_jwt, and DPoP. Supports transition scopes, granular permission families, and include:<nsid> scopes.
  • Repos and sync — native Perl implementations of CAR, DAG-CBOR, CID, and MST. Full com.atproto.sync.* surface including firehose, getRepo, and importRepo snapshot-restore.
  • Blobs — upload, download, deduplication, reference-counted lifecycle.
  • AppView proxying — unknown app.bsky.* and chat.bsky.* requests are forwarded to the public Bluesky services (or your own) using per-account service-auth JWTs.
  • Moderation — repo, record, and blob takedowns with real enforcement. Persisted labels with query and subscription support.
  • Crawler discovery — notifies configured relays (e.g. bsky.network) after repo activity.
  • Metrics — Prometheus-compatible endpoint at /metrics. See docs/METRICS.md.

For endpoint-by-endpoint conformance status, see docs/ENDPOINT_CONFORMANCE.md. For the module/facade split, see docs/CODE_STRUCTURE.md.

Testing#

Run the local test suite:

prove -lr t

Differential validation#

perlsky can be tested side-by-side against the official @atproto/pds to verify matching behavior on accounts, repos, moderation, sync, firehose, and importRepo. This isn't bulletproof but it still helped to shake out a lot of subtle and not-so-subtle bugs:

script/differential-validate

# or with PLC-backed accounts
PERLSKY_DIFF_ACCOUNT_DID_METHOD=did:plc script/differential-validate

# from the test suite
PERLSKY_RUN_REFERENCE_DIFF=1 prove -lv t/reference-differential.t
PERLSKY_RUN_REFERENCE_DIFF=1 prove -lv t/reference-differential-plc.t

The harness installs the reference runtime into .tools/reference-runtime with Node 20 via fnm.

Browser smoke — atproto-smoke#

End-to-end smoke tests drive real bsky.app sessions against a running perlsky instance — posting, following, lists, notifications, settings, and more. The browser runtime is a standalone project, atproto-smoke, designed to work with any AT Protocol PDS. perlsky provides a thin adapter script on top of it.

# clone atproto-smoke next to perlsky (one-time)
git clone https://tangled.org/alice.mosphere.at/atproto-smoke.git ../atproto-smoke
cd ../atproto-smoke && npm install && cd -

# bootstrap a reusable smoke account pair, then run
script/perlsky-browser-smoke bootstrap-pair   # one-time setup
script/perlsky-browser-smoke run-dual         # run the smoke

Full details in docs/BROWSER_SMOKE.md.

Interop fixtures#

Crypto and PLC identity tests run against official Bluesky test vectors and the @did-plc/lib mock to keep encoding and identity semantics pinned to upstream.

联系我们 contact @ memedata.com