Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ services:
environment:
# Development database settings
POSTGRES_PASSWORD: dev_password_123
POSTGRES_DB: ffmpeg_api_dev
POSTGRES_DB: rendiff_dev

ports:
# Expose postgres for local development tools
Expand Down Expand Up @@ -96,19 +96,19 @@ services:
# Development Tools
mailhog:
image: mailhog/mailhog:v1.0.1
container_name: ffmpeg_dev_mailhog
container_name: rendiff_dev_mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
networks:
- ffmpeg-net
- rendiff-net
profiles:
- dev-tools

# Database Admin Tool
pgadmin:
image: dpage/pgadmin4:latest
container_name: ffmpeg_dev_pgadmin
container_name: rendiff_dev_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@localhost
PGADMIN_DEFAULT_PASSWORD: admin
Expand All @@ -120,7 +120,7 @@ services:
depends_on:
- postgres
networks:
- ffmpeg-net
- rendiff-net
profiles:
- dev-tools

Expand Down
4 changes: 2 additions & 2 deletions docs/PERFORMANCE_OPTIMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

This FFmpeg API has been optimized for high-performance production workloads with comprehensive performance improvements implemented across all layers.
Rendiff has been optimized for high-performance production workloads with comprehensive performance improvements implemented across all layers.

## 🚀 Performance Features Implemented

Expand Down Expand Up @@ -291,7 +291,7 @@ ORDER BY idx_scan DESC;
# GPU workloads: Limit to GPU capacity

# Monitor worker memory usage
docker stats ffmpeg-api-worker-1
docker stats rendiff-worker-1

# Adjust prefetch multiplier
# Higher = better throughput, more memory usage
Expand Down
32 changes: 16 additions & 16 deletions docs/RUNBOOKS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FFmpeg API Operational Runbooks
# Rendiff Operational Runbooks

## Table of Contents

Expand Down Expand Up @@ -34,8 +34,8 @@ docker compose exec redis redis-cli ping
curl -w "@curl-format.txt" -o /dev/null -s https://api.domain.com/api/v1/health

# Database connections
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c \
"SELECT count(*) FROM pg_stat_activity WHERE datname = 'ffmpeg_api';"
docker compose exec postgres psql -U rendiff_user -d rendiff -c \
"SELECT count(*) FROM pg_stat_activity WHERE datname = 'rendiff';"

# Queue depth
docker compose exec redis redis-cli llen celery
Expand All @@ -61,7 +61,7 @@ docker compose exec worker-cpu celery -A worker.main inspect active
docker stats --no-stream

# Check database slow queries
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c \
docker compose exec postgres psql -U rendiff_user -d rendiff -c \
"SELECT query, mean_exec_time, calls FROM pg_stat_statements
WHERE mean_exec_time > 1000 ORDER BY mean_exec_time DESC LIMIT 10;"

Expand All @@ -78,7 +78,7 @@ docker compose exec redis redis-cli info memory
2. **Clear slow queries:**
```bash
# Analyze and optimize slow queries
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c \
docker compose exec postgres psql -U rendiff_user -d rendiff -c \
"ANALYZE jobs; REINDEX TABLE jobs;"
```

Expand Down Expand Up @@ -340,7 +340,7 @@ find /storage -type f -mtime +7 -name "*.tmp" -ls
**Check processing metrics:**
```bash
# Average processing time by operation
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c "
docker compose exec postgres psql -U rendiff_user -d rendiff -c "
SELECT
operations->0->>'type' as operation,
AVG(EXTRACT(EPOCH FROM (completed_at - started_at))) as avg_seconds,
Expand All @@ -367,10 +367,10 @@ docker compose restart worker-cpu
**Check slow queries:**
```bash
# Enable query logging
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c \
docker compose exec postgres psql -U rendiff_user -d rendiff -c \
"ALTER SYSTEM SET log_min_duration_statement = 1000;"

docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c \
docker compose exec postgres psql -U rendiff_user -d rendiff -c \
"SELECT pg_reload_conf();"

# View slow query log
Expand All @@ -380,13 +380,13 @@ docker compose exec postgres tail -f /var/log/postgresql/postgresql.log | grep d
**Optimize database:**
```bash
# Update statistics
docker compose exec postgres vacuumdb -U ffmpeg_user -d ffmpeg_api -z
docker compose exec postgres vacuumdb -U rendiff_user -d rendiff -z

# Reindex tables
docker compose exec postgres reindexdb -U ffmpeg_user -d ffmpeg_api
docker compose exec postgres reindexdb -U rendiff_user -d rendiff

# Check table sizes
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c "
docker compose exec postgres psql -U rendiff_user -d rendiff -c "
SELECT
schemaname AS table_schema,
tablename AS table_name,
Expand Down Expand Up @@ -425,7 +425,7 @@ LIMIT 10;"
4. **Verify restoration:**
```bash
# Check data integrity
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c \
docker compose exec postgres psql -U rendiff_user -d rendiff -c \
"SELECT COUNT(*) FROM jobs;"

# Run application tests
Expand Down Expand Up @@ -489,8 +489,8 @@ pg_basebackup -h localhost -D /recovery -U postgres -Fp -Xs -P
1. **Add worker nodes:**
```bash
# Deploy to new node
scp -r . newnode:/opt/ffmpeg-api/
ssh newnode "cd /opt/ffmpeg-api && docker compose up -d worker-cpu"
scp -r . newnode:/opt/rendiff/
ssh newnode "cd /opt/rendiff && docker compose up -d worker-cpu"
```

2. **Scale services:**
Expand Down Expand Up @@ -520,7 +520,7 @@ pg_basebackup -h localhost -D /recovery -U postgres -Fp -Xs -P
1. **Immediate response:**
```bash
# Identify compromised key
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c "
docker compose exec postgres psql -U rendiff_user -d rendiff -c "
SELECT api_key_hash, last_used_at, request_count
FROM api_keys
WHERE last_used_at > NOW() - INTERVAL '1 hour'
Expand All @@ -536,7 +536,7 @@ pg_basebackup -h localhost -D /recovery -U postgres -Fp -Xs -P
docker compose logs api | grep <key-hash> > suspicious-activity.log

# Check for data exfiltration
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c "
docker compose exec postgres psql -U rendiff_user -d rendiff -c "
SELECT COUNT(*), SUM(output_size)
FROM jobs
WHERE api_key = '<key-hash>'
Expand Down
4 changes: 2 additions & 2 deletions docs/SECURITY_HARDENING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

This FFmpeg API has been comprehensively hardened against all known security vulnerabilities. This document outlines the security features implemented and best practices for secure deployment.
Rendiff has been comprehensively hardened against all known security vulnerabilities. This document outlines the security features implemented and best practices for secure deployment.

## 🛡️ Security Features Implemented

Expand Down Expand Up @@ -217,7 +217,7 @@ semgrep --config=auto api/ worker/

# Container scanning
docker scout cves
trivy image ffmpeg-api:latest
trivy image rendiff:latest
```

### **Penetration Testing Checklist**
Expand Down
6 changes: 3 additions & 3 deletions docs/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,13 @@ docker compose up -d --scale worker-genai=2
#### Database Optimization
```bash
# Monitor database performance
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c "
docker compose exec postgres psql -U rendiff_user -d rendiff -c "
SELECT query, mean_time, calls
FROM pg_stat_statements
ORDER BY mean_time DESC LIMIT 10;"

# Analyze table usage
docker compose exec postgres psql -U ffmpeg_user -d ffmpeg_api -c "
docker compose exec postgres psql -U rendiff_user -d rendiff -c "
SELECT schemaname,tablename,attname,n_distinct,correlation
FROM pg_stats WHERE tablename='jobs';"
```
Expand All @@ -604,4 +604,4 @@ FROM pg_stats WHERE tablename='jobs';"
| **[🏭 Production Setup](#production-setup)** | Production best practices | Production setup |
| **[🛡️ HTTPS/SSL Configuration](#httpssl-configuration)** | Security configuration | Security hardening |

**Need help?** Check the [troubleshooting section](#troubleshooting) or [open an issue](https://github.com/rendiffdev/ffmpeg-api/issues).
**Need help?** Check the [troubleshooting section](#troubleshooting) or [open an issue](https://github.com/rendiffdev/rendiff-dev/issues).
24 changes: 12 additions & 12 deletions k8s/base/api-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ffmpeg-api
namespace: ffmpeg-api
name: rendiff
namespace: rendiff
labels:
app: ffmpeg-api
app: rendiff
component: api
spec:
replicas: 3
selector:
matchLabels:
app: ffmpeg-api
app: rendiff
component: api
template:
metadata:
labels:
app: ffmpeg-api
app: rendiff
component: api
spec:
containers:
- name: api
image: ffmpeg-api:latest
image: rendiff:latest
ports:
- containerPort: 8000
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: ffmpeg-api-secrets
name: rendiff-secrets
key: database-url
- name: REDIS_URL
valueFrom:
secretKeyRef:
name: ffmpeg-api-secrets
name: rendiff-secrets
key: redis-url
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: ffmpeg-api-secrets
name: rendiff-secrets
key: secret-key
resources:
requests:
Expand Down Expand Up @@ -69,11 +69,11 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: ffmpeg-api-service
namespace: ffmpeg-api
name: rendiff-service
namespace: rendiff
spec:
selector:
app: ffmpeg-api
app: rendiff
component: api
ports:
- port: 80
Expand Down
10 changes: 5 additions & 5 deletions monitoring/alerts/production-alerts.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Prometheus Alerting Rules for FFmpeg API Production
# Prometheus Alerting Rules for Rendiff Production
# SLO-based alerts with multi-window burn rate

groups:
- name: ffmpeg_api_availability
- name: rendiff_availability
interval: 30s
rules:
# High Priority Alerts
Expand All @@ -11,7 +11,7 @@ groups:
for: 2m
labels:
severity: critical
service: ffmpeg-api
service: rendiff
annotations:
summary: "High API error rate detected"
description: "API error rate is {{ $value }} errors/sec for the last 5 minutes"
Expand All @@ -22,7 +22,7 @@ groups:
for: 3m
labels:
severity: warning
service: ffmpeg-api
service: rendiff
annotations:
summary: "API response time is high"
description: "95th percentile response time is {{ $value }}s"
Expand Down Expand Up @@ -255,7 +255,7 @@ groups:

# Health Check Alerts
- alert: HealthCheckFailing
expr: up{job="ffmpeg-api"} == 0
expr: up{job="rendiff"} == 0
for: 2m
labels:
severity: critical
Expand Down
Loading
Loading