atproto pds in zig pds.zat.dev
pds atproto
24

Configure Feed

Select the types of activity you want to include in your feed.

Support env port and database config

zzstoatzz (Jun 10, 2026, 2:23 PM -0500) f6e078a3 85fb9113

+25 -8
+2 -2
Dockerfile
··· 7 7 && rm -rf /var/lib/apt/lists/* 8 8 9 9 ARG ZIG_VERSION=0.16.0 10 - ARG ZDS_VERSION=0.0.2 10 + ARG ZDS_VERSION=0.0.3 11 11 ARG BUILDARCH 12 12 ARG TARGETARCH=amd64 13 13 RUN set -eux; \ ··· 51 51 ENV ZDS_DB=/data/zds.sqlite3 52 52 53 53 EXPOSE 2583 54 - CMD ["zds", "--host", "0.0.0.0", "--port", "2583", "--db", "/data/zds.sqlite3"] 54 + CMD ["zds"]
+5 -3
README.md
··· 68 68 ```sh 69 69 ZDS_RESEND_API_KEY=... \ 70 70 ZDS_EMAIL_FROM='ZDS <pds@example.com>' \ 71 + ZDS_HOST=0.0.0.0 \ 72 + ZDS_PORT=2583 \ 73 + ZDS_DB=/var/lib/zds/zds.sqlite3 \ 71 74 ZDS_BLOB_UPLOAD_LIMIT=100000000 \ 72 75 ZDS_BLOBSTORE_PATH=/var/lib/zds/blobs \ 73 76 ZDS_HANDLE_DOMAINS='.example.com,example.com' \ ··· 78 81 ZDS_ADMIN_TOKEN='another-random-secret' \ 79 82 ZDS_INVITE_REQUIRED=true \ 80 83 zig build run -- \ 81 - --port 2583 \ 82 - --db /var/lib/zds/zds.sqlite3 \ 83 84 --public-url https://pds.example.com \ 84 85 --server-did did:web:pds.example.com 85 86 ``` ··· 100 101 -e ZDS_PUBLIC_URL=https://pds.example.com \ 101 102 -e ZDS_SERVER_DID=did:web:pds.example.com \ 102 103 -e ZDS_JWT_SECRET='at-least-32-random-bytes-here' \ 104 + -e ZDS_DB=/data/zds.sqlite3 \ 103 105 atcr.io/zat.dev/zds:latest 104 106 ``` 105 107 ··· 109 111 just docker-publish 110 112 just docker-publish v0.1.0 111 113 just docker-publish-current 112 - just docker-publish-release v0.0.2 114 + just docker-publish-release v0.0.3 113 115 ``` 114 116 115 117 </details>
+1 -1
build.zig
··· 3 3 pub fn build(b: *std.Build) void { 4 4 const target = b.standardTargetOptions(.{}); 5 5 const optimize = b.standardOptimizeOption(.{}); 6 - const version = b.option([]const u8, "version", "Build version reported by /xrpc/_health") orelse "0.0.2"; 6 + const version = b.option([]const u8, "version", "Build version reported by /xrpc/_health") orelse "0.0.3"; 7 7 8 8 const zat = b.dependency("zat", .{ 9 9 .target = target,
+1 -1
build.zig.zon
··· 1 1 .{ 2 2 .name = .zds, 3 - .version = "0.0.2", 3 + .version = "0.0.3", 4 4 .fingerprint = 0x6ebabab1f62e1904, 5 5 .minimum_zig_version = "0.16.0", 6 6 .dependencies = .{
+7 -1
docs/operations.md
··· 61 61 62 62 - `ZDS_PUBLIC_URL`: public PDS origin. 63 63 - `ZDS_SERVER_DID`: PDS service DID, usually `did:web:<host>`. 64 + - `ZDS_HOST`: bind address. Default: `127.0.0.1`, or `0.0.0.0` in the 65 + container image. 66 + - `ZDS_PORT`: bind port. Default: `2583`. 67 + - `ZDS_DB`: SQLite database path. Default: `dev/zds.sqlite3`, or 68 + `/data/zds.sqlite3` in the container image. `ZDS_DB_PATH` is accepted as a 69 + compatibility alias when `ZDS_DB` is unset. 64 70 - `ZDS_PLC_ROTATION_KEY`: PDS rotation authority private key. Accepts the 65 71 official PDS 32-byte secp256k1 hex form and the private multikey form emitted 66 72 by PDS Moover. New `did:plc` accounts use this as the PDS rotation authority. ··· 127 133 just docker-publish 128 134 just docker-publish v0.1.0 129 135 just docker-publish-current 130 - just docker-publish-release v0.0.2 136 + just docker-publish-release v0.0.3 131 137 ``` 132 138 133 139 ## releases
+1
fly.toml
··· 6 6 7 7 [env] 8 8 ZDS_HOST = "0.0.0.0" 9 + ZDS_PORT = "2583" 9 10 ZDS_DB = "/data/zds.sqlite3" 10 11 ZDS_PUBLIC_URL = "https://pds.zat.dev" 11 12 ZDS_SERVER_DID = "did:web:pds.zat.dev"
+8
src/internal/cli.zig
··· 54 54 pub fn parse(init: std.process.Init) ParseError!Options { 55 55 var options = Options{ 56 56 .host = env("ZDS_HOST") orelse "127.0.0.1", 57 + .port = try envU16("ZDS_PORT") orelse 2583, 58 + .db_path = env("ZDS_DB") orelse env("ZDS_DB_PATH") orelse "dev/zds.sqlite3", 57 59 .public_url = env("ZDS_PUBLIC_URL"), 58 60 .server_did = env("ZDS_SERVER_DID"), 59 61 .plc_directory = env("ZDS_PLC_DIRECTORY"), ··· 99 101 \\ [--log-level error|info|debug] [--debug] 100 102 \\ 101 103 \\Runs a local PDS-shaped HTTP server. 104 + \\Environment defaults use ZDS_HOST, ZDS_PORT, and ZDS_DB. 102 105 \\DOMAINS is a comma-separated list such as ".example.com,example.com". 103 106 \\URLS is a comma-separated crawler list, defaulting to bsky.network and vsky.network. 104 107 \\ ··· 248 251 fn envUsize(name: [*:0]const u8) !?usize { 249 252 const value = env(name) orelse return null; 250 253 return try std.fmt.parseInt(usize, value, 10); 254 + } 255 + 256 + fn envU16(name: [*:0]const u8) !?u16 { 257 + const value = env(name) orelse return null; 258 + return try std.fmt.parseInt(u16, value, 10); 251 259 } 252 260 253 261 fn envBool(name: [*:0]const u8) bool {