Spaces:
Sleeping
Sleeping
Ajit Panday commited on
Commit ·
3bfc394
1
Parent(s): 28721de
Add network requirements and port configuration
Browse files- SETUP_GUIDE.md +71 -0
SETUP_GUIDE.md
CHANGED
|
@@ -413,4 +413,75 @@
|
|
| 413 |
|
| 414 |
# Make script executable
|
| 415 |
chmod +x monitor_db.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
```
|
|
|
|
| 413 |
|
| 414 |
# Make script executable
|
| 415 |
chmod +x monitor_db.sh
|
| 416 |
+
```
|
| 417 |
+
|
| 418 |
+
## Network Requirements
|
| 419 |
+
|
| 420 |
+
### Required Ports
|
| 421 |
+
|
| 422 |
+
1. **Customer Server to Hugging Face Space**
|
| 423 |
+
- Port 443 (HTTPS) - For API communication
|
| 424 |
+
- Port 3306 (MySQL) - For database connections (if using external database)
|
| 425 |
+
|
| 426 |
+
2. **Customer Server to Customer Database**
|
| 427 |
+
- Port 3306 (MySQL) - For database connections
|
| 428 |
+
- Ensure database server is accessible from customer's network
|
| 429 |
+
|
| 430 |
+
3. **Asterisk Server Requirements**
|
| 431 |
+
- Port 5060 (SIP) - For VoIP communication
|
| 432 |
+
- Port 10000-20000 (RTP) - For audio streaming
|
| 433 |
+
- Port 5038 (AMI) - For Asterisk Manager Interface (optional)
|
| 434 |
+
|
| 435 |
+
### Network Configuration
|
| 436 |
+
|
| 437 |
+
1. **Firewall Rules**
|
| 438 |
+
```bash
|
| 439 |
+
# Allow outbound HTTPS to Hugging Face
|
| 440 |
+
sudo ufw allow out 443/tcp
|
| 441 |
+
|
| 442 |
+
# Allow outbound MySQL to database
|
| 443 |
+
sudo ufw allow out 3306/tcp
|
| 444 |
+
|
| 445 |
+
# Allow SIP and RTP ports
|
| 446 |
+
sudo ufw allow 5060/udp
|
| 447 |
+
sudo ufw allow 10000:20000/udp
|
| 448 |
+
```
|
| 449 |
+
|
| 450 |
+
2. **Security Groups (if using cloud providers)**
|
| 451 |
+
- Allow inbound HTTPS (443) from Hugging Face IPs
|
| 452 |
+
- Allow inbound MySQL (3306) from customer server IP
|
| 453 |
+
- Allow inbound SIP (5060) and RTP (10000-20000) from VoIP providers
|
| 454 |
+
|
| 455 |
+
3. **Network Testing**
|
| 456 |
+
```bash
|
| 457 |
+
# Test HTTPS connection to Hugging Face
|
| 458 |
+
curl -v https://your-huggingface-space-url
|
| 459 |
+
|
| 460 |
+
# Test MySQL connection
|
| 461 |
+
mysql -h your-db-host -u your-user -p -e "SELECT 1;"
|
| 462 |
+
|
| 463 |
+
# Test SIP connectivity
|
| 464 |
+
sipshowpeers
|
| 465 |
+
```
|
| 466 |
+
|
| 467 |
+
### VPN Requirements (Optional)
|
| 468 |
+
|
| 469 |
+
1. **Site-to-Site VPN**
|
| 470 |
+
- Recommended for secure database access
|
| 471 |
+
- Configure VPN between customer network and database network
|
| 472 |
+
- Use VPN for all database traffic
|
| 473 |
+
|
| 474 |
+
2. **VPN Configuration**
|
| 475 |
+
```bash
|
| 476 |
+
# Example OpenVPN configuration
|
| 477 |
+
client
|
| 478 |
+
dev tun
|
| 479 |
+
proto udp
|
| 480 |
+
remote your-vpn-server 1194
|
| 481 |
+
resolv-retry infinite
|
| 482 |
+
nobind
|
| 483 |
+
persist-key
|
| 484 |
+
persist-tun
|
| 485 |
+
remote-cert-tls server
|
| 486 |
+
auth-user-pass auth.txt
|
| 487 |
```
|