nuke redis and install update
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / E2E Tests (push) Blocked by required conditions

This commit is contained in:
Enki 2025-08-27 12:36:23 -07:00
parent fa60d908b0
commit 42c9db1f1f
3 changed files with 15 additions and 29 deletions

View File

@ -81,11 +81,14 @@ The installer will:
- `golang-go` - Go compiler - `golang-go` - Go compiler
- `nginx` - Web server/reverse proxy - `nginx` - Web server/reverse proxy
- `certbot` - SSL certificate management - `certbot` - SSL certificate management
- `redis-server` - Caching layer
- `sqlite3` - Database - `sqlite3` - Database
- `ffmpeg` - Video transcoding - `ffmpeg` - Video transcoding
- `fail2ban` - Intrusion prevention
- `ufw` - Uncomplicated Firewall
- Various utilities (curl, jq, bc, htop, etc.) - Various utilities (curl, jq, bc, htop, etc.)
**Note:** Redis is **not required** - the gateway uses an efficient in-memory LRU cache.
### Directory Structure ### Directory Structure
``` ```
/opt/torrent-gateway/ /opt/torrent-gateway/

View File

@ -41,20 +41,19 @@ sqlite3 /opt/torrent-gateway/data/metadata.db "SELECT COUNT(*) FROM files;"
sudo systemctl start torrent-gateway 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:** **Solutions:**
The gateway uses an in-memory LRU cache (no Redis required):
```bash ```bash
# Check Redis service # Check memory usage
sudo systemctl status redis-server free -h
sudo systemctl status torrent-gateway
# Test Redis connection # Restart service to clear cache
redis-cli ping sudo systemctl restart torrent-gateway
# Restart Redis
sudo systemctl restart redis-server
``` ```
### Performance Issues ### Performance Issues

View File

@ -157,7 +157,6 @@ apt-get install -y \
golang-go \ golang-go \
git \ git \
sqlite3 \ sqlite3 \
redis-server \
nginx \ nginx \
certbot \ certbot \
python3-certbot-nginx \ python3-certbot-nginx \
@ -218,21 +217,8 @@ elif [ "$USE_EXISTING_MONITORING" = true ]; then
fi fi
./scripts/setup_systemd.sh $MONITORING_FLAG ./scripts/setup_systemd.sh $MONITORING_FLAG
# Step 4: Configure Redis # Step 4: Configure cache (in-memory LRU - no Redis needed)
echo "🔧 Optimizing Redis configuration..." echo "🧠 Gateway uses in-memory LRU cache (no Redis required)"
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 5: Setup monitoring (if requested) # Step 5: Setup monitoring (if requested)
if [ "$ENABLE_MONITORING" = true ]; then if [ "$ENABLE_MONITORING" = true ]; then
@ -420,8 +406,7 @@ if command -v ufw &> /dev/null; then
echo "📊 Monitoring ports opened for external monitoring server" echo "📊 Monitoring ports opened for external monitoring server"
fi fi
# Allow Redis only from localhost (security) # Gateway uses in-memory cache (no Redis ports needed)
ufw allow from 127.0.0.1 to any port 6379 comment "Redis (localhost only)"
# Block common attack vectors # Block common attack vectors
ufw deny 23/tcp comment "Block Telnet" 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..." echo "🚀 Starting all services..."
# Start dependencies first # Start dependencies first
systemctl start redis-server
systemctl start nginx systemctl start nginx
if [ "$ENABLE_MONITORING" = true ]; then if [ "$ENABLE_MONITORING" = true ]; then