2.1 KiB
2.1 KiB
Milestone 6: Deployment & Automation (The Release)
Goal: Finalize security and automate the installation for self-hosters.
1. Network Encryption
- TCP TLS: Wrap the server's
TcpListenerand client'sTcpStreamusingrustls. Generate or require self-signed certificates for the server. - AI Context Trap (Crypto Nonce):
chacha20poly1305is completely compromised if a Nonce is reused. To avoid tracking state or sending large random bytes over UDP, strictly cast theSequenceNumber(u64) padded with zeros into a 12-byte array to act as a guaranteed-unique Nonce. - UDP Encryption: Add
chacha20poly1305. After Opus encoding, encrypt the payload byte array using a symmetric key negotiated during the TLS TCP handshake, before sending over UDP.
2. Dockerization
- Dockerfile: Write a multi-stage
Dockerfile. Stage 1:cargo build --releaseusing a minimal rust alpine image. Stage 2: Copy the binary to a scratch/debian container. - Docker Compose: Write
docker-compose.ymlmapping ports8080/tcp(Control),8080/udp(Voice), and3000/tcp(Admin Dashboard), and volume-mapping the SQLite database file.
3. CI/CD & Auto-Installer
- GitHub Actions: Create
.github/workflows/release.yml. Trigger on tags. Cross-compile binaries forx86_64-linux,x86_64-windows, andaarch64-macos. - Security Auditing: Add
cargo auditto the pipeline to automatically fail the build if a known CVE is discovered. - Install Script: Write
scripts/install.sh. The script downloads the correct binary via GitHub API, creates a non-rootvoiceappuser, and writes a/etc/systemd/system/voiceapp.servicefile.
4. The Final Stress Test
- Load Tester Bot: Build a standalone Rust binary (
tests/load_tester.rs). - Concurrency: Use Tokio to spawn 100+ async tasks. Each task connects via TCP, gets a SessionToken, and then blasts pre-recorded
.wavdata over UDP to the server at exactly 20ms intervals. - Verification: Use the Admin Dashboard to verify the server handles the packet throughput without CPU spiking or crashing.