Pubky Homeserver
A homeserver for Pubky. Stores and serves user data via HTTP APIs with public-key authentication.
For standalone deployment, see the install guide.
Development
Run the homeserver directly from the source tree:
See config.sample.toml for all configuration options.
API Specifications
- Client API — user authentication, tenant storage, and event feeds.
- Admin API — homeserver administration and WebDAV operations.
Architecture
- PKARR republishing — cache-first resolution, network fallback, and retry behavior.
Library Usage
Use the homeserver as a library in other crates or for testing.
[]
= "0.x" # replace with the latest version
HomeserverApp starts the full server stack (client server, admin server, metrics server, DHT republishers):
use HomeserverApp;
use PathBuf;
async
For testing, use MockDataDir to create a temporary directory that is cleaned up on drop. Enable the testing feature:
[]
= { = "0.x", = ["testing"] }
use ;
let config = default_test_config;
let mock_dir = new.unwrap;
let app = start_with_mock_data_dir.await.unwrap;
Binary
See Install and Run Pubky Homeserver for full setup instructions.
Storage
/pub/ is public; /priv/ requires an authenticated session and a covering
capability. See Private Storage for the full contract.
Caching and Proxies
Tenant-private responses must never be stored by shared caches. /priv/...
data responses and /events-stream use Cache-Control: no-store and vary on
pubky-host, Authorization, and Cookie; /pub/... file validators keep
their existing tenant-aware caching behavior.
Note: CORS preflight OPTIONS is
handled upstream by the CORS layer and carries no private body.