SKStacks - Platform stacks code repository
Find a file
chefboyrdave2.1 55a9ade95b chore: sanitize for public release — remove 173 vault files from tracking
All *_vault.yml files removed from git index and added to .gitignore.
Vault-encrypted secrets remain in the private skstack01-prod repo only.
Public repo retains full infrastructure-as-code, playbooks, templates,
and v2 platform scaffolds (k3d, RKE2, Swarm, K8s, ArgoCD, OpenTofu).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:29:31 -04:00
.forgejo chore: Update JZ trustee address in CI/CD workflow 2026-01-14 10:39:17 -05:00
.gemini Update project files: SKSSO, SKHA, SKETH contracts, documentation, and configuration updates 2025-11-21 16:48:06 -05:00
.github/workflows feat: Add top 10 features to SKGentis and SKEth Oracle 2025-11-22 09:31:43 -05:00
assets feat(skgentis): add RWA Vault Funding variables to prod vault and CI 2025-12-06 00:45:14 -05:00
coturn feat: add SKStacks v2 platform scaffolds + coturn expose tooling 2026-03-27 17:28:59 -04:00
docs feat: update service templates for production best practices 2025-11-01 15:12:50 -04:00
scripts feat: SKStacks infrastructure updates and SKGentis local dev support 2025-12-30 04:34:30 -05:00
shared Add SKGentisTrustCom submodule and network registry 2025-12-03 23:35:03 -05:00
v1 chore: sanitize for public release — remove 173 vault files from tracking 2026-03-27 17:29:31 -04:00
v2 feat(did): add did-setup.sh — one-shot DID provisioning for RKE2 nodes 2026-03-27 17:29:00 -04:00
.env.example feat: SKStacks infrastructure updates and SKGentis local dev support 2025-12-30 04:34:30 -05:00
.gitignore chore: sanitize for public release — remove 173 vault files from tracking 2026-03-27 17:29:31 -04:00
.gitmodules refactor: Restructure skgentis-oracle-api as top-level submodule 2025-12-12 06:27:41 -05:00
.windsurfrules feat: SKStacks infrastructure updates and SKGentis local dev support 2025-12-30 04:34:30 -05:00
LICENSE Initial commit 2026-03-27 17:28:59 -04:00
package-lock.json feat: Add top 10 features to SKGentis and SKEth Oracle 2025-11-22 09:31:43 -05:00
package.json feat: Add top 10 features to SKGentis and SKEth Oracle 2025-11-22 09:31:43 -05:00
README-expose.md feat: add SKStacks v2 platform scaffolds + coturn expose tooling 2026-03-27 17:28:59 -04:00
README-task-master.md feat: SKStacks infrastructure updates and SKGentis local dev support 2025-12-30 04:34:30 -05:00
README.md feat: add SKStacks v2 platform scaffolds + coturn expose tooling 2026-03-27 17:28:59 -04:00
rekey_vaults.sh Update: SKSSO, SKAI, SKMon, SKOrch, SKPeek, SKPulse, SKGentis configurations and documentation updates 2025-11-23 17:52:57 -05:00
skagent-expose.service feat: add SKStacks v2 platform scaffolds + coturn expose tooling 2026-03-27 17:28:59 -04:00

SKStacks — Sovereign Infrastructure Configs

Infrastructure-as-code configurations for the SKWorld sovereign stack.


Versions

Version Status Description
v2/ 🟢 Active development Multi-platform (Swarm + K8s + RKE2), pluggable secret backends
(v1 is private) Frozen Docker Swarm only, ansible-vault secrets

See v2/README.md for the full v2 architecture and quick start.


v2 Highlights

  • 3 secret backends: vault-file (Ansible) · HashiCorp Vault · CapAuth/PGP sovereign
  • 3 platforms: Docker Swarm · Kubernetes · RKE2 (Rancher, CIS-hardened)
  • 4 CI/CD targets: Forgejo Actions · GitHub Actions · GitLab CI · ArgoCD GitOps
  • Sanitized public templates — no real secrets, all CHANGEME_* placeholders

Standalone Services

Directory Service Purpose
coturn/ coturn TURN/STUN server WebRTC NAT traversal relay for turn.skworld.io

coturn — Sovereign TURN Server

STUN/TURN server for WebRTC ICE negotiation. Used by SKComm's WebRTC transport and SKChat voice/data channels as the NAT traversal fallback when direct P2P fails.

Domain: turn.skworld.io

Architecture

WebRTC Peer A                coturn                WebRTC Peer B
     │                          │                         │
     │── STUN binding req ──────→                         │
     │←── mapped address ────────                         │
     │                          │                         │
     │  (direct ICE fails)       │                         │
     │── TURN Allocate ──────────→                         │
     │←── relay address ─────────                         │
     │── TURN CreatePermission ──→ (for Peer B's IP)       │
     │                          │                         │
     │══ encrypted DTLS-SRTP through relay ════════════════│

For Tailscale-connected peers, the Tailscale 100.x IP is used as a host ICE candidate and Tailscale DERP handles relay — coturn is only needed for non-tailnet peers.

Quick Setup

1. Install coturn:

# Debian/Ubuntu
sudo apt install coturn

# Arch/Manjaro
sudo pacman -S coturn

2. Generate a shared secret:

openssl rand -hex 32
# → copy this into turnserver.conf static-auth-secret AND
#   into ~/.skcomm/config.yml transports.webrtc.settings.turn_secret
#   (or set SKCOMM_TURN_SECRET env var)

3. Deploy the config:

sudo cp coturn/turnserver.conf /etc/coturn/turnserver.conf
# Edit: set static-auth-secret, uncomment external-ip=YOUR_PUBLIC_IP

4. Set up TLS (recommended):

certbot certonly --standalone -d turn.skworld.io
# Then uncomment the cert/pkey lines in turnserver.conf

5. Open firewall ports:

ufw allow 3478/udp    # STUN/TURN
ufw allow 3478/tcp    # TURN over TCP
ufw allow 5349/tcp    # TURN over TLS
ufw allow 49152:65535/udp  # UDP relay range

6. Start and enable:

sudo systemctl enable --now coturn
sudo systemctl status coturn

Configuration Summary

Setting Value
STUN/TURN port 3478 (UDP + TCP)
TLS TURN port 5349
UDP relay range 4915265535
Realm turn.skworld.io
Auth HMAC-SHA1 time-limited credentials
Credential TTL 86400s (24h)
Private IP relay Denied (SSRF protection)

Client Integration (SKComm)

# ~/.skcomm/config.yml
transports:
  webrtc:
    enabled: true
    priority: 1
    settings:
      turn_server: "turn:turn.skworld.io:3478"
      turn_secret: "${SKCOMM_TURN_SECRET}"   # same secret as static-auth-secret

The SKComm WebRTC transport generates HMAC-SHA1 time-limited credentials automatically:

# credential = HMAC-SHA1(secret, f"{expiry}:{username}")
# username    = f"{expiry}:{agent_name}"

Testing

# Test STUN binding (should return your public IP)
stun turn.skworld.io

# Test TURN allocation (requires valid credentials)
turnutils_uclient -u "<expiry>:<username>" -w "<credential>" turn.skworld.io

# Check logs
journalctl -u coturn -f
tail -f /var/log/coturn/turnserver.log

License

GPL-3.0-or-later — Part of the smilinTux sovereign stack.