Skip to content

gruen/pds-on-fly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDS on fly.io

For running a PDS on fly.io so you can host your own data, but not have to maintain your own servers.

Instructions

This assumes you know your way around a command line and BlueSky, generally.

  1. Pre-reqs
    1. Sign up for fly.io and install their CLI
    2. Find or buy a domain name to sacrifice (e.g., example.com)
    3. Find an e-mail or e-mail service to use (a free gmail works just fine)
  2. git clone this repo
  3. Modify fly.toml with your own app and primary_region values. (You can try to use mine, but probably won't work very well.)
  4. Set environmental variables.
    1. $ cp pds.env.example pds.env
    2. Fill in the requisite values in pds.env
  5. Launch the app
    1. $ fly launch <== create the app (make sure you picked a cool name!)
    2. $ cat pds.env | fly secrets import <== move the secrets over to the PDS host
    3. $ fly ips list <== you'll need this to get the IPv4 xxx.xxx.xxx.xxx for your DNS
  6. Sacrifice your domain name (set the A-records in your DNS, per instruction)
  7. Add certs for your domain name
    1. $ fly certs add example.com <== root domain
    2. $ fly certs add "*.example.com" <== wildcard
    3. Add CNAME record to DNS per instructions provided in the command line
    4. Wait for it (and read the docs while you wait in case something goes wrong, which it did for me because Cloudflare likes to be overly-helpful sometimes)
  8. Load example.com/xrpc/_health in a browser to see if it loads. Should show you a version number in JSON format. (Woo!)
  9. Generate an invitation
    1. Use the curl command below
    2. Hold onto the output for the next step
  10. Sign up for a new account using your custom Server in the BlueSky app
    1. Change your Hosting Provider to Custom
    2. Enter your PDS's domain name (e.g., example.com)
    3. Enter your invite code

You now have an account on your own PDS. How about that?

Generate an Invitation

Replace the ${VALUE}s (exclusive of the ${}) from your pds.env

curl \
  --fail \
  --silent \
  --show-error \
  --request POST \
  --user "admin:${PDS_ADMIN_PASSWORD}" \
  --header "Content-Type: application/json" \
  --data '{"useCount": 1}' \
  "https://${PDS_HOSTNAME}/xrpc/com.atproto.server.createInviteCode" | jq --raw-output '.code'

But, why?

Because I think all of this is very neat indeed.

About

BlueSky on Fly.io (AT Protocol)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published