Skip to content

feat: add WebSocket-based support tunnel (coexists with don) - #1134

Draft
edospadoni wants to merge 12 commits into
mainfrom
feature/support-tunnel
Draft

feat: add WebSocket-based support tunnel (coexists with don)#1134
edospadoni wants to merge 12 commits into
mainfrom
feature/support-tunnel

Conversation

@edospadoni

@edospadoni edospadoni commented Mar 26, 2026

Copy link
Copy Markdown
Member

Summary

Add a new WebSocket-based remote support system (tunnel-client) alongside the existing OpenVPN-based "don". The two systems coexist — when the tunnel-client is mature, don will be removed.

What's new

  • tunnel-client binary shipped in the core image (core/support-tunnel/)
  • Node actions: start-tunnel-client, stop-tunnel-client, get-tunnel-client-status — run on individual nodes
  • Cluster actions: start-tunnel-all-nodes, stop-tunnel-all-nodes, get-tunnel-all-nodes — orchestrate all nodes in parallel via agent.tasks.runp_brief()
  • support-tunnel.service systemd unit with RuntimeMaxSec=7d safety net (session expiry managed server-side by MY platform)
  • install-support-tunnel helper that extracts binary and plugins from the core image on each node
  • users.d/nethvoice plugin for ephemeral FreePBX user provisioning
  • diagnostics.d/health plugin that checks core services, Redis, modules, failed units, and TLS certs

How it works

  • Credentials come from cluster/support_tunnel Redis hash
  • The tunnel-client connects via WebSocket with yamux multiplexing
  • Service discovery is automatic via Traefik routes (all nodes)
  • User provisioning: leader creates cluster-admin + domain users, workers fetch credentials via USERS_FETCH stream
  • Diagnostics collected on connection and sent to the support service

Configuration

# Set tunnel credentials (on leader node)
redis-cli HSET cluster/support_tunnel url "wss://support.my.nethesis.it/api/tunnel"
redis-cli HSET cluster/support_tunnel key "NETH-..."
redis-cli HSET cluster/support_tunnel secret "..."
redis-cli HSET cluster/support_tunnel exclude_patterns "pattern1,pattern2"
redis-cli HSET cluster/support_tunnel tls_insecure "true"

# View current config
redis-cli HGETALL cluster/support_tunnel

Usage

# All nodes
api-cli run cluster/start-tunnel-all-nodes
api-cli run cluster/get-tunnel-all-nodes
api-cli run cluster/stop-tunnel-all-nodes

# Single node
api-cli run node/1/start-tunnel-client
api-cli run node/1/get-tunnel-client-status
api-cli run node/1/stop-tunnel-client

What's unchanged (don)

All existing OpenVPN support files remain untouched: support.service, start-support-session, stop-support-session, get-support-session, etc. The new system uses separate paths (/var/lib/nethserver/support-tunnel/) and service names.

Related: NethServer/my#47

github-actions Bot pushed a commit that referenced this pull request Mar 26, 2026
github-actions Bot pushed a commit that referenced this pull request Mar 27, 2026
github-actions Bot pushed a commit that referenced this pull request Mar 27, 2026
github-actions Bot pushed a commit that referenced this pull request Mar 27, 2026
github-actions Bot pushed a commit that referenced this pull request Mar 30, 2026
github-actions Bot pushed a commit that referenced this pull request Mar 30, 2026
github-actions Bot pushed a commit that referenced this pull request Mar 30, 2026
github-actions Bot pushed a commit that referenced this pull request Jun 5, 2026
github-actions Bot pushed a commit that referenced this pull request Jun 5, 2026
github-actions Bot pushed a commit that referenced this pull request Jun 8, 2026
edospadoni added a commit to NethServer/nethsecurity that referenced this pull request Jun 8, 2026
Keeps the binary in lockstep with NethServer/ns8-core#1134. The
cluster/module_domains lookup added in
NethServer/my@8e0b557d is a no-op on
NethSecurity but the shared binary is built from a single source.
edospadoni added a commit to NethServer/nethsecurity that referenced this pull request Jun 8, 2026
Keeps the binary in lockstep with NethServer/ns8-core#1134. The
module_domains refresh added in
NethServer/my@8666b3ef is NS8-only and a
no-op on NethSecurity but the shared binary is built from a single
source.
github-actions Bot pushed a commit that referenced this pull request Jun 8, 2026
…write, tls_insecure and exclude_patterns config
Picks up the discovery change from NethServer/my that orders nodes
leader → local → rest and merges Traefik routes first-writer-wins, so
cluster-wide services (e.g. cluster-admin) are reported as belonging to
the leader instead of whichever node iterated last. Source:
NethServer/my@352a0819
Picks up NethServer/my@73ee92c1 so the browser
terminal lands in the operator's home directory instead of the
tunnel-client's cwd (/).
Picks up NethServer/my@8e0b557d so consumer
modules (webtop, mail, …) resolve their user domain via the
cluster/module_domains hash and the support session UI can show the
provisioned domain user inside each module's accordion.
Picks up NethServer/my@8666b3ef so
modules installed after a support session has been opened (NethVoice
configured later, …) appear in the credentials modal with their
domain user.
@edospadoni
edospadoni force-pushed the feature/support-tunnel branch from 3de7d85 to 1be99e1 Compare June 24, 2026 09:22
github-actions Bot pushed a commit that referenced this pull request Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant