← all docs
← all docs
MetalBear
atprotopdscself-hosting
MetalBear is an AT Protocol Personal Data Server written in C and built on wolfram. It provides a runnable PDS foundation with multi-account hosting, admin tooling, and a dynamic landing page.
Version: 0.2.0
Core Features
com.atproto.server.describeServer,createSession,getSession,refreshSession,deleteSession- restart-persistent, HS256-signed AT Protocol access/refresh JWTs with refresh rotation
- durable standard and privileged app passwords with one-time password display
- repository-key-signed
com.atproto.server.getServiceAuthJWT issuance - authenticated record creation, update, deletion, batch writes, and CAR import
- public record reads, collection listing, repo description, and latest commit
- full or revision-filtered CAR repository export and CID-selected block export
- durable
com.atproto.sync.subscribeRepossequencing with live commit events com.atproto.identity.resolveHandle,/.well-known/atproto-did, anddid:webservice documentcom.atproto.identity.updateHandleandgetRecommendedDidCredentials- durable account deactivation/reactivation
com.atproto.server.checkAccountStatuscom.atproto.server.reserveSigningKeycom.atproto.server.createInviteCodeandcreateInviteCodes- durable SQLite-backed signed repositories and file-backed blob upload/serving
Admin Endpoints
com.atproto.admin.getAccountInfo— resolve DID to handle/email/active statecom.atproto.admin.sendEmail— send templated emailcom.atproto.admin.getInviteCodes— list invite codescom.atproto.admin.deleteAccount— permanently remove an accountcom.atproto.admin.updateSubjectStatus— apply takedown, deactivation, or reactivationcom.atproto.admin.updateAccountPassword— reset account passwordcom.atproto.admin.enableAccountInvites/disableAccountInvites
OAuth Authorization Server
GET /.well-known/oauth-authorization-server— RFC 8414 server metadataGET /.well-known/oauth-protected-resource— RFC 9728 resource metadataGET /oauth/jwks— ES256 public JWK SetPOST /oauth/par— Pushed Authorization RequestGET /oauth/authorize— Authorization endpoint with auto-approvalPOST /oauth/token— Token endpointPOST /oauth/revoke— Token revocation
Build and Test
cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure
Run
export METALBEAR_SERVICE_DID='did:web:pds.example.com'
export METALBEAR_ACCOUNT_DID='did:plc:replace-with-your-account-did'
export METALBEAR_HANDLE='alice.example.com'
export METALBEAR_USER_DOMAIN='.example.com'
export METALBEAR_PASSWORD='replace-with-a-strong-password'
./build/metalbear
Email Configuration (Optional)
export METALBEAR_SMTP_HOST='smtp.example.com'
export METALBEAR_SMTP_PORT=587
export METALBEAR_SMTP_USERNAME='user@example.com'
export METALBEAR_SMTP_PASSWORD='your-smtp-password'
export METALBEAR_FROM_ADDRESS='pds@example.com'
export METALBEAR_FROM_NAME='My PDS'
export METALBEAR_ACCOUNT_EMAIL='alice@example.com'
Status
This is not yet a production-complete PDS. PLC DID document publication, TLS termination, and operational hardening remain to be implemented.
← all docs