consoles: Make a non-shared connection when asking remote to resize#2268
Conversation
37381be to
35bc33d
Compare
35bc33d to
4c5c848
Compare
|
fedora-43 now has cockpit 346, which has cockpit-project/cockpit#22376. |
605af3a to
ece9cf3
Compare
test/check-machines-consoles
Outdated
|
|
||
| b2.select_PF("#vm-console-vnc-scaling", "Remote resizing") | ||
|
|
||
| cockpit_version = int(m.execute('(/usr/libexec/cockpit-ws --version' |
There was a problem hiding this comment.
We can simplify this by finding the list of images that don't have 346. That's probably just rhel-9 and centos-9, and those will never get it.
There was a problem hiding this comment.
Yes, agreed to keep a shrinking static OS l ist. This is quite a lot of error prone version checking here. Or if you prefer a runtime check, perhaps check b.eval_js('cockpit.transport.options.capabilities')?
|
I think tumbleweed and ubuntu-stable will get 346 pretty soon, no? We could wait for them, then we have a stable list of images that don't have the fix, I think. |
9d18401 to
6448a14
Compare
|
@mvollmer u-stable will never get 346. That's only in backports (once it gets approved), but we need to support the shipped version, too. |
6448a14 to
5a3f069
Compare
|
Ubuntu is hard to get green in general. I blame the Browser.open bidi timeout.. |
|
@martinpitt, what do you think? Should we check the cockpit version to figure out what cockpit is going to do, or have a list of OSes? I think the list is better and it is probably very stable once opensuse-tumbleweed has Cockpit 346. |
|
|
||
| const caps = cockpit.transport.options.capabilities; | ||
| const bug_is_fixed = Array.isArray(caps) && caps.includes("websocket-channel-close-fix"); | ||
| const shared = !(resizeSession && bug_is_fixed); |
There was a problem hiding this comment.
That's a good idea in general, but what happens to an existing connection? If it starts out with "resize server" and you switch it to e.g. "local scaling", it won't automatically become shared. Worse, if you start with "local scaling" and change to "resize server", it will stay private. Or does that reconnect internally?
There was a problem hiding this comment.
It will reconnect. Every change to the scale/resize settings will lead to a reconnection, because of the way the React wrapper is written. (That wrapper is now in our control, so we could improve that.)
test/check-machines-consoles
Outdated
|
|
||
| b2.select_PF("#vm-console-vnc-scaling", "Remote resizing") | ||
|
|
||
| cockpit_version = int(m.execute('(/usr/libexec/cockpit-ws --version' |
There was a problem hiding this comment.
Yes, agreed to keep a shrinking static OS l ist. This is quite a lot of error prone version checking here. Or if you prefer a runtime check, perhaps check b.eval_js('cockpit.transport.options.capabilities')?
test/check-machines-consoles
Outdated
| ' | grep ^Version: | cut -d" " -f2')) | ||
|
|
||
| if cockpit_version >= 346: | ||
| if not m.image.startswith(("rhel-9", "centos-9", "ubuntu-", "debian-trixie", "opensuse-")): |
There was a problem hiding this comment.
ah yes, this looks better. But for clarity, perhaps spell out "opensuse-tumbleweed", just in case we get SLES at some point. We'll have to do a lockstep machines/bots update when tumbleweed updates, but we gain robustness.
It doesn't feel like a good idea to let multiple clients each try to resize the remote end. This also gives us a easy way to make non-shared connections in our tests, which we will use in the future.
5a3f069 to
7a7972d
Compare
It doesn't feel like a good idea to let multiple clients each try to resize the remote end.
This also gives us a easy way to make non-shared connections in our tests, which we will use in the future.
Machines: Cockpit can make exclusive VNC connections
A VNC viewer can tell the VNC server whether or not it wants exclusive access to it, or whether it is okay that multiple viewers display and interact with the same console. Until now, Cockpit has always allowed shared access when it connects.
Now, Cockpit will request exclusive access when it is in the "Remote resizing" mode, to avoid having multiple viewers make conflicting resize requests.
The feature requires the web server from Cockpit 346.