Mirror from bluesky-social/pds

README and compose.yaml updates

+61 -35
+55 -33
README.md
··· 125 125 ### Set up the PDS directory 126 126 127 127 ```bash 128 - # Create the directory where all PDS data will be stored. 129 128 sudo mkdir /data 130 - 131 - # Create the required caddy webserver directories. 132 - sudo mkdir --parents /data/caddy/{etc,data} 129 + sudo mkdir --parents /data/caddy/etc 130 + sudo mkdir --parents /data/caddy/data 133 131 ``` 134 132 135 - ### Start the PDS containers 136 - 137 - #### Download the Docker compose file 138 - 139 - Download the `sqlite-compose.yaml` to run your PDS with a local SQLite database. 133 + ### Create the Caddyfile 140 134 141 135 ```bash 142 - curl https://raw.githubusercontent.com/bluesky-social/pds/main/sqlite-compose.yaml >compose.yaml 136 + cat <<CADDYFILE >/data/caddy/etc/caddy/Caddyfile 137 + { 138 + email you@example.com 139 + } 140 + 141 + *.example.com, example.com { 142 + reverse_proxy http://localhost:3000 143 + } 144 + CADDYFILE 143 145 ``` 144 146 145 - Or, download the `postgres-compose.yaml` to run your PDS with a remote PostgreSQL database. 147 + ### Create the PDS env configuration file 146 148 147 149 ```bash 148 - curl https://raw.githubusercontent.com/bluesky-social/pds/main/postgres-compose.yaml >compose.yaml 150 + cat <<PDS_CONFIG >/data/pds.env 151 + PDS_HOSTNAME=example.com 152 + PDS_DB_SQLITE_LOCATION=/data/pds.sqlite 153 + PDS_JWT_SECRET=<VALUE> 154 + PDS_ADMIN_PASSWORD=<VALUE> 155 + PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX=<VALUE> 156 + PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=<VALUE> 157 + PDS_BLOBSTORE_DISK_LOCATION=/data/blocks 158 + PDS_DID_PLC_URL=https://plc.bsky-sandbox.dev 159 + PDS_BSKY_APP_VIEW_ENDPOINT=https://api.bsky-sandbox.dev 160 + PDS_BSKY_APP_VIEW_DID=did:web:api.bsky-sandbox.dev 161 + PDS_CRAWLERS=https://bgs.bsky-sandbox.dev 162 + PDS_CONFIG 149 163 ``` 150 164 151 - 152 - #### Generate keys 165 + ## Generating K256 private keys 153 166 154 167 Your PDS will need two secp256k1 private keys provided as hex strings. You can securely generate these keys using `openssl` with the following command: 155 168 ```bash ··· 158 171 159 172 This will output a 64-char hex string. Please generate two keys in preperation for the next step. 160 173 161 - #### Edit your compose.yaml file 162 - 163 - You will need to customize various settings configured through the PDS environment variables. See the below table to find the variables you'll need to set. 174 + ### Start the PDS containers 164 175 165 - | Environment Variable | Value | Should update? | Notes | 166 - | ----------------------------------------- | --------------------------------------------- | -------------- |------ | 167 - | PDS_HOSTNAME | example.com | ✅ | Public domain you intend to deploy your service at | 168 - | PDS_DB_SQLITE_LOCATION | pds.sqlite | ✅ | Or use `PDS_DB_POSTGRES_URL` depending on which database you intend to use | 169 - | PDS_JWT_SECRET | jwt-secret | ✅ | Use a secure high-entropy string | 170 - | PDS_ADMIN_PASSWORD | admin-pass | ✅ | Use a secure high-entropy string | 171 - | PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX | 3ee68... | ✅ | See above Generate Keys section - once set, do not change | 172 - | PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX | e049f... | ✅ | See above Generate Keys section - once set, do not change | 173 - | LOG_ENABLED | true | ❔ | Outputs structured logs to stdout | 174 - | PDS_BLOBSTORE_DISK_LOCATION | blobs | ❌ | Only update if you update the mounted volume for your docker image as well | 175 - | PDS_DID_PLC_URL | plc.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 176 - | PDS_BSKY_APP_VIEW_ENDPOINT | api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 177 - | PDS_BSKY_APP_VIEW_DID | did:web:api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 178 - | PDS_CRAWLERS | bgs.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 176 + #### Download the Docker compose file 179 177 180 - There are additional environment variables that can be tweaked depending on how you're running your service. For instance, storing blobs in AWS S3, keys in AWS KMS, or setting up an email service. 178 + Download the `compose.yaml` to run your PDS with the require "sidecar" containers. 181 179 182 - Feel free to explore those [Here](https://github.com/bluesky-social/atproto/blob/simplify-pds/packages/pds/src/config/env.ts). However, we will not be providing support for more advanced configurations. 180 + ```bash 181 + curl https://raw.githubusercontent.com/bluesky-social/pds/main/sqlite-compose.yaml >compose.yaml 182 + ``` 183 183 184 184 185 185 #### Run docker compose ··· 215 215 1. Download the Bluesky app 216 216 1. Enter the URL of your PDS (e.g. `https://example.com/`) 217 217 1. Create an account 218 + 219 + ## PDS environment variables 220 + 221 + You will need to customize various settings configured through the PDS environment variables. See the below table to find the variables you'll need to set. 222 + 223 + | Environment Variable | Value | Should update? | Notes | 224 + | ----------------------------------------- | --------------------------------------------- | -------------- |------ | 225 + | PDS_HOSTNAME | example.com | ✅ | Public domain you intend to deploy your service at | 226 + | PDS_DB_SQLITE_LOCATION | pds.sqlite | ✅ | Or use `PDS_DB_POSTGRES_URL` depending on which database you intend to use | 227 + | PDS_JWT_SECRET | jwt-secret | ✅ | Use a secure high-entropy string that is 32 characters in length | 228 + | PDS_ADMIN_PASSWORD | admin-pass | ✅ | Use a secure high-entropy string that is 32 characters in length | 229 + | PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX | 3ee68... | ✅ | See above Generate Keys section - once set, do not change | 230 + | PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX | e049f... | ✅ | See above Generate Keys section - once set, do not change | 231 + | PDS_BLOBSTORE_DISK_LOCATION | blobs | ❌ | Only update if you update the mounted volume for your docker image as well | 232 + | PDS_DID_PLC_URL | https://plc.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 233 + | PDS_BSKY_APP_VIEW_URL | https://api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 234 + | PDS_BSKY_APP_VIEW_DID | did:web:api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 235 + | PDS_CRAWLERS | https://bgs.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox | 236 + 237 + There are additional environment variables that can be tweaked depending on how you're running your service. For instance, storing blobs in AWS S3, keys in AWS KMS, or setting up an email service. 238 + 239 + Feel free to explore those [Here](https://github.com/bluesky-social/atproto/blob/simplify-pds/packages/pds/src/config/env.ts). However, we will not be providing support for more advanced configurations.
+6 -2
compose.yaml
··· 8 8 - pds 9 9 restart: unless-stopped 10 10 volumes: 11 - - /data/caddy/data:/data 12 - - /data/caddy/etc/caddy:/etc/caddy 11 + - type: bind 12 + source: /data/caddy 13 + target: /data 14 + - type: bind 15 + source: /data/caddy/etc/caddy 16 + target: /etc/caddy 13 17 pds: 14 18 container_name: pds 15 19 image: ghcr.io/bluesky-social/pds:latest