Nostr-native moderation service implementing DTSP-aligned content labeling and CDN enforcement.
✅ KV Storage + Admin APIs - Secure rule management with audit logging
✅ Media Passthrough + Geoblocks - 451/410 responses with professional HTML templates
✅ NIP-07 Labeler UI - Sign and publish kind:1985 labels via browser wallet
✅ Label→CDN Hook - Process labels and trigger enforcement actions
✅ DMCA/Counter-Notice Forms - Legal compliance intake with validation
✅ Tests + CI - Comprehensive test suite with GitHub Actions
# Install dependencies
npm install
# Run tests
npm test
# Start local development
npm run dev
# Deploy to Cloudflare
npm run deploy:staging
npm run deploy:production┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Labeler UI │────▶│ Nostr Relay │◀────│ Reporters │
└─────────────┘ └──────────────┘ └─────────────┘
│ │ │
kind:1985 kind:1985 kind:1984
│ │ │
└────────────────────┼─────────────────────┘
│
┌──────▼──────┐
│ Label Hook │
│ (Processor) │
└──────┬──────┘
│
┌──────▼──────┐
│ CDN Worker │
│ (/admin API) │
└──────┬──────┘
│
┌──────▼──────┐
│ KV Store │
│ (Rules DB) │
└──────────────┘
curl -X POST https://divine.video/admin/block \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "video123",
"paths": ["/v/video123", "/t/video123"],
"countries": ["US", "CA"],
"reason": "copyright",
"ttl": 86400
}'curl -X POST https://divine.video/admin/takedown \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "video456",
"paths": ["/v/video456"],
"reason": "policy_violation"
}'curl -X POST https://divine.video/admin/unblock \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "video123"}'AUTH_TOKEN: Bearer token for admin API authenticationORIGIN_URL: Upstream media origin for passthroughRULES: KV namespace binding (auto-configured by Wrangler)
- Create KV namespace:
wrangler kv:namespace create RULES - Update namespace ID in
wrangler.toml - Set secrets:
wrangler secret put AUTH_TOKEN - Deploy:
npm run deploy:production
- NIP-07 wallet integration
- DTSP category selection
- Action/severity/location tags
- Evidence URL support
- Preset configurations
- Legal compliance form
- Required attestations
- Electronic signature
- Audit trail
- Contest false claims
- Timeline expectations
- Risk acknowledgment
- Legal jurisdiction consent
# Run all tests
npm test
# Run specific test suite
npm run test:rules
# Watch logs in production
npm run tail- Automatic testing on push/PR
- Preview deployments for PRs
- Production deployment on main branch merge
# Deploy to staging
npm run deploy:staging
# Deploy to production (requires confirmation)
npm run deploy:production- Admin endpoints require bearer token authentication
- All actions logged for audit trail
- Personal information handling compliant with privacy laws
- Rate limiting via Cloudflare
- Input validation on all endpoints
Private - Copyright divine.video