Need to run BlueSky's PDS container with an existing website? 

File `Caddyfile`

(forward) {
        reverse_proxy {
                to INSERT_IP_HERE:{args.0}
                lb_policy least_conn
                # Overwrite header
                header_up "X-Real-Host" "{host}"
                transport http {
                        keepalive 15m
                        keepalive_interval 15s
                        keepalive_idle_conns 128
                        keepalive_idle_conns_per_host 32
                }
        }
}

# Bluesky PDS
(pds) {
        handle /xrpc/* {
                import forward {args.0}
        }
        handle /.well-known/atproto {
                import forward {args.0}
        }
}

gpmidi.net {
        route {
                import pds 3004

                redir https://www.{host}{uri}
        }
}

www.gpmidi.net {
        import pds 3004

        import lh_forward "8322" "{host}"
}

File `docker-compose.yaml`

Key

Note: The environment variable `PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX` will need to be replaced with the results from the command below. It may generate more than one line of output. If so, join all lines and remove any white space. 

openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols=32

File

version: "3"

services:
  yourmom-xxx:
    image: ghcr.io/bluesky-social/pds:latest
    restart: unless-stopped
    volumes:
      - type: bind
        source: /opt/pds/data/yourmom.xxx
        target: /pds
        bind:
          selinux: "Z"
    env_file:
      - /opt/pds/pds.env
    ports:
      - "192.168.122.1:3002:3000"
    environment:
      PDS_HOSTNAME: "yourmom.xxx"
      PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: "LONG_RANDOM_PASSWORD"
      PDS_JWT_SECRET: "LONG_RANDOM_PASSWORD"

  yourdad-xxx:
    image: ghcr.io/bluesky-social/pds:latest
    restart: unless-stopped
    volumes:
      - type: bind
        source: /opt/pds/data/yourdad.xxx
        target: /pds
        bind:
          selinux: "Z"
    env_file:
      - /opt/pds/pds.env
    ports:
      - "192.168.122.1:3003:3000"
    environment:
      PDS_HOSTNAME: "yourdad.xxx"
      PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: "LONG_RANDOM_PASSWORD"
      PDS_JWT_SECRET: "LONG_RANDOM_PASSWORD"

  gpmidi-net:
    image: ghcr.io/bluesky-social/pds:latest
    restart: unless-stopped
    volumes:
      - type: bind
        source: /opt/pds/data/gpmidi.net
        target: /pds
        bind:
          selinux: "Z"
    env_file:
      - /opt/pds/pds.env
    ports:
      - "192.168.122.1:3004:3000"
    environment:
      PDS_HOSTNAME: "gpmidi.net"
      PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: "LONG_RANDOM_PASSWORD"
      PDS_JWT_SECRET: "LONG_RANDOM_PASSWORD"

File `pds.env`

PDS_PORT=3000
PDS_ADMIN_PASSWORD=LONG_RANDOM_PASSWORD
PDS_ADMIN_EMAIL=paul@gpmidi.net
PDS_DATA_DIRECTORY=/pds
PDS_BLOBSTORE_DISK_LOCATION=/pds/blocks
PDS_BLOB_UPLOAD_LIMIT=536870912
PDS_DID_PLC_URL="https://plc.directory"
PDS_BSKY_APP_VIEW_URL="https://api.bsky.app"
PDS_BSKY_APP_VIEW_DID="did:web:api.bsky.app"
PDS_REPORT_SERVICE_URL="https://mod.bsky.app"
PDS_REPORT_SERVICE_DID="did:plc:ar7c4by46qjdydhdevvrndac"
PDS_CRAWLERS="https://bsky.network"
LOG_ENABLED=true
PDS_EMAIL_SMTP_URL=smtps://smtp-relay.gmail.com:465/
PDS_EMAIL_FROM_ADDRESS=paul@gpmidi.net

Tags