diff --git a/CLAUDE.md b/CLAUDE.md index bc57022..9b9254d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -141,6 +141,26 @@ curl -X POST "http://127.0.0.1:8880/v1/audio/speech" \ --output test.wav ``` +### Disk Usage Analysis Tools +```bash +# System-level disk space overview (recommended for regular checks) +duf # Modern df with colors and progress bars + +# Directory size analysis +dust /home/hoborg # Quick visual summary with tree view +dust /home/hoborg --depth 3 # Limit depth for large directories + +# Interactive cleanup and detailed analysis +ncdu /home/hoborg # Navigate with arrow keys, delete with 'd' +ncdu /opt/docker # Analyze Docker data usage +ncdu ~ # Scan home directory for large files + +# Usage patterns: +# 1. duf - Quick system health check (like htop for disk space) +# 2. dust - Fast overview of directory sizes (like tree with sizes) +# 3. ncdu - Deep dive cleanup and file management (like htop for files) +``` + ### WebDAV Client Setup ```bash # X-plore File Manager (Android) diff --git a/docs/services.md b/docs/services.md index 1b4856b..d8a47b5 100644 --- a/docs/services.md +++ b/docs/services.md @@ -2,6 +2,77 @@ Planning and configuration for self-hosted services and applications. +## Nginx Reverse Proxy + +**Status**: ✅ Active +**Port**: 80 (HTTP), 443 (HTTPS) +**Configuration**: `/etc/nginx/sites-available/homelab` + +### Features +- Path-based routing to services (`/gitea/`, `/files/`, `/media/`) +- SSL termination with Let's Encrypt certificates +- Security headers (XSS protection, content type sniffing prevention) +- WebDAV support for Copyparty file server +- Custom landing page at domain root with service dashboard +- HTTP to HTTPS redirects +- Custom error pages + +### Configuration Notes +- Uses `default_server` directive to handle all requests to port 80/443 +- Default nginx server block in `/etc/nginx/nginx.conf` is commented out to prevent conflicts +- Landing page served from `/var/www/homelab/index.html` +- Root location uses `location /` (not `location = /`) for proper index file handling + +### Management +```bash +# Deploy configuration from repo +sudo cp config/nginx/homelab.conf /etc/nginx/sites-available/homelab + +# Test configuration syntax +sudo nginx -t + +# Restart nginx (recommended over reload for major config changes) +sudo systemctl restart nginx + +# View logs +sudo journalctl -u nginx -f + +# Check active configuration +sudo nginx -T | grep -A20 "server_name ak-homelab" +``` + +### Landing Page +The homelab landing page (`/var/www/homelab/index.html`) provides a dashboard with: +- Service status indicators +- Direct links to all services +- Responsive design with gradient styling +- Service icons and descriptions + +Update the landing page: +```bash +# Copy from repo (if you have a config/www/index.html) +sudo cp config/www/index.html /var/www/homelab/ +sudo chown http:http /var/www/homelab/index.html +``` + +### Troubleshooting +For landing page 404 issues, see the detailed troubleshooting guide in `docs/troubleshooting.md` under "Landing Page Returns 404 Not Found". + +Common debugging commands: +```bash +# Check nginx configuration is active +sudo nginx -T | grep -A10 "server_name ak-homelab" + +# Test landing page access +curl -I https://ak-homelab.duckdns.org/ + +# Monitor nginx logs in real-time +sudo journalctl -u nginx -f + +# Verify file permissions +sudo ls -la /var/www/homelab/index.html +``` + ## Git Repository Hosting ### Service Options