Skip to content

divinevideo/divine-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Divine Router

Fastly Compute@Edge router for wildcard subdomain routing on Divine Video.

This is the public edge, not the ArgoCD-managed GKE stack. Production ATProto rollout depends on this service being published separately from divine-iac-coreconfig.

Overview

This edge router handles incoming requests to *.divine.video and *.dvines.org, routing them based on the subdomain:

  • Apex domains (divine.video, dvines.org) → passthrough to origin
  • System subdomains (www, api, cdn, admin, etc.) → passthrough to origin
  • Username subdomains (alice.divine.video) → profile lookup and redirect

Features

  • Username routing: Routes username.divine.video to user profiles
  • NIP-05 support: Serves /.well-known/nostr.json for Nostr identity verification
  • KV-backed lookups: Username data stored in Fastly KV Store
  • System subdomain passthrough: Reserves common subdomains for services

NIP-05 Verification

Requests to username.divine.video/.well-known/nostr.json return NIP-05 responses:

{
  "names": {
    "username": "pubkey-hex"
  },
  "relays": {
    "pubkey-hex": ["wss://relay.example.com"]
  }
}

Development

Prerequisites

Local Development

fastly compute serve

Deploy

fastly compute publish --non-interactive && fastly purge --all

Deploy this after the public handle state has been published by divine-name-server, because it reads Fastly KV to serve /.well-known/atproto-did.

Configuration

Username data is stored in the usernames KV store with this structure:

{
  "pubkey": "hex-encoded-pubkey",
  "relays": ["wss://relay1.example.com"],
  "status": "active"
}

System Subdomains

Reserved subdomains that passthrough to origin:

  • www, api, cdn, admin, support, relay
  • analytics, blossom, funnel, stream, media, gateway

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages