e8d9b1fd42
Add complete token system with Plex/Tautulli/Overseer integration: - Anchor program for SPL token mint/burn/transfer - Express backend with OAuth, webhooks, Solana integration - Next.js frontend with dashboard, admin panel, wallet management - Docker deployment for 172.20.1.0/24 infrastructure - Production configs with SSL, Nginx, health monitoring Tautulli webhooks auto-mint on watch events. Overseer integration burns for content requests.
5.0 KiB
5.0 KiB
CoopCredits Infrastructure Configuration Summary
Your Server Infrastructure
| Service | IP Address | Port | Integration Role |
|---|---|---|---|
| Plex | 172.20.1.220 | 32400 | User authentication, content |
| Overseer | 172.20.1.225 | 5055 | Content requests, $COOP spend |
| Tautulli | 172.20.1.255 | 8181 | Watch tracking, $COOP earn |
| Website | coop.hobokenchicken.com | 443 | User dashboard, admin panel |
Files Created/Updated
Configuration Files
.env.production- Production environment templatedocker-compose.prod.yml- Production Docker orchestrationdocker/nginx/nginx.prod.conf- Nginx reverse proxy config
Deployment Scripts
deployment/setup-infrastructure.sh- Initial infrastructure setupdeployment/deploy-production.sh- Production deploymentdeployment/health-check.sh- Service health monitoring
Documentation
docs/SETUP-INFRASTRUCTURE.md- Step-by-step setup guidedocs/INFRASTRUCTURE.md- Architecture and network documentation
Network Architecture
Internet
│ HTTPS
▼
┌─────────────┐
│ Nginx │ (80/443) - SSL termination, rate limiting
└──────┬──────┘
│
┌───┴───┐
▼ ▼
┌──────┐ ┌──────┐
│Frontend│ │Backend│
│:3000 │ │:3001 │
└──────┘ └───┬───┘
│
┌──────┼──────┐
▼ ▼ ▼
┌────────┐ ┌────┐ ┌──────┐
│PostgreSQL│ │Redis│ │External│
│:5432 │ │:6379│ │Network │
└────────┘ └────┘ └───┬───┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Plex │ │Tautulli │ │ Overseer│
│172.20.1.│ │172.20.1.│ │172.20.1.│
│ 220 │ │ 255 │ │ 225 │
└─────────┘ └─────────┘ └─────────┘
Quick Deployment Commands
# 1. Setup infrastructure
npm run setup:infra
# 2. Edit .env with your API keys
nano .env
# 3. Setup Solana
npm run setup:solana
# 4. Deploy
npm run deploy:prod
# 5. Check health
npm run health
# 6. Watch mode monitoring
npm run health -- --watch
Integration Points
Tautulli → CoopCredits
- Trigger: Watch events
- Webhook URL:
https://coop.hobokenchicken.com/webhooks/tautulli - Action: Mint $COOP tokens
Overseer → CoopCredits
- Trigger: Request approval/decline
- Webhook URL:
https://coop.hobokenchicken.com/webhooks/overseer - Action: Burn/spend $COOP tokens
Plex → CoopCredits
- Trigger: User login
- Method: OAuth via plex.tv
- Action: Authenticate users
Security Features
- SSL/TLS: Let's Encrypt or custom certificates
- Rate Limiting: Nginx level protection
- Firewall: UFW rules for local network
- Secrets: Encrypted in
.envfile - Wallet Keys: AES-256-GCM encrypted in database
- CORS: Configured for your domain
- JWT: Secure session tokens
Monitoring
# Health check
./deployment/health-check.sh
# Watch mode (continuous)
./deployment/health-check.sh --watch
# Docker logs
docker-compose -f docker-compose.prod.yml logs -f
# Specific service
docker-compose -f docker-compose.prod.yml logs -f backend
Backup Strategy
# Database backup
docker-compose -f docker-compose.prod.yml exec -T postgres pg_dump -U coop coop_credits > backup_$(date +%Y%m%d).sql
# Environment backup
cp .env .env.backup.$(date +%Y%m%d)
# Wallet keys (secure offsite storage)
# - Solana mint authority keypair
# - Encryption key from .env
Next Steps
- Run setup:
npm run setup:infra - Get API keys:
- Tautulli: http://172.20.1.255:8181 → Settings → API
- Overseer: http://172.20.1.225:5055 → Settings → General
- Plex: https://plex.tv/claim
- Edit .env with your keys
- Setup Solana:
npm run setup:solana - Deploy:
npm run deploy:prod - Configure webhooks in Tautulli and Overseer
- Test:
npm run health
Troubleshooting
| Issue | Solution |
|---|---|
| Cannot reach local services | Check Docker network: docker network ls |
| Webhook not received | Check Nginx logs: docker/nginx/logs/access.log |
| Database connection failed | Verify .env DATABASE_URL |
| SSL error | Check certificate paths in nginx config |
| CORS errors | Verify CORS_ORIGINS in .env |
Support Resources
- Setup Guide:
docs/SETUP-INFRASTRUCTURE.md - Architecture:
docs/INFRASTRUCTURE.md - Health Check:
npm run health - Logs:
npm run docker:prod:logs