commit 03d504ce0607974fb2c5431cfc7f28fc0b9801ae Author: Aykhan Shahsuvarov Date: Sat Apr 26 23:50:45 2025 +0400 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c9114ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.sqlite +*.sqlite-* +pds.env \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8361ca --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +sed -i "s/PDS_JWT_SECRET=/PDS_JWT_SECRET=$(openssl rand --hex 16)/" pds.env +sed -i "s/PDS_ADMIN_PASSWORD=/PDS_ADMIN_PASSWORD=$(openssl rand --hex 16)/" pds.env +sed -i "s/PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=/PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32)/" pds.env \ No newline at end of file diff --git a/caddy/etc/caddy/Caddyfile b/caddy/etc/caddy/Caddyfile new file mode 100644 index 0000000..e5e60f7 --- /dev/null +++ b/caddy/etc/caddy/Caddyfile @@ -0,0 +1,12 @@ +{ + on_demand_tls { + ask http://pds:3000/tls-check + } +} + +*.{$PDS_HOSTNAME}, {$PDS_HOSTNAME} { + tls { + on_demand + } + reverse_proxy http://pds:3000 +} diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..8bb3a80 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,33 @@ +services: + caddy: + container_name: caddy + image: caddy:2 + networks: + - bsky-pds + ports: + - "80:80" + - "443:443" + - "443:443/udp" + depends_on: + - pds + restart: unless-stopped + volumes: + - ./caddy/data:/data + - ./caddy/etc/caddy:/etc/caddy + env_file: + - ./pds.env + + pds: + container_name: pds + image: ghcr.io/bluesky-social/pds:0.4 + restart: unless-stopped + networks: + - bsky-pds + volumes: + - ./:/pds + env_file: + - ./pds.env + +networks: + bsky-pds: + external: false \ No newline at end of file diff --git a/pds.env.example b/pds.env.example new file mode 100644 index 0000000..0a3fe58 --- /dev/null +++ b/pds.env.example @@ -0,0 +1,17 @@ +PDS_HOSTNAME= +PDS_JWT_SECRET= +PDS_ADMIN_PASSWORD= +PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX= +PDS_EMAIL_SMTP_URL= +PDS_EMAIL_FROM_ADDRESS= + +PDS_DATA_DIRECTORY=/pds +PDS_BLOBSTORE_DISK_LOCATION=/pds/blocks +PDS_BLOB_UPLOAD_LIMIT=52428800 +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 \ No newline at end of file