Skip to content

Commit 0f6bc50

Browse files
committed
Fix critical security and stability issues from audit
Security Fixes: - Fix SSRF protection with proper CIDR range checking (ipaddress module) - Now blocks 172.16.0.0/12, IPv6 loopback, link-local, carrier-grade NAT - Block internal hostnames (.local, .internal) Stability Fixes: - Fix Docker container_name vs replicas conflict in compose.yml - Fix async webhook calls missing asyncio.run() in error handlers - Fix synchronous file I/O in async context (cached storage config) Configuration Improvements: - Add MAX_OPERATIONS_PER_JOB setting (consolidated from hardcoded values) - Update default credentials to clearly dev-only values - Add warning comments about development-only defaults Documentation: - Add comprehensive developer documentation (docs/developer/) - Add user manual documentation (docs/user-manual/) - Update project branding to Rendiff with FFmpeg acknowledgment
1 parent 39e7eda commit 0f6bc50

33 files changed

+4747
-183
lines changed

.env.example

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# FFmpeg API - Production Environment Configuration
1+
# Rendiff - Production Environment Configuration
2+
# A REST API layer powered by FFmpeg for media processing
23
# Copy this file to .env and configure for your environment
34

45
# =============================================================================
@@ -22,10 +23,10 @@ API_LOG_LEVEL=info
2223
# =============================================================================
2324

2425
# Production PostgreSQL (Recommended)
25-
DATABASE_URL=postgresql://ffmpeg_user:your_secure_password@postgres:5432/ffmpeg_api
26+
DATABASE_URL=postgresql://rendiff_user:your_secure_password@postgres:5432/rendiff
2627

27-
# Alternative: SQLite (Development Only)
28-
# DATABASE_URL=sqlite+aiosqlite:///data/ffmpeg_api.db
28+
# Alternative: SQLite (Development Only)
29+
# DATABASE_URL=sqlite+aiosqlite:///data/rendiff.db
2930

3031
# Database Pool Settings
3132
DATABASE_POOL_SIZE=20
@@ -52,7 +53,7 @@ WORKER_TASK_TIME_LIMIT=21600
5253
# Storage Paths
5354
STORAGE_CONFIG=/app/config/storage.yml
5455
STORAGE_PATH=./storage
55-
TEMP_PATH=/tmp/ffmpeg_api
56+
TEMP_PATH=/tmp/rendiff
5657

5758
# Data Persistence Paths (for Docker volumes)
5859
POSTGRES_DATA_PATH=./data/postgres
@@ -116,6 +117,7 @@ GRAFANA_PASSWORD=your_secure_grafana_password
116117
MAX_UPLOAD_SIZE=10737418240
117118
MAX_JOB_DURATION=21600
118119
MAX_CONCURRENT_JOBS_PER_KEY=10
120+
MAX_OPERATIONS_PER_JOB=50
119121
JOB_RETENTION_DAYS=7
120122

121123
# =============================================================================
@@ -148,7 +150,7 @@ CLAMAV_PORT=3310
148150
# COMPOSE_PROFILES=gpu,monitoring # GPU + Monitoring
149151

150152
# Network Configuration
151-
# COMPOSE_PROJECT_NAME=ffmpeg-api
153+
# COMPOSE_PROJECT_NAME=rendiff
152154

153155
# =============================================================================
154156
# CLOUD STORAGE (Optional)

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ jobs:
4242
platforms: linux/amd64,linux/arm64
4343
push: true
4444
tags: |
45-
ghcr.io/${{ github.repository_owner }}/ffmpeg-api-service:latest
46-
ghcr.io/${{ github.repository_owner }}/ffmpeg-api-service:${{ github.sha }}
45+
ghcr.io/${{ github.repository_owner }}/rendiff:latest
46+
ghcr.io/${{ github.repository_owner }}/rendiff:${{ github.sha }}

.github/workflows/stable-build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
context: .
9999
file: ${{ matrix.dockerfile }}
100100
build-args: ${{ matrix.build_args }}
101-
tags: ffmpeg-${{ matrix.component }}:test
101+
tags: rendiff-${{ matrix.component }}:test
102102
load: true
103103
cache-from: type=gha
104104
cache-to: type=gha,mode=max
@@ -108,14 +108,14 @@ jobs:
108108
echo "Testing critical dependencies in ${{ matrix.component }}..."
109109
110110
# Test psycopg2-binary (the main fix)
111-
docker run --rm ffmpeg-${{ matrix.component }}:test python -c "
111+
docker run --rm rendiff-${{ matrix.component }}:test python -c "
112112
import psycopg2
113113
print(f'✅ psycopg2-binary: {psycopg2.__version__}')
114114
"
115115
116116
# Test other critical dependencies
117117
if [ "${{ matrix.component }}" = "api" ]; then
118-
docker run --rm ffmpeg-${{ matrix.component }}:test python -c "
118+
docker run --rm rendiff-${{ matrix.component }}:test python -c "
119119
import fastapi, sqlalchemy, asyncpg
120120
print(f'✅ FastAPI: {fastapi.__version__}')
121121
print(f'✅ SQLAlchemy: {sqlalchemy.__version__}')
@@ -124,7 +124,7 @@ jobs:
124124
fi
125125
126126
if [[ "${{ matrix.component }}" == worker* ]]; then
127-
docker run --rm ffmpeg-${{ matrix.component }}:test python -c "
127+
docker run --rm rendiff-${{ matrix.component }}:test python -c "
128128
import celery, redis
129129
print(f'✅ Celery: {celery.__version__}')
130130
print(f'✅ Redis: {redis.__version__}')
@@ -151,18 +151,18 @@ jobs:
151151
context: .
152152
file: docker/api/Dockerfile.new
153153
build-args: "PYTHON_VERSION=${{ env.PYTHON_VERSION }}"
154-
tags: ffmpeg-api:ffmpeg-test
154+
tags: rendiff-api:ffmpeg-test
155155
load: true
156156

