lablink_client_service.agent.kasmvnc¶
lablink_client_service.agent.kasmvnc
¶
KasmVNC password-file rotation.
Two output formats, picked by the client container's CONNECTIVITY env:
-
allocator_proxied(AWS path; default): KasmVNC's username-based.kasmpasswdwritten by the bundledkasmvncpasswdCLI. The browser never sees credentials; allocator nginx attaches HTTP Basic Auth server-side via/internal/proxy_auth. -
lan_direct(manual/BYO path): the browser opens the WebSocket straight tows://<lan_ip>:6080with no proxy, and modern browsers refuse to attach anAuthorization: Basicheader to a WebSocket upgrade. So we drop HTTP-Basic on the client (-DisableBasicAuth) and use RFB-protocolVncAuthinstead — KasmVNC's bundled noVNC reads?password=and feeds it through the in-band VNC auth handshake. That requires the legacy RFB password file format: 8 bytes of single-DES-encrypted output, written here without an externalvncpasswdtool (KasmVNC's deb doesn't ship one).
The agent re-derives the file each session; no reload signal is needed (KasmVNC re-reads on each connection attempt, and SIGHUP would in fact terminate Xvnc via its unsupported reset path).
Attributes¶
DEFAULT_PASSWORD_FILE = '/home/client/.kasmpasswd'
module-attribute
¶
DEFAULT_VNCAUTH_FILE = '/home/client/.vnc/passwd'
module-attribute
¶
KASMVNC_USERNAME = 'kasm_user'
module-attribute
¶
Functions:¶
rotate_kasmvnc_password(*, password)
¶
Rewrite the KasmVNC password file for this connectivity mode.
See module docstring for the two formats; the choice is driven by
the CONNECTIVITY env var (lan_direct ⇒ RFB VncAuth file;
anything else, including unset ⇒ KasmVNC BasicAuth file).