@@ -31,11 +31,12 @@ doctl compute droplet create pairux-turn \
3131### 2. Deploy
3232
3333``` bash
34- cd apps/turn
35- ./deploy-droplet .sh < DROPLET_IP > < TURN_PASSWORD >
34+ # SSH to droplet and run setup script
35+ ssh root@ < DROPLET_IP > " curl -fsSL https://raw.githubusercontent.com/profullstack/pairux.com/master/apps/turn/setup-turn-server .sh | bash -s -- 'YOUR_PASSWORD' "
3636
37- # Example:
38- ./deploy-droplet.sh 164.92.105.42 ' super-secure-password-123'
37+ # Or copy and run locally
38+ scp apps/turn/setup-turn-server.sh root@< DROPLET_IP> :/root/
39+ ssh root@< DROPLET_IP> " ./setup-turn-server.sh 'YOUR_PASSWORD'"
3940```
4041
4142### 3. Add DNS
@@ -46,13 +47,47 @@ Add an A record: `turn.pairux.com` → `<droplet-ip>`
4647
4748``` bash
4849# From anywhere
49- turnutils_uclient -t -u pairux -w YOUR_PASSWORD turn.pairux.com
50+ turnutils_uclient -t -u ubuntu -w YOUR_PASSWORD turn.pairux.com
5051```
5152
5253** Cost:** ~ $6/month (1 vCPU, 1GB RAM)
5354
5455---
5556
57+ ## GitHub Actions Deployment
58+
59+ The TURN server can be automatically deployed via GitHub Actions when changes are pushed to ` apps/turn/ ` .
60+
61+ ### Required GitHub Secrets
62+
63+ | Secret | Description |
64+ | ------------------------ | ------------------------------------------- |
65+ | ` DROPLET_HOST ` | Droplet IP address (e.g., ` 143.198.96.161 ` ) |
66+ | ` DROPLET_PORT ` | SSH port (default: ` 22 ` ) |
67+ | ` DROPLET_USER ` | SSH user (e.g., ` root ` or ` ubuntu ` ) |
68+ | ` DROPLET_SSH_KEY ` | Private SSH key (base64 encoded) |
69+ | ` TURN_SERVER_CREDENTIAL ` | TURN password |
70+
71+ ### Add Secrets
72+
73+ ``` bash
74+ # Encode your SSH private key
75+ cat ~ /.ssh/id_rsa | base64 -w 0
76+
77+ # Add to GitHub:
78+ # Settings → Secrets and variables → Actions → New repository secret
79+ ```
80+
81+ ### Manual Trigger
82+
83+ You can also trigger deployment manually:
84+
85+ ``` bash
86+ gh workflow run deploy-turn.yml
87+ ```
88+
89+ ---
90+
5691## Configuration
5792
5893### Ports Required
@@ -85,12 +120,12 @@ const config = {
85120 // TURN fallback (when direct connections fail)
86121 {
87122 urls: ' turn:turn.pairux.com:3478' ,
88- username: ' pairux ' ,
123+ username: ' ubuntu ' ,
89124 credential: process .env .TURN_PASSWORD ,
90125 },
91126 {
92127 urls: ' turns:turn.pairux.com:5349' ,
93- username: ' pairux ' ,
128+ username: ' ubuntu ' ,
94129 credential: process .env .TURN_PASSWORD ,
95130 },
96131 ],
@@ -119,7 +154,7 @@ If you prefer not to self-host:
119154
1201551 . Go to https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
1211562 . Add server: ` turn:turn.pairux.com:3478 `
122- 3 . Enter username: ` pairux `
157+ 3 . Enter username: ` ubuntu `
1231584 . Enter password: ` <your-password> `
1241595 . Click "Gather candidates"
1251606 . Look for ` relay ` candidates
@@ -134,7 +169,7 @@ apt install coturn-utils
134169turnutils_uclient -p 3478 turn.pairux.com
135170
136171# Test TURN
137- turnutils_uclient -t -u pairux -w YOUR_PASSWORD turn.pairux.com
172+ turnutils_uclient -t -u ubuntu -w YOUR_PASSWORD turn.pairux.com
138173```
139174
140175---
@@ -143,13 +178,14 @@ turnutils_uclient -t -u pairux -w YOUR_PASSWORD turn.pairux.com
143178
144179``` bash
145180# Check status
146- ssh root@< droplet-ip> " docker compose -f /opt/pairux-turn/docker-compose.yml ps "
181+ ssh root@< droplet-ip> " systemctl status coturn "
147182
148183# View logs
149- ssh root@< droplet-ip> " docker compose -f /opt/pairux-turn/docker-compose.yml logs -f"
184+ ssh root@< droplet-ip> " tail -f /var/log/turnserver.log"
185+ ssh root@< droplet-ip> " journalctl -u coturn -f"
150186
151187# Restart
152- ssh root@< droplet-ip> " docker compose -f /opt/pairux-turn/docker-compose.yml restart"
188+ ssh root@< droplet-ip> " systemctl restart coturn "
153189```
154190
155191---
0 commit comments