mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix(console): the console page judges a TCP/TLS console by the running VM
The page's "listens only on its host" check read the VM's next-start definition, while novncd connects to the running VM's listener: after a listen address change on a running VM, the page refused a console novncd could reach, or let through one it could not. The page now reads the running VM's listener, as novncd does, with the same loopback test, which moves to vrtManager.util.
This commit is contained in:
parent
1d2de7404b
commit
976955fff8
4 changed files with 25 additions and 15 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import ipaddress
|
||||
import random
|
||||
import secrets
|
||||
import re
|
||||
|
|
@ -224,3 +225,11 @@ def vol_driver_type(vol_format, pool_type=None):
|
|||
if pool_type == "disk" or vol_format in (None, "", "none", "unknown", "iso"):
|
||||
return "raw"
|
||||
return vol_format
|
||||
|
||||
|
||||
def is_loopback(address):
|
||||
"""127.0.0.0/8, ::1 or localhost: reachable only on that host itself."""
|
||||
try:
|
||||
return ipaddress.ip_address(address).is_loopback
|
||||
except ValueError:
|
||||
return address == "localhost"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue