Skip to content

fix: use configured resolver and handle-domain behavior in rsky-pds#165

Open
rabble wants to merge 8 commits intoblacksky-algorithms:mainfrom
rabble:fix/s3-bucket-and-did-resolution
Open

fix: use configured resolver and handle-domain behavior in rsky-pds#165
rabble wants to merge 8 commits intoblacksky-algorithms:mainfrom
rabble:fix/s3-bucket-and-did-resolution

Conversation

@rabble
Copy link
Copy Markdown

@rabble rabble commented Mar 20, 2026

Summary

  • build rsky-pds from the fork workspace so the image includes forked crate changes instead of only copying rsky-pds/src
  • use the configured identity resolver timeout, cache settings, and native root certificates for PLC DID lookups
  • validate service handles against PDS_SERVICE_HANDLE_DOMAINS while still requiring direct user handles under the configured domain
  • keep the self-hosted S3 bucket and PLC DID URL fixes in the same branch

Test Plan

  • cargo test -p rsky-pds tests::build_id_resolver_uses_identity_config_timeout_and_cache_ttls --lib -- --exact --nocapture
  • cargo test -p rsky-pds apis::com::atproto::server::tests::validate_handle_uses_service_domains_when_present --lib -- --exact --nocapture
  • cargo test -p rsky-pds apis::com::atproto::server::tests::validate_handle_falls_back_to_hostname_without_service_domains --lib -- --exact --nocapture

rabble and others added 4 commits March 21, 2026 09:58
Two fixes for deploying rsky-pds on standard S3-compatible storage:

1. S3BlobStore: Use configurable bucket name via PDS_BLOBSTORE_S3_BUCKET env var
   instead of using the actor DID as the S3 bucket name. DIDs contain colons
   which are invalid in bucket names on AWS S3, GCS, and most S3-compatible
   providers. The DID is still used as a path prefix within the bucket.
   Falls back to the DID for backwards compatibility.

2. PLC DID resolution: Remove encode_uri_component() from DID URL construction.
   DIDs (e.g., did:plc:abc123) are valid URL path segments and should not be
   percent-encoded. The encoding turns colons into %3A, causing 404s from
   plc.directory (e.g., /did%3Aplc%3Aabc123 instead of /did:plc:abc123).
   This affected both rsky-identity's PLC resolver and rsky-pds's PLC client.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hickory-dns (formerly trust-dns) does its own DNS resolution instead of
using the system resolver. In Kubernetes environments, pods rely on
kube-dns via /etc/resolv.conf, and hickory-dns doesn't always correctly
follow the cluster's DNS configuration.

This was causing DID resolution to fail with "error sending request"
even though the system resolver, curl, and openssl all work correctly
from inside the same container.

Switching to the default system DNS resolver (via libc) fixes DID
resolution in containerized deployments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lution

The webpki-roots bundle may not include all CAs needed for plc.directory
(which uses Amazon Root CA). Switching to native-roots uses the system's
CA store (/etc/ssl/certs) which includes all necessary CAs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rabble rabble changed the title fix: S3 bucket naming and DID URL encoding for self-hosted deployments fix: use forked identity resolver config in rsky-pds Mar 20, 2026
@rabble rabble changed the title fix: use forked identity resolver config in rsky-pds fix: use configured resolver and handle-domain behavior in rsky-pds Mar 20, 2026
rabble and others added 3 commits March 21, 2026 12:08
rustls-tls-webpki-roots failed to resolve DIDs from plc.directory,
and rustls-tls-native-roots caused the server to hang on startup.
Using native-tls (OpenSSL-based) which is the most compatible option
for containerized deployments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the ASCII art root page with a proper HTML page that:
- Shows PDS info and available XRPC endpoints
- Provides a mini query app to look up accounts by DID or handle
- Lists posts for any account hosted on this PDS
- Uses dark theme with ATProto branding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant