Skip to content

Commit 6e6f7eb

Browse files
docs: Fix API endpoints, update backup section, improve accuracy
Co-authored-by: fabriziosalmi <[email protected]>
1 parent 3b8ddf0 commit 6e6f7eb

File tree

1 file changed

+110
-38
lines changed

1 file changed

+110
-38
lines changed

README.md

Lines changed: 110 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A containerized secure proxy with advanced filtering capabilities, real-time mon
1818
- [Configuration Options](#️-configuration-options)
1919
- [Advanced Configuration](#️-advanced-configuration)
2020
- [Monitoring and Analytics](#-monitoring-and-analytics)
21-
- [Backup and Restore](#-backup-and-restore)
21+
- [Database Export and Backup](#-database-export-and-backup)
2222
- [Testing and Validation](#-testing-and-validation)
2323
- [Troubleshooting](#-troubleshooting)
2424
- [API Documentation](#-api-documentation)
@@ -166,20 +166,33 @@ secure-proxy-manager/
166166

167167
4. **Configure your client devices**:
168168
- Set proxy server to your host's IP address, port 3128
169-
- For transparent proxying, see the Network Configuration section
169+
- For transparent proxying, see the [Transparent Proxy Setup](#transparent-proxy-setup) section
170170

171171
## ⚙️ Configuration Options
172172

173173
### Environment Variables
174174

175-
| Variable | Description | Default |
176-
|----------|-------------|---------|
177-
| `PROXY_HOST` | Proxy service hostname | `proxy` |
178-
| `PROXY_PORT` | Proxy service port | `3128` |
179-
| `BASIC_AUTH_USERNAME` | Basic auth username | `admin` |
180-
| `BASIC_AUTH_PASSWORD` | Basic auth password | `admin` |
181-
| `SECRET_KEY` | Flask secret key | Auto-generated |
182-
| `LOG_LEVEL` | Logging level | `INFO` |
175+
#### Backend Service Variables
176+
| Variable | Description | Default | Used By |
177+
|----------|-------------|---------|---------|
178+
| `FLASK_ENV` | Flask environment mode | `production` | Backend, UI |
179+
| `PROXY_HOST` | Proxy service hostname | `proxy` | Backend |
180+
| `PROXY_PORT` | Proxy service port | `3128` | Backend |
181+
| `BASIC_AUTH_USERNAME` | Basic auth username | `admin` | Backend, UI |
182+
| `BASIC_AUTH_PASSWORD` | Basic auth password | `admin` | Backend, UI |
183+
| `SECRET_KEY` | Flask secret key for sessions | Auto-generated | Backend, UI |
184+
| `PROXY_CONTAINER_NAME` | Docker container name for proxy | `secure-proxy-proxy-1` | Backend |
185+
186+
#### Web UI Service Variables
187+
| Variable | Description | Default | Notes |
188+
|----------|-------------|---------|-------|
189+
| `BACKEND_URL` | Backend API URL | `http://backend:5000` | Internal Docker network |
190+
| `REQUEST_TIMEOUT` | API request timeout (seconds) | `30` | Increase for slow networks |
191+
| `MAX_RETRIES` | Maximum API retry attempts | `5` | For backend connection |
192+
| `BACKOFF_FACTOR` | Retry backoff multiplier | `1.0` | Exponential backoff |
193+
| `RETRY_WAIT_AFTER_STARTUP` | Wait time after startup (seconds) | `10` | Initial backend wait |
194+
195+
**Note:** To customize these values, modify them in `docker-compose.yml` before starting the services.
183196

184197
### Security Features
185198

@@ -207,14 +220,20 @@ secure-proxy-manager/
207220

208221
For HTTPS filtering with your own certificate:
209222

210-
1. Place your certificate and key in the `/config` directory:
223+
1. Place your certificate and key in the `config/` directory:
211224
- `ssl_cert.pem`: Your SSL certificate
212225
- `ssl_key.pem`: Your private key
213226

214227
2. Enable HTTPS filtering in the web interface:
215228
- Settings > Security > Enable HTTPS Filtering
216229

217-
3. Install the certificate on client devices to avoid warnings
230+
3. **Important:** Install the certificate on all client devices to avoid browser security warnings
231+
- **Windows**: Import to Trusted Root Certification Authorities
232+
- **macOS**: Add to Keychain and trust for SSL
233+
- **Linux**: Copy to `/usr/local/share/ca-certificates/` and run `update-ca-certificates`
234+
- **Mobile**: Email the certificate and install via device settings
235+
236+
**Note:** HTTPS filtering performs man-in-the-middle inspection. Only use this feature in environments where you have authorization to inspect traffic (e.g., corporate networks, your own devices).
218237

219238
### Transparent Proxy Setup
220239

@@ -272,12 +291,7 @@ curl -X POST http://localhost:8011/api/ip-blacklist/import \
272291
- **JSON Objects**: `[{"domain": "example.com", "description": "Blocked site"}]`
273292
- **Comments**: Lines starting with `#` are ignored
274293

275-
#### Schedule Automatic Updates
276-
277-
```bash
278-
curl -X POST http://localhost:8011/api/maintenance/update-blacklists \
279-
-H "Authorization: Basic $(echo -n admin:admin | base64)"
280-
```
294+
**Note:** For scheduled automatic blacklist updates, consider setting up a cron job or scheduled task that calls the import endpoints with your preferred blacklist sources.
281295

282296
## 📊 Monitoring and Analytics
283297

@@ -305,36 +319,79 @@ Health status endpoints are available for monitoring:
305319
curl -I http://localhost:8011/health
306320
```
307321

308-
## 🔄 Backup and Restore
322+
## 🔄 Database Export and Backup
309323

310-
### Configuration Backup
324+
### Database Export
311325

312-
Create a full system backup:
326+
Export database contents including blacklists, settings, and logs (limited to 10,000 most recent entries):
313327

314-
1. Via Web UI:
315-
- Maintenance > Backup Configuration > Download Backup
328+
1. Via API:
329+
```bash
330+
curl -X GET http://localhost:8011/api/database/export \
331+
-H "Authorization: Basic $(echo -n admin:admin | base64)" \
332+
> secure-proxy-export.json
333+
```
316334

317-
2. Via API:
335+
2. Via Direct Backend Access:
318336
```bash
319-
curl -X GET http://localhost:8011/api/maintenance/backup-config \
337+
curl -X GET http://localhost:5001/api/database/export \
320338
-H "Authorization: Basic $(echo -n admin:admin | base64)" \
321-
> secure-proxy-backup.json
339+
> secure-proxy-export.json
322340
```
323341

324-
### Configuration Restore
342+
### Manual Database Backup
325343

326-
Restore from a previous backup:
344+
For complete database backup including all logs:
327345

328-
1. Via Web UI:
329-
- Maintenance > Restore Configuration > Upload Backup
346+
```bash
347+
# Stop the services
348+
docker-compose down
330349

331-
2. Via API:
332-
```bash
333-
curl -X POST http://localhost:8011/api/maintenance/restore-config \
334-
-H "Content-Type: application/json" \
335-
-H "Authorization: Basic $(echo -n admin:admin | base64)" \
336-
-d @secure-proxy-backup.json
337-
```
350+
# Backup the database file
351+
cp data/secure_proxy.db data/secure_proxy.db.backup
352+
353+
# Backup configuration files
354+
tar -czf config-backup.tar.gz config/
355+
356+
# Restart services
357+
docker-compose up -d
358+
```
359+
360+
### Database Restore
361+
362+
To restore from a manual backup:
363+
364+
```bash
365+
# Stop the services
366+
docker-compose down
367+
368+
# Restore the database file
369+
cp data/secure_proxy.db.backup data/secure_proxy.db
370+
371+
# Restore configuration files
372+
tar -xzf config-backup.tar.gz
373+
374+
# Restart services
375+
docker-compose up -d
376+
```
377+
378+
### Database Optimization
379+
380+
Optimize database performance:
381+
382+
```bash
383+
curl -X POST http://localhost:8011/api/database/optimize \
384+
-H "Authorization: Basic $(echo -n admin:admin | base64)"
385+
```
386+
387+
### Database Statistics
388+
389+
Get database size and statistics:
390+
391+
```bash
392+
curl -X GET http://localhost:8011/api/database/stats \
393+
-H "Authorization: Basic $(echo -n admin:admin | base64)"
394+
```
338395

339396
## 🧪 Testing and Validation
340397

@@ -635,4 +692,19 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
635692

636693
## 📞 Support
637694

638-
- Create an issue in the GitHub repository
695+
If you need help or have questions:
696+
697+
- **Bug Reports**: [Create an issue](https://github.com/fabriziosalmi/secure-proxy-manager/issues/new) with detailed information
698+
- **Feature Requests**: [Open an issue](https://github.com/fabriziosalmi/secure-proxy-manager/issues/new) describing your idea
699+
- **Questions**: Check [existing issues](https://github.com/fabriziosalmi/secure-proxy-manager/issues) or create a new one
700+
- **Documentation**: Review this README and [CONTRIBUTING.md](CONTRIBUTING.md)
701+
702+
When reporting issues, please include:
703+
- Your environment (OS, Docker version, etc.)
704+
- Steps to reproduce the problem
705+
- Expected vs actual behavior
706+
- Relevant logs from `docker-compose logs`
707+
708+
---
709+
710+
**Made with ❤️ by the Secure Proxy Manager community**

0 commit comments

Comments
 (0)