4.8 KiB
atproto
https://github.com/bluesky-social/atproto
- @
- [at]mosphere
- at://proto
- at protocol
account
- https://at.syu.is/at/yui.syui.ai
- https://plc.syu.is/did:plc:6qyecktefllvenje24fcxnie
- https://plc.directory/did:plc:ytvoptig4ddshmwdsjmhtcym
$ curl -sL syu.is/xrpc/_health
{"version":"0.4.65"}
# latest
# https://github.com/bluesky-social/atproto/blob/main/packages/pds/package.json
$ curl -sL https://raw.githubusercontent.com/bluesky-social/atproto/refs/heads/main/packages/pds/package.json |jq -r .version
$ curl -sL "syu.is/xrpc/com.atproto.repo.describeRepo?repo=ai.syu.is" |jq -r .did
did:plc:6qyecktefllvenje24fcxnie
$ curl -sL "syu.is/xrpc/com.atproto.repo.listRecords?repo=ai.syu.is&collection=app.bsky.feed.post&reverse=true&limit=1"
{"records":[{"uri":"at://did:plc:6qyecktefllvenje24fcxnie/app.bsky.feed.post/3l6s2riuouk2j","cid":"bafyreibjohl7va4upkibw5twaxdd4jg3l6rmfatu4dpjjfd5xkb2ijtlx4","value":{"text":"hello","$type":"app.bsky.feed.post","langs":["ja"],"createdAt":"2024-10-18T13:21:39.809Z"}}],"cursor":"3l6s2riuouk2j"}
feed
at://did:plc:6qyecktefllvenje24fcxnie/app.bsky.feed.generator/cmd
- https://api.bsky.app/xrpc/app.bsky.feed.getFeed?feed=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd
- https://feed.syu.is/xrpc/app.bsky.feed.getFeedSkeleton?feed=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.generator/cmd
- https://desc.syu.is/xrpc/app.bsky.feed.getFeedSkeleton?feed=at://did:plc:6qyecktefllvenje24fcxnie/app.bsky.feed.generator/cmd
link
- https://github.com/bluesky-social/atproto
- https://github.com/itaru2622/bluesky-selfhost-env
- https://github.com/bluesky-social/atproto/discussions/2026
self-host
currently, bsky and bsync require patches to function properly. additionally, social-app is not displaying avatars. for components that are not working, it's recommended to use itaru2622/bluesky-selfhost-env. this repository provides an environment for self-hosting bluesky.
- bsky = appview
- ozone = mod
# BSKY_IMG_URI_ENDPOINT, BSKY_BLOB_CACHE_LOC
# avatar link example
1. https://appview.${host}/img/avatar/plain/${did}/${cid}@jpeg
2. https://${host}/xrpc/com.atproto.sync.getBlob?did=${did}&cid=${cid}
docker compose will not be published unless you write ports. it is only valid internally. add ports only for what you want to publish.
api
# create account
url=https://${pds}/xrpc/com.atproto.server.createAccount
json="{\"email\": \"$email\", \"handle\": \"$handle\", \"password\": \"$password\"}"
curl -X POST -H "Content-Type: application/json" -d $json -sL $url
change src/pds/handle
to use a name of 3 characters or less. also, you cannot create an account with a name of 3 characters or less from social-app (web client). please create it from api.
# invite code
admin_password=xxx
url=https://$host/xrpc/com.atproto.server.createInviteCode
json="{\"useCount\":1}"
curl -X POST -u admin:${admin_password} -H "Content-Type: application/json" -d "$json" -sL $url
oauth
# https://github.com/bluesky-social/cookbook/tree/main/python-oauth-web-app
$ cd ./repos/cookbook/python-oauth-web-app
$ rye sync
$ rye run python3 -c 'import secrets; print(secrets.token_hex())'|xargs echo FLASK_SECRET_KEY|tr -d ' ' >> .env
$ rye run python3 generate_jwk.py |xargs echo FLASK_CLIENT_SECRET_JWK|tr -d ' ' >> .env
$ cat .env
$ rye run flask run
please access 127.0.0.1:5000
. it may not work if you use localhost.
also, oauth doesn't work on localhost. use ngrok, tailscale, cloudflare.
$ ngrok http http://localhost:5000
$ cloudflared tunnel --url http://localhost:5000