this repo has no description

Nice things that make the repo a little more legit

lewis 204df9d8 30e791e3

+28
Dockerfile
··· 1 + FROM rust:1.91.1-alpine AS builder 2 + 3 + RUN apk add ca-certificates openssl openssl-dev pkgconfig 4 + 5 + WORKDIR /app 6 + 7 + COPY Cargo.toml Cargo.lock ./ 8 + RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release && rm -rf src 9 + 10 + COPY src ./src 11 + COPY tests ./tests 12 + COPY migrations ./migrations 13 + COPY .sqlx ./.sqlx 14 + RUN touch src/main.rs && cargo build --release 15 + 16 + FROM alpine:3.23 17 + 18 + COPY --from=builder /app/target/release/bspds /usr/local/bin/bspds 19 + COPY --from=builder /app/migrations /app/migrations 20 + 21 + WORKDIR /app 22 + 23 + ENV SERVER_HOST=0.0.0.0 24 + ENV SERVER_PORT=3000 25 + 26 + EXPOSE 3000 27 + 28 + CMD ["bspds"]
+75
README.md
··· 1 + # Lewis' BS PDS Sandbox 2 + 3 + When I'm actually done then yeah let's make this into a proper official-looking repo perhaps under an official-looking account or something. 4 + 5 + This project implements a Personal Data Server (PDS) implementation for the AT Protocol. 6 + 7 + Uses PostgreSQL instead of SQLite, S3-compatible blob storage, and aims to be a complete drop-in replacement for Bluesky's reference PDS implementation. 8 + 9 + In fact I aim to also implement a plugin system soon, so that we can add things onto our own PDSes on top of the default BS. 10 + 11 + I'm also taking ideas on what other PDSes lack, such as an on-PDS webpage that users can access to manage their records and preferences. 12 + 13 + :3 14 + 15 + # Running locally 16 + 17 + The reader will need rust installed locally. 18 + 19 + I personally run the postgres db, and an S3-compatible object store with podman compose up db objsto -d. 20 + 21 + Run the PDS directly: 22 + 23 + just run 24 + 25 + Configuration is via environment variables: 26 + 27 + DATABASE_URL postgres connection string 28 + S3_BUCKET blob storage bucket name 29 + S3_ENDPOINT S3 endpoint URL (for MinIO etc) 30 + AWS_ACCESS_KEY_ID S3 credentials 31 + AWS_SECRET_ACCESS_KEY 32 + AWS_REGION 33 + PDS_HOSTNAME public hostname of this PDS 34 + APPVIEW_URL appview to proxy unimplemented endpoints to 35 + RELAYS comma-separated list of relay WebSocket URLs 36 + 37 + Optional email stuff: 38 + 39 + MAIL_FROM_ADDRESS sender address (enables email notifications) 40 + MAIL_FROM_NAME sender name (default: BSPDS) 41 + SENDMAIL_PATH path to sendmail binary 42 + 43 + Development 44 + 45 + just shows available commands 46 + just test run tests (spins up postgres and minio via testcontainers) 47 + just lint clippy + fmt check 48 + just db-reset drop and recreate local database 49 + 50 + The test suite uses testcontainers so you don't need to set up anything manually for running tests. 51 + 52 + ## What's implemented 53 + 54 + Most of the com.atproto.* namespace is done. Server endpoints, repo operations, sync, identity, admin, moderation. The firehose websocket works. OAuth is not done yet. 55 + 56 + See TODO.md for the full breakdown of what's done and what's left. 57 + 58 + Structure 59 + 60 + src/ 61 + main.rs server entrypoint 62 + lib.rs router setup 63 + state.rs app state (db pool, stores) 64 + api/ XRPC handlers organized by namespace 65 + auth/ JWT handling 66 + repo/ postgres block store 67 + storage/ S3 blob storage 68 + sync/ firehose, relay clients 69 + notifications/ email service 70 + tests/ integration tests 71 + migrations/ sqlx migrations 72 + 73 + License 74 + 75 + idk
+2 -7
docker-compose.yaml
··· 6 6 image: bspds 7 7 ports: 8 8 - "3000:3000" 9 + env_file: 10 + - ./.env 9 11 environment: 10 - SERVER_HOST: 0.0.0.0 11 - SERVER_PORT: 3000 12 12 DATABASE_URL: postgres://postgres:postgres@db:5432/pds 13 13 S3_ENDPOINT: http://objsto:9000 14 - AWS_REGION: us-east-1 15 - S3_BUCKET: pds-blobs 16 - AWS_ACCESS_KEY_ID: minioadmin 17 - AWS_SECRET_ACCESS_KEY: minioadmin 18 - PDS_HOSTNAME: localhost:3000 19 14 depends_on: 20 15 - db 21 16 - objsto
+61 -2
justfile
··· 1 - # Run all tests 1 + default: 2 + @just --list 3 + 4 + run: 5 + cargo run 6 + 7 + run-release: 8 + cargo run --release 9 + 10 + build: 11 + cargo build 12 + 13 + build-release: 14 + cargo build --release 15 + 16 + check: 17 + cargo check 18 + 19 + clippy: 20 + cargo clippy -- -D warnings 21 + 22 + fmt: 23 + cargo fmt 24 + 25 + fmt-check: 26 + cargo fmt -- --check 27 + 28 + lint: fmt-check clippy 29 + 2 30 test: 3 31 cargo test 4 32 5 - # Run specific test suites if needed 33 + test-verbose: 34 + cargo test -- --nocapture 35 + 6 36 test-repo: 7 37 cargo test --test repo 8 38 ··· 23 53 24 54 test-auth: 25 55 cargo test --test auth 56 + 57 + clean: 58 + cargo clean 59 + 60 + doc: 61 + cargo doc --open 62 + 63 + db-create: 64 + DATABASE_URL="postgres://postgres:postgres@localhost:5432/pds" sqlx database create 65 + 66 + db-migrate: 67 + DATABASE_URL="postgres://postgres:postgres@localhost:5432/pds" sqlx migrate run 68 + 69 + db-reset: 70 + DATABASE_URL="postgres://postgres:postgres@localhost:5432/pds" sqlx database drop -y 71 + DATABASE_URL="postgres://postgres:postgres@localhost:5432/pds" sqlx database create 72 + DATABASE_URL="postgres://postgres:postgres@localhost:5432/pds" sqlx migrate run 73 + 74 + docker-up: 75 + docker compose up -d 76 + 77 + docker-down: 78 + docker compose down 79 + 80 + docker-logs: 81 + docker compose logs -f 82 + 83 + docker-build: 84 + docker compose build