Fold init-only VNC and SSH setters into Config-struct constructors

This commit is contained in:
Viktor Liu
2026-05-22 13:32:25 +02:00
parent f00b34f3a7
commit 8ca5c2f4b4
7 changed files with 116 additions and 113 deletions
+6 -3
View File
@@ -54,9 +54,12 @@ var vncAgentCmd = &cobra.Command{
// The per-user agent listens only on loopback and is gated by an
// agent token shared with the daemon, so no X25519 identity key
// is needed; auth is disabled at the RFB layer.
srv := vncserver.New(capturer, injector, nil)
srv.SetDisableAuth(true)
srv.SetAgentToken(token)
srv := vncserver.New(vncserver.Config{
Capturer: capturer,
Injector: injector,
DisableAuth: true,
AgentTokenHex: token,
})
addr := netip.AddrPortFrom(netip.AddrFrom4([4]byte{127, 0, 0, 1}), vncAgentPort)
loopback := netip.PrefixFrom(netip.AddrFrom4([4]byte{127, 0, 0, 0}), 8)