Skip to content

Commit 54d580d

Browse files
docs: Add FAQ, security best practices, improve examples and tests docs
Co-authored-by: fabriziosalmi <[email protected]>
1 parent 6e6f7eb commit 54d580d

File tree

5 files changed

+398
-0
lines changed

5 files changed

+398
-0
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- LICENSE file (MIT License)
1313
- This CHANGELOG.md file to track project changes
1414
- Expanded API documentation with all available endpoints organized by category
15+
- Authentication & Session Management endpoints
16+
- Proxy Status & Settings endpoints
17+
- Blacklist Management endpoints
18+
- Logs & Analytics endpoints
19+
- Cache Management endpoints
20+
- Security endpoints
21+
- Database & Maintenance endpoints
1522
- Database management endpoints for optimization and statistics
1623
- Client and domain statistics endpoints
1724
- Security scanning endpoints
25+
- Table of Contents in README for better navigation
26+
- Quick Links section for easy access to key resources
27+
- Project structure diagram showing directory layout
28+
- FAQ section answering common questions
29+
- Security Configuration section with best practices
30+
- Enhanced Support section with detailed guidance
31+
- README files for examples/ and tests/ directories
32+
- Improved documentation for test scripts
1833

1934
### Changed
2035
- Fixed repository URL in README.md (corrected from secure-proxy to secure-proxy-manager)
2136
- Improved API endpoint documentation with better categorization
2237
- Enhanced documentation structure and formatting
38+
- Updated Flask version badge (2.0+ → 3.0+)
39+
- Expanded environment variables documentation with all docker-compose variables
40+
- Renamed "Backup and Restore" section to "Database Export and Backup" for accuracy
41+
- Improved SSL certificate installation instructions with OS-specific details
42+
- Enhanced Contributing section with link to CONTRIBUTING.md
43+
- Updated License section with link to LICENSE file
44+
- Fixed internal link to Transparent Proxy Setup section
45+
- Improved test_import.sh script with comprehensive header documentation
46+
- Made test_import.sh executable
2347

2448
### Fixed
2549
- Repository clone URL inconsistency in Quick Start guide
50+
- Removed non-existent API endpoints from documentation:
51+
- `/api/maintenance/backup-config`
52+
- `/api/maintenance/restore-config`
53+
- `/api/maintenance/update-blacklists`
54+
- `/api/maintenance/clear-cache`
55+
- Corrected network requirements with all actual ports (8011, 3128, 5001)
56+
- Fixed Backup and Restore section to reflect actual database export functionality
57+
- Updated environment variables table to match docker-compose.yml
58+
59+
### Security
60+
- Added security warning about HTTPS filtering and man-in-the-middle inspection
61+
- Documented importance of changing default credentials
62+
- Added guidance for HTTPS deployment with reverse proxy
63+
- Included security best practices section
2664

2765
## [1.0.0] - 2024-11-15
2866

README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ A containerized secure proxy with advanced filtering capabilities, real-time mon
88
[![Flask](https://img.shields.io/badge/Flask-3.0+-green?logo=flask)](https://flask.palletsprojects.com/)
99
[![Bootstrap](https://img.shields.io/badge/Bootstrap-5.0-purple?logo=bootstrap)](https://getbootstrap.com/)
1010

11+
## 🚀 Quick Links
12+
13+
- [**Getting Started**](#-quick-start) - Get up and running in 5 minutes
14+
- [**API Documentation**](#-api-documentation) - Complete API reference
15+
- [**FAQ**](#-frequently-asked-questions-faq) - Common questions answered
16+
- [**Contributing**](CONTRIBUTING.md) - How to contribute to the project
17+
- [**Changelog**](CHANGELOG.md) - Version history and updates
18+
1119
## 📑 Table of Contents
1220

1321
- [Screenshots](#screenshots)
@@ -20,6 +28,7 @@ A containerized secure proxy with advanced filtering capabilities, real-time mon
2028
- [Monitoring and Analytics](#-monitoring-and-analytics)
2129
- [Database Export and Backup](#-database-export-and-backup)
2230
- [Testing and Validation](#-testing-and-validation)
31+
- [FAQ](#-frequently-asked-questions-faq)
2332
- [Troubleshooting](#-troubleshooting)
2433
- [API Documentation](#-api-documentation)
2534
- [Security Best Practices](#-security-best-practices)
@@ -194,6 +203,25 @@ secure-proxy-manager/
194203

195204
**Note:** To customize these values, modify them in `docker-compose.yml` before starting the services.
196205

206+
### 🔐 Security Configuration
207+
208+
**Important Security Considerations:**
209+
210+
1. **Change Default Credentials**: The default username and password (`admin`/`admin`) should be changed immediately in production:
211+
```yaml
212+
# In docker-compose.yml, update both backend and web services:
213+
- BASIC_AUTH_USERNAME=your_secure_username
214+
- BASIC_AUTH_PASSWORD=your_secure_password
215+
```
216+
217+
2. **HTTPS for Web UI**: For production deployments, use a reverse proxy (e.g., nginx, Traefik) with SSL/TLS to secure the web interface.
218+
219+
3. **Network Isolation**: Consider running the proxy in an isolated network segment with strict firewall rules.
220+
221+
4. **Regular Updates**: Keep the system and Docker images updated with security patches.
222+
223+
5. **Audit Logs**: Regularly review access logs and security events for suspicious activity.
224+
197225
### Security Features
198226
199227
| Feature | Description | Configuration |
@@ -414,6 +442,102 @@ To test if blacklisting works:
414442
2. Attempt to access a resource from that IP or domain
415443
3. Verify the request is blocked (check logs)
416444

445+
### Running the Test Suite
446+
447+
Execute the comprehensive end-to-end test suite:
448+
449+
```bash
450+
# Make sure services are running
451+
docker-compose up -d
452+
453+
# Run tests
454+
cd tests
455+
python3 e2e_test.py
456+
457+
# Run with verbose output
458+
python3 e2e_test.py -v
459+
```
460+
461+
## ❓ Frequently Asked Questions (FAQ)
462+
463+
### General Questions
464+
465+
**Q: What is Secure Proxy Manager?**
466+
A: It's a containerized web proxy solution built on Squid with a modern management interface for filtering, monitoring, and controlling web traffic.
467+
468+
**Q: Is this suitable for production use?**
469+
A: Yes, but ensure you follow security best practices, change default credentials, and properly configure SSL certificates for HTTPS filtering.
470+
471+
**Q: Can I use this in a corporate environment?**
472+
A: Yes, it's designed for enterprise use with features like blacklisting, authentication, and detailed logging. Ensure compliance with your organization's policies.
473+
474+
### Installation & Setup
475+
476+
**Q: Which ports need to be open?**
477+
A: Port 8011 (Web UI), 3128 (Proxy), and optionally 5001 (Backend API for direct access).
478+
479+
**Q: Can I change the default credentials?**
480+
A: Yes! Modify `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` in `docker-compose.yml` before starting the services.
481+
482+
**Q: How do I update to the latest version?**
483+
A:
484+
```bash
485+
git pull
486+
docker-compose down
487+
docker-compose build --no-cache
488+
docker-compose up -d
489+
```
490+
491+
### Features & Usage
492+
493+
**Q: How do I import a large blacklist?**
494+
A: Use the import API endpoints with a URL pointing to your blacklist file:
495+
```bash
496+
curl -X POST http://localhost:8011/api/domain-blacklist/import \
497+
-H "Content-Type: application/json" \
498+
-H "Authorization: Basic $(echo -n admin:admin | base64)" \
499+
-d '{"url": "https://example.com/blacklist.txt"}'
500+
```
501+
502+
**Q: Does it support IPv6?**
503+
A: Yes, IPv6 addresses can be added to the IP blacklist, including CIDR notation.
504+
505+
**Q: Can I filter HTTPS traffic?**
506+
A: Yes, by enabling HTTPS filtering and installing the SSL certificate on client devices. Note: This performs man-in-the-middle inspection.
507+
508+
**Q: How do I view blocked requests?**
509+
A: Check the logs in the Web UI dashboard or query via API: `http://localhost:8011/api/logs/stats`
510+
511+
### Performance & Scaling
512+
513+
**Q: What are the resource requirements?**
514+
A: Minimum 1 CPU core and 1GB RAM. For production with heavy traffic, 2+ CPU cores and 4GB+ RAM recommended.
515+
516+
**Q: Can I run multiple instances?**
517+
A: Yes, you can deploy multiple instances behind a load balancer for high availability.
518+
519+
**Q: How much disk space does caching use?**
520+
A: Default is 1GB. Adjust the cache size in performance tuning settings based on your needs (5-10GB recommended for production).
521+
522+
### Troubleshooting
523+
524+
**Q: Services won't start - what should I check?**
525+
A:
526+
1. Ensure Docker and Docker Compose are installed and running
527+
2. Check for port conflicts: `docker-compose logs`
528+
3. Verify volumes have correct permissions
529+
4. Wait for backend health check (may take 10-15 seconds)
530+
531+
**Q: Why am I getting SSL certificate warnings?**
532+
A: The SSL certificate needs to be installed on each client device. See [Custom SSL Certificate](#custom-ssl-certificate) section.
533+
534+
**Q: Import is failing - what's wrong?**
535+
A: Common causes:
536+
- Invalid format (ensure one entry per line or valid JSON)
537+
- Network issues (URL not accessible)
538+
- Authentication failure (check credentials)
539+
- Check logs: `docker-compose logs backend`
540+
417541
## 🔍 Troubleshooting
418542

419543
### Common Issues

examples/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Examples Directory
2+
3+
This directory contains practical examples and scripts for using Secure Proxy Manager.
4+
5+
## Available Examples
6+
7+
### 📄 [import_blacklists.md](import_blacklists.md)
8+
9+
Comprehensive guide for importing blacklists via the API, including:
10+
- Domain blacklist imports from URLs and direct content
11+
- IP blacklist imports with CIDR notation support
12+
- JSON and plain text format examples
13+
- Response format examples and error handling
14+
15+
### 🔧 [test_import.sh](test_import.sh)
16+
17+
Shell script for testing blacklist import functionality.
18+
19+
## Usage
20+
21+
Each example file contains complete, copy-paste ready code snippets. Make sure to:
22+
23+
1. Replace `admin:admin` with your actual credentials
24+
2. Update URLs to point to your actual blacklist sources
25+
3. Adjust port numbers if you've customized your deployment
26+
27+
## Need More Examples?
28+
29+
If you'd like to see examples for specific use cases:
30+
31+
1. Check the [API Documentation](../README.md#-api-documentation) in the main README
32+
2. Review the [FAQ](../README.md#-frequently-asked-questions-faq) section
33+
3. [Open an issue](https://github.com/fabriziosalmi/secure-proxy-manager/issues) to request new examples
34+
35+
## Contributing Examples
36+
37+
Have a useful example to share? We'd love to include it! Please:
38+
39+
1. Follow the existing format and style
40+
2. Test your example thoroughly
41+
3. Include clear comments and explanations
42+
4. Submit a pull request with your addition
43+
44+
See [CONTRIBUTING.md](../CONTRIBUTING.md) for detailed contribution guidelines.

examples/test_import.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
#!/bin/bash
2+
#
3+
# Blacklist Import Test Script
4+
#
5+
# This script tests the blacklist import functionality of Secure Proxy Manager.
6+
# It demonstrates importing both domain and IP blacklists using different methods.
7+
#
8+
# Prerequisites:
9+
# - Secure Proxy Manager running (docker-compose up -d)
10+
# - curl installed
11+
# - Default credentials (admin/admin) or update AUTH_HEADER below
12+
#
13+
# Usage:
14+
# ./test_import.sh
15+
#
16+
# Author: Secure Proxy Manager Contributors
17+
# License: MIT
18+
#
219

320
# Test script for blacklist import functionality
421
# This script demonstrates that the API already supports plain text files

0 commit comments

Comments
 (0)