This commit improves configuration management by: ## Changes ### Environment Variable Management - Moved ALL environment blocks from compose.yaml files to .env files - Added comprehensive .env files for all 20 services - Included example secret formats with generation commands - Added detailed comments explaining what each secret should look like ### Example Secret Formats All .env files now include examples for: - **JWT Secrets**: 64-character hex strings - Example format: `a1b2c3d4e5f67890abcdef1234567890...` - Generate with: `openssl rand -hex 32` - **Passwords**: Strong alphanumeric passwords - Example format: `MyS3cur3P@ssw0rd!2024#HomeL@b` - Generate with: `openssl rand -base64 32 | tr -d /=+ | cut -c1-32` - **Session Secrets**: Random hex strings - Example format: `b2c3d4e5f67890abcdef1234567890a1b2...` - Generate with: `openssl rand -hex 32` - **API Keys**: Service-specific formats - Meili: 32-character hex (`openssl rand -hex 16`) - NextAuth: 64-character hex (`openssl rand -hex 32`) ### GPU Support Documentation - Added NVIDIA GPU (GTX 1070) configuration for Jellyfin - Added NVIDIA GPU configuration for Immich (ML inference & transcoding) - Included setup instructions for NVIDIA Container Toolkit - Documented how to enable GPU acceleration in each service ### Services Updated **Core Infrastructure:** - lldap: Added JWT secret and password examples - tinyauth: Added session secret examples - traefik: No environment variables needed **Media Services:** - jellyfin: Added .env with GPU configuration docs - jellyseer: Created .env with logging and timezone settings - immich: Added database password examples and GPU docs - sonarr: Created .env for PUID/PGID/TZ - radarr: Created .env for PUID/PGID/TZ - sabnzbd: Created .env for PUID/PGID/TZ - qbittorrent: Created .env for PUID/PGID/TZ/WEBUI_PORT **Utility Services:** - homarr: Created .env for port and timezone - backrest: Added environment variables to .env - linkwarden: Rewrote .env with NextAuth, Postgres, Meili examples - vikunja: Created .env with JWT secret and database password - FreshRSS: Created .env for PUID/PGID/TZ - booklore: Created .env for PUID/PGID/TZ - calibre-web: Created .env for PUID/PGID/TZ - filebrowser: Created .env for PUID/PGID/TZ - lubelogger: Created .env with locale settings - rsshub: Created .env with cache and logging config - microbin: Updated existing .env, removed environment block ### Benefits 1. **Security**: - Clear examples show what strong secrets look like - Generation commands prevent weak passwords - All secrets in one place per service 2. **Consistency**: - All services follow the same pattern (env_file: .env) - No more environment blocks in compose files - Easier to template new services 3. **Usability**: - Users know exactly what to change (look for `changeme_*`) - Example formats prevent configuration errors - Commands provided to generate secure values 4. **Maintainability**: - Compose files are cleaner and more readable - Environment changes don't require compose file edits - Version control friendly (.env files can be .gitignored) ### Files Changed - Modified: 24 compose.yaml files - Created: 14 new .env files - Updated: 6 existing .env files - Total .env files: 20 across all services All compose.yaml files now use `env_file: .env` exclusively. No environment blocks remain in any compose files. |
||
|---|---|---|
| .. | ||
| .env | ||
| .gitignore | ||
| compose.yaml | ||
| README.md | ||
Backrest - Web UI for Restic Backups
Backrest provides a modern web interface for managing Restic backups with support for Backblaze B2 (S3-compatible) storage.
Features
- Web UI: User-friendly interface for managing backups
- Encrypted Backups: Uses Restic for encrypted, deduplicated backups
- Scheduling: Built-in scheduler for automatic backups
- Monitoring: View backup status, logs, and statistics
- Multiple Repositories: Support for multiple backup destinations
- Retention Policies: Automatic cleanup of old backups
- Notifications: Email and webhook notifications for backup events
Quick Start
1. Start the Service
cd compose/services/backrest
docker compose up -d
2. Access Web UI
Open your browser and navigate to:
Login with your SSO credentials (tinyauth).
3. Configure Backblaze B2 Repository
-
Create B2 Bucket (if not already done):
- Go to https://secure.backblaze.com/b2_buckets.htm
- Click "Create a Bucket"
- Name:
homelab-backups(or your choice) - Files: Private
- Encryption: Server-Side (or Disabled - Backrest encrypts client-side)
-
Create Application Key:
- Go to https://secure.backblaze.com/app_keys.htm
- Click "Add a New Application Key"
- Name:
backrest-homelab - Access: Read and Write
- Bucket: Select your backup bucket
- Save the
keyIDandapplicationKey
-
Add Repository in Backrest:
- Click "Add Repository"
- Repository Name:
B2 Immich Photos - Storage Type:
S3-compatible storage - Configuration:
Endpoint: s3.us-west-002.backblazeb2.com Region: us-west-002 Bucket: homelab-backups Path: /immich-photos Access Key ID: [your B2 keyID] Secret Access Key: [your B2 applicationKey] - Encryption Password: Set a strong password (SAVE THIS!)
- Click "Initialize Repository"
4. Create Backup Plan
-
Add Plan:
- Click "Add Plan"
- Plan Name:
Immich Daily Backup - Repository: Select your B2 repository
- Paths to Backup:
/backups/immich
- Exclude Patterns (optional):
*.tmp*.log
-
Schedule:
- Backup Schedule:
0 3 * * *(3 AM daily) - Enable "Automatic Backups"
- Backup Schedule:
-
Retention Policy:
- Keep Last: 7 daily backups
- Keep Weekly: 4 weekly backups
- Keep Monthly: 6 monthly backups
- Keep Yearly: 2 yearly backups
-
Notifications (optional):
- Configure email or webhook for backup status
- Alert on failures
5. Run First Backup
Click "Run Now" to start your first backup immediately.
Backup Locations
The service has access to these directories:
/backups/immich- Immich photos (read-only)/backups/homelab-config- All compose configurations (read-only)
You can add more volumes in compose.yaml as needed.
Monitoring
View Backup Status
In the Backrest web UI:
- Dashboard shows all backup plans and their status
- Click on a plan to see backup history
- View logs for detailed information
Check Repository Size
# Via web UI: Repository → Statistics
# Shows: Total size, deduplicated size, number of snapshots
Verify Backups
Backrest has built-in verification:
- Go to Repository → Verify
- Click "Run Verification"
- Check results for any errors
Restore Files
Via Web UI
- Go to Plan → Snapshots
- Select snapshot to restore
- Click "Browse Files"
- Select files/folders to restore
- Choose restore location
- Click "Restore"
Via CLI (Advanced)
# List snapshots
docker exec backrest restic -r [repository] snapshots
# Restore specific snapshot
docker exec backrest restic -r [repository] restore [snapshot-id] --target /restore
# Restore specific file
docker exec backrest restic -r [repository] restore [snapshot-id] --target /restore --include /path/to/file
Configuration Backup
Backup Backrest Config
Your Backrest configuration (plans, schedules, repositories) is stored in:
./config/config.json
Important: Backup this file! It contains your repository credentials (encrypted).
# Create backup
cp config/config.json config/config.json.backup
# Restore backup
cp config/config.json.backup config/config.json
docker compose restart
Export Configuration
In Web UI:
- Settings → Export Configuration
- Save JSON file securely
- Store encryption passwords separately
Troubleshooting
Cannot Access Web UI
Check container status:
docker compose logs backrest
docker compose ps
Verify Traefik routing:
docker logs traefik | grep backrest
Backup Fails
-
Check Logs:
- Web UI: Plan → View Logs
- Or:
docker compose logs -f backrest
-
Verify B2 Credentials:
- Test connection in Repository settings
- Ensure application key has read/write access
-
Check Disk Space:
df -h docker exec backrest df -h /cache
Repository Locked
If a backup is interrupted, the repository may be locked:
# Via Web UI: Repository → Unlock
# Or via CLI:
docker exec backrest restic -r [repository] unlock
Slow Backups
- Enable Caching: Already configured via
XDG_CACHE_HOME - Increase Upload Speed: Check B2 endpoint is geographically close
- Exclude Unnecessary Files: Add patterns to exclude list
Security Considerations
Encryption
- Client-side: All data encrypted before upload
- Repository Password: Required to access backups
- Storage: Store repository passwords in password manager
Access Control
- SSO Protected: Web UI requires authentication via tinyauth
- API Keys: B2 application keys scoped to specific bucket
- Read-Only Mounts: Backup sources mounted read-only
Best Practices
- Test Restores: Regularly test restoring files
- Monitor Backups: Check backup status weekly
- Verify Integrity: Run verification monthly
- Secure Passwords: Use strong, unique repository passwords
- Document Recovery: Keep recovery procedures documented
- Offsite Storage: B2 provides geographic redundancy
Advanced Configuration
Add More Backup Sources
Edit compose.yaml to add more volumes:
volumes:
- /path/to/backup:/backups/name:ro
Then create a new backup plan in the web UI.
Multiple Repositories
Configure multiple destinations:
- Primary: Backblaze B2
- Secondary: Local NAS/USB drive
- Archive: Another cloud provider
Webhooks
Configure webhooks for monitoring:
- Settings → Notifications
- Add Webhook URL (e.g., Discord, Slack, Uptime Kuma)
- Select events: Backup Success, Backup Failure
Custom Retention
Fine-tune retention policies:
--keep-within 7d
--keep-within-daily 30d
--keep-within-weekly 90d
--keep-within-monthly 1y
--keep-within-yearly 5y
Resource Usage
Typical Usage:
- CPU: Low (spikes during backup)
- Memory: ~200-500MB
- Disk: Cache grows over time (monitor)
- Network: Depends on backup size
Monitoring Cache Size:
du -sh compose/services/backrest/cache
Clean cache if needed (safe to delete - will rebuild):
rm -rf compose/services/backrest/cache/*
docker compose restart
Backrest vs Duplicati
We chose Backrest over Duplicati because:
- Modern: Built on Restic (actively developed)
- Performance: Better deduplication and compression
- Reliability: Restic is battle-tested
- Features: More advanced scheduling and monitoring
- UI: Clean, responsive interface
Cost Estimation
Backblaze B2 Pricing (2024):
- Storage: $0.006/GB/month
- Download: $0.01/GB (first 3x storage free)
- Upload: Free
Example: 100GB Immich photos
- Storage Cost: $0.60/month
- Download (3 restores/month): Free
- Total: ~$0.60/month
With Deduplication:
- First backup: 100GB
- Daily incrementals: ~1-5GB
- Monthly growth: ~20GB
- Avg monthly cost: ~$0.70
Resources
Next Steps
- ✅ Configure B2 repository
- ✅ Create backup plan for Immich
- ⬜ Run initial backup
- ⬜ Verify backup integrity
- ⬜ Test restore procedure
- ⬜ Set up notifications
- ⬜ Add homelab-config backups
- ⬜ Schedule monthly verification