diff --git a/INSTALL.md b/INSTALL.md index 3464d75..1f49cf2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -81,11 +81,14 @@ The installer will: - `golang-go` - Go compiler - `nginx` - Web server/reverse proxy - `certbot` - SSL certificate management -- `redis-server` - Caching layer - `sqlite3` - Database - `ffmpeg` - Video transcoding +- `fail2ban` - Intrusion prevention +- `ufw` - Uncomplicated Firewall - Various utilities (curl, jq, bc, htop, etc.) +**Note:** Redis is **not required** - the gateway uses an efficient in-memory LRU cache. + ### Directory Structure ``` /opt/torrent-gateway/ diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 0267a14..84acd38 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -41,20 +41,19 @@ sqlite3 /opt/torrent-gateway/data/metadata.db "SELECT COUNT(*) FROM files;" sudo systemctl start torrent-gateway ``` -#### Redis Connection Issues +#### Cache Performance Issues -**Symptoms:** Gateway logs show Redis connection errors +**Symptoms:** High memory usage, slow response times **Solutions:** +The gateway uses an in-memory LRU cache (no Redis required): ```bash -# Check Redis service -sudo systemctl status redis-server +# Check memory usage +free -h +sudo systemctl status torrent-gateway -# Test Redis connection -redis-cli ping - -# Restart Redis -sudo systemctl restart redis-server +# Restart service to clear cache +sudo systemctl restart torrent-gateway ``` ### Performance Issues diff --git a/scripts/install_native.sh b/scripts/install_native.sh index 57e9384..85b5c46 100755 --- a/scripts/install_native.sh +++ b/scripts/install_native.sh @@ -157,7 +157,6 @@ apt-get install -y \ golang-go \ git \ sqlite3 \ - redis-server \ nginx \ certbot \ python3-certbot-nginx \ @@ -218,21 +217,8 @@ elif [ "$USE_EXISTING_MONITORING" = true ]; then fi ./scripts/setup_systemd.sh $MONITORING_FLAG -# Step 4: Configure Redis -echo "🔧 Optimizing Redis configuration..." -cat > /etc/redis/redis.local.conf << 'EOF' -# Torrent Gateway specific Redis config -maxmemory 512mb -maxmemory-policy allkeys-lru -save 900 1 -save 300 10 -save 60 10000 -EOF - -# Include local config in main Redis config -if ! grep -q "include /etc/redis/redis.local.conf" /etc/redis/redis.conf; then - echo "include /etc/redis/redis.local.conf" >> /etc/redis/redis.conf -fi +# Step 4: Configure cache (in-memory LRU - no Redis needed) +echo "🧠 Gateway uses in-memory LRU cache (no Redis required)" # Step 5: Setup monitoring (if requested) if [ "$ENABLE_MONITORING" = true ]; then @@ -420,8 +406,7 @@ if command -v ufw &> /dev/null; then echo "📊 Monitoring ports opened for external monitoring server" fi - # Allow Redis only from localhost (security) - ufw allow from 127.0.0.1 to any port 6379 comment "Redis (localhost only)" + # Gateway uses in-memory cache (no Redis ports needed) # Block common attack vectors ufw deny 23/tcp comment "Block Telnet" @@ -612,7 +597,6 @@ echo "0 4 * * 0 root /opt/torrent-gateway/scripts/cleanup.sh > /var/log/torrent- echo "🚀 Starting all services..." # Start dependencies first -systemctl start redis-server systemctl start nginx if [ "$ENABLE_MONITORING" = true ]; then