Mirror from bluesky-social/pds

add SANDBOX.md

dholms 57c853d5 6f5e85a4

+131
+6
README.md
··· 2 2 3 3 Welcome to the repository for the official Bluesky PDS (Personal Data Server). This repository includes container images and documentation designed to assist technical people with self-hosting a Bluesky PDS. 4 4 5 + We're testing federation in a separate sandbox network. Checkout [SANDBOX.md](https://github.com/bluesky-social/pds/blob/main/SANDBOX.md) for an overview of the sandbox network. 6 + 7 + We do not currently support PDS federation on the production network. 8 + 5 9 ## FAQ 6 10 7 11 ### What is Bluesky? ··· 284 288 1. Enter the URL of your PDS (e.g. `https://example.com/`) 285 289 1. Create an account 286 290 1. Create a post 291 + 292 + Checkout [SANDBOX.md](https://github.com/bluesky-social/pds/blob/main/SANDBOX.md) for an overview of participating in the sandbox network. 287 293 288 294 ## PDS environment variables 289 295
+125
SANDBOX.md
··· 1 + # Sandbox Guide 2 + 3 + Welcome to the atproto federation sandbox! 4 + 5 + This is a completely separate network from our production services that allows us to test out the federation architecture and wire protocol. 6 + 7 + **🐉 Beware of dragons!** 8 + 9 + This hasn’t been production tested yet. It seems to work pretty well, but who knows what’s lurking under the surface. Have patience with us as we prep for federation. 10 + 11 + On that note, please give us feedback either in [Issues](https://github.com/bluesky-social/atproto/issues) (actual bugs) or [Discussions](https://github.com/bluesky-social/atproto/discussions) (higher-level questions/discussions) on the [atproto repo](https://github.com/bluesky-social/atproto). 12 + 13 + ### Sandbox Rules 14 + 15 + Please checkout the [Sandbox Rules](LINK_ME) before we get started. The gist is: this network is meant to test the technical underpinnings of federation. If you turn up technical problems for us, then you’re doing a great job. If you cause problems for us otherwise, we will defederate from you and will not give an explanation. 16 + 17 + Do not: 18 + 19 + - post content that requires active moderation or violates the [Bluesky Community Guidelines](https://blueskyweb.xyz/support/community-guidelines) 20 + - advertise your service as being “Bluesky” or “production atproto network” - this is a sandbox and is meant for technical users 21 + - create a service with more than 1000 accounts on it 22 + - mirror sandbox did:plcs to production 23 + 24 + ### Routine wipes 25 + 26 + As part of the sandbox, we will be doing routine wipes of all network data. 27 + 28 + We expect to perform wipes on a weekly or bi-weekly basis, though we reserve the right to do a wipe at any point. 29 + 30 + When we wipe data, we will be wiping it on all services (BGS, App View, PLC). We will also mark any existing DIDs as “invalid” & will refuse to index those accounts in the next epoch of the network to discourage users from attempting to “rollover” their accounts across wipes. 31 + 32 + # The Sandbox Network 33 + 34 + This is a parallel network to production Bluesky where we can test out the federation architecture and wire protocol. 35 + 36 + You can check out a high-level view of federation [here](https://blueskyweb.xyz/blog/5-5-2023-federation-architecture). 37 + 38 + You can dive deeper into atproto [here](https://atproto.com/docs). 39 + 40 + ## Network Services 41 + 42 + We are running three services: PLC, BGS, Bluesky App View 43 + 44 + ### PLC 45 + 46 + **Hostname:** `plc.bsky-sandbox.dev` 47 + 48 + **Code:** https://github.com/bluesky-social/did-method-plc 49 + 50 + PLC is the default DID provider for the network. DIDs are the root of your identity in the network. Sandbox PLC functions exactly the same as production PLC, but it is run as a separate service with a separate dataset. The DID resolution client in the self-hosted PDS package is set up to talk the correct PLC service. 51 + 52 + ### BGS 53 + 54 + **Hostname:** `bgs.bsky-sandbox.dev` 55 + 56 + **Code:** https://github.com/bluesky-social/indigo/tree/main/bgs 57 + 58 + BGS (Big Graph Service) is the firehose for the entire network. It collates data from PDSs & rebroadcasts them out on one giant websocket. 59 + 60 + BGS has to find out about your server somehow, so when we do any sort of write, we ping BGS with `com.atproto.sync.requestCrawl` to notify it of new data. This is done automatically in the self-hosted PDS package. 61 + 62 + If you’re familiar with the Bluesky production firehose, you can subscribe to the BGS firehose in the exact same manner, the interface & data should be identical 63 + 64 + ### Bluesky App View 65 + 66 + **Hostname:** `api.bsky-sandbox.dev` 67 + 68 + **Code:** https://github.com/bluesky-social/atproto/tree/main/packages/bsky 69 + 70 + The Bluesky App View aggregates data from across the network to service the Bluesky microblogging application. It consumes the firehose from the BGS, processing it into serviceable views of the network such as feeds, post threads, and user profiles. It functions as a fairly traditional web service. 71 + 72 + When you request a Bluesky-related view from your PDS (`getProfile` for instance), your PDS will actually proxy the request up to App View. 73 + 74 + Feel free to experiment with running your own App View if you like! 75 + 76 + # The PDS 77 + 78 + The PDS (personal data server) is where users host their social data such as posts, profiles, likes, and follows. The goal of the sandbox is to federate many PDS together, so we hope you’ll run your own. 79 + 80 + We’re not actually running a Bluesky PDS in sandbox. All of the team’s sandbox accounts are self-hosted. 81 + 82 + The PDS that you’ll be running is much of the same code that is running on the Bluesky production PDS. Notably, all of the in-pds-appview code has been torn out. You can see the actual PDS code that you’re running on the [atproto/simplify-pds](https://github.com/bluesky-social/atproto/pull/1198) branch. 83 + 84 + ### Getting started 85 + 86 + For complete instructions on getting your PDS set up, check out the [README](https://github.com/bluesky-social/pds/blob/main/README.md). 87 + 88 + To access your account, you’ll log in with the client of your choice in the exact same way that you log into production Bluesky, for instance the [Bluesky web client](https://bsky.app/). When you do so, please provide the url of *your PDS* as the service that you wish to log in to. 89 + 90 + Invites on your PDS are required by default - to generate your first invite code, please run: 91 + 92 + ```bash 93 + # PDS_HOSTNAME & PDS_ADMIN_PASSWORD both come from your pds.env file 94 + 95 + curl -X POST https://<PDS_HOSTNAME>/xrpc/com.atproto.server.createInviteCode \ 96 + -u "admin:<PDS_ADMIN_PASSWORD>" \ 97 + -H "Content-Type: application/json" \ 98 + -d '{"useCount": 1}' 99 + ``` 100 + 101 + ### Auto-updates 102 + 103 + We’ve included Watchtower in the PDS distribution. Every day at midnight PST, this will check our GitHub container registry to see if there is a new version of the PDS container & update it on your service. 104 + 105 + This will allow us to rapidly iterate on protocol changes, as we’ll be able to push them out to the network on a daily basis. 106 + 107 + When we do routine network wipes, we will be pushing out a database migration to participating PDS that wipes content and accounts. 108 + 109 + You are within your rights to disable Watchtower auto-updates, but we strongly encourage their use and will not be providing support if you decide not to run the most up-to-date PDS distribution. 110 + 111 + ## Odds & Ends & Warnings & Reminders 112 + 113 + 🧪 Experiment & have fun! 114 + 115 + 🤖 Run [feed generators](https://github.com/bluesky-social/feed-generator). They should work the exact same way as production - be sure to adjust your env to listen to Sandbox BGS! 116 + 117 + 🌈 Feel free to run your own AppView or BGS - although it’s a bit more involved & we’ll be providing limited support for this. 118 + 119 + 👤 Your PDS will provide your handle by default. Custom domain handles should work exactly the same in sandbox as they do on production Bluesky. 120 + 121 + ⚠️ If you follow the self-hosted PDS setup instructions, you’ll have private key material in your env file - be careful about sharing that! 122 + 123 + 📣 This is a sandbox version of a **public broadcast protocol** - please do not share sensitive information. 124 + 125 + 🤝 Help each other out! Respond to issues & discussions, chat in Matrix/Discord, etc.