157157
- name: Test FFmpeg functionality
158158
run: |
159159
echo "Testing FFmpeg installation and basic functionality..."
160160
161161
# Test FFmpeg version
162-
docker run --rm ffmpeg-api:ffmpeg-test ffmpeg -version | head -1
162+
docker run --rm rendiff-api:ffmpeg-test ffmpeg -version | head -1
163163
164164
# Test FFmpeg basic functionality with a simple command
165-
docker run --rm ffmpeg-api:ffmpeg-test ffmpeg -f lavfi -i testsrc=duration=1:size=320x240:rate=1 -t 1 test.mp4
165+
docker run --rm rendiff-api:ffmpeg-test ffmpeg -f lavfi -i testsrc=duration=1:size=320x240:rate=1 -t 1 test.mp4
166166
167167
echo "✅ FFmpeg installation and basic functionality verified"
168168
@@ -221,13 +221,13 @@ jobs:
221221
context: .
222222
file: docker/api/Dockerfile.new
223223
build-args: "PYTHON_VERSION=${{ env.PYTHON_VERSION }}"
224-
tags: ffmpeg-api:security-scan
224+
tags: rendiff-api:security-scan
225225
load: true
226226

227227
- name: Run Trivy vulnerability scanner
228228
uses: aquasecurity/trivy-action@master
229229
with:
230-
image-ref: 'ffmpeg-api:security-scan'
230+
image-ref: 'rendiff-api:security-scan'
231231
format: 'sarif'
232232
output: 'trivy-results.sarif'
233233

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

3-
All notable changes to the FFmpeg API project will be documented in this file.
3+
All notable changes to the Rendiff project will be documented in this file.
4+
5+
> **Note:** Rendiff is a REST API layer powered by FFmpeg for media processing.
46
57
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
68
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Contributing to FFmpeg API
1+
# Contributing to Rendiff
22

3-
We welcome contributions to the FFmpeg API project! This guide will help you get started.
3+
We welcome contributions to Rendiff! This guide will help you get started.
4+
5+
> **Note:** Rendiff is a REST API layer powered by FFmpeg. All media processing is handled by FFmpeg under the hood.
46
57
## Code of Conduct
68

@@ -30,8 +32,8 @@ Please note that this project is released with a Contributor Code of Conduct. By
3032

3133
```bash
3234
# Clone your fork
33-
git clone https://github.com/yourusername/ffmpeg-api.git
34-
cd ffmpeg-api
35+
git clone https://github.com/yourusername/rendiff-dev.git
36+
cd rendiff-dev
3537

3638
# Install dependencies
3739
pip install -r requirements.txt
@@ -94,4 +96,4 @@ Closes #123
9496

9597
Feel free to open an issue for any questions about contributing.
9698

97-
Thank you for contributing to FFmpeg API!
99+
Thank you for contributing to Rendiff!

DEPLOYMENT.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Production Deployment Guide
22

3-
Complete guide for deploying the FFmpeg API to production environments.
3+
Complete guide for deploying Rendiff to production environments.
44

55
## 📊 Executive Summary
66

7-
The Rendiff FFmpeg API is a **production-ready**, **fully containerized** video processing service with **zero manual configuration** required. It provides enterprise-grade video/audio processing capabilities with optional AI-enhanced features.
7+
**Rendiff** is a **production-ready**, **fully containerized** media processing API **powered by FFmpeg**. It provides enterprise-grade video/audio processing capabilities with optional AI-enhanced features.
8+
9+
> **Powered by FFmpeg:** All media processing operations are handled by FFmpeg under the hood. Rendiff provides a clean REST API layer on top of FFmpeg's powerful capabilities.
810
911
### 🎯 Key Features
1012

@@ -33,17 +35,17 @@ The Rendiff FFmpeg API is a **production-ready**, **fully containerized** video
3335
### Standard Deployment (Recommended)
3436
```bash
3537
# Clone and deploy - no setup required!
36-
git clone https://github.com/rendiffdev/ffmpeg-api.git
37-
cd ffmpeg-api
38+
git clone https://github.com/rendiffdev/rendiff-dev.git
39+
cd rendiff-dev
3840
docker compose up -d
3941

4042
# That's it! The API is now running at http://localhost:8080
4143
```
4244

4345
### AI-Enhanced Deployment (GPU Required)
4446
```bash
45-
git clone https://github.com/rendiffdev/ffmpeg-api.git
46-
cd ffmpeg-api
47+
git clone https://github.com/rendiffdev/rendiff-dev.git
48+
cd rendiff-dev
4749
docker compose -f docker compose.yml -f docker compose.genai.yml up -d
4850
```
4951

0 commit comments

Comments
 (0)