Nostr-native file upload API for Cloudflare R2
Find a file
randogoth be93d74d68 Implement all modules
- store: SQLite whitelist + per-pubkey daily rate limiting
- auth: NIP-98 kind:27235 event verification via pynostr
- r2: boto3 presigned PUT URL generation for Cloudflare R2
- nostr: websocket relay subscription for kind:5392 registration events
- main: FastAPI app with NIP-96 info endpoint and upload request endpoint

Also moves package to src/ layout (required by uv_build) and pins
Python to 3.12 for coincurve wheel availability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 17:33:40 +03:00
src/jirorian Implement all modules 2026-06-07 17:33:40 +03:00
.gitignore Implement all modules 2026-06-07 17:33:40 +03:00
.python-version Implement all modules 2026-06-07 17:33:40 +03:00
flake.nix Initial scaffold for jirorian 2026-06-07 17:28:06 +03:00
pyproject.toml Initial scaffold for jirorian 2026-06-07 17:28:06 +03:00
README.md Add minimal README 2026-06-07 17:28:51 +03:00
uv.lock Initial scaffold for jirorian 2026-06-07 17:28:06 +03:00

jirorian

Nostr-native image upload API for Cloudflare R2.

Authenticates requests via NIP-98, issues presigned R2 PUT URLs, and manages access via a custom Nostr registration event (kind 5392). NIP-96 compliant.

Requirements

  • Cloudflare R2 bucket with public CDN URL
  • A Nostr keypair for the service identity
  • A Nostr relay

Configuration

All configuration is via environment variables:

Variable Description
R2_ENDPOINT https://<account_id>.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID R2 access key
R2_SECRET_ACCESS_KEY R2 secret key
R2_BUCKET_NAME Target bucket
R2_CDN_URL Public CDN base URL
SERVICE_NOSTR_PRIVKEY Service Nostr private key (hex)
SERVICE_RELAY_URL Relay to subscribe to for registrations
JIRORIAN_DB SQLite DB path (default: jirorian.db)

Development

nix develop   # enter dev shell with uv + virtualenv
uv run fastapi dev jirorian/main.py

Deployment

Packaged as a Nix flake, consumed by the NixOS host configuration as a flake input.