mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
fix: fix remote deployment method (#145)
* fix: disable file logging for docker compose mode * fix: wait for processes in Docker compose mode * fix: add default turn server conf for remote mode * remove sentence transformers * make turn detection configurable
This commit is contained in:
parent
7d1e22d53c
commit
87fc64d55c
19 changed files with 290 additions and 573 deletions
|
|
@ -6,37 +6,51 @@ class TestIsPrivateIpCandidate:
|
|||
|
||||
def test_private_ip_192_168(self):
|
||||
"""192.168.x.x addresses are detected as private."""
|
||||
candidate = "candidate:123 1 udp 2122260223 192.168.50.24 63603 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:123 1 udp 2122260223 192.168.50.24 63603 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_private_ip_10_x(self):
|
||||
"""10.x.x.x addresses are detected as private."""
|
||||
candidate = "candidate:456 1 udp 2122260223 10.0.0.1 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:456 1 udp 2122260223 10.0.0.1 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_private_ip_172_16(self):
|
||||
"""172.16.x.x addresses are detected as private."""
|
||||
candidate = "candidate:789 1 udp 2122260223 172.16.0.1 54321 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:789 1 udp 2122260223 172.16.0.1 54321 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_private_ip_172_31(self):
|
||||
"""172.31.x.x addresses are detected as private."""
|
||||
candidate = "candidate:101 1 udp 2122260223 172.31.255.255 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:101 1 udp 2122260223 172.31.255.255 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_cgnat_ip(self):
|
||||
"""CGNAT addresses (100.64.0.0/10) are detected as private."""
|
||||
candidate = "candidate:202 1 udp 2122260223 100.64.0.1 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:202 1 udp 2122260223 100.64.0.1 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_cgnat_ip_upper_bound(self):
|
||||
"""Upper bound of CGNAT range is detected."""
|
||||
candidate = "candidate:303 1 udp 2122260223 100.127.255.255 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:303 1 udp 2122260223 100.127.255.255 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_public_ip(self):
|
||||
"""Public IP addresses return False."""
|
||||
candidate = "candidate:404 1 udp 2122260223 142.250.190.46 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:404 1 udp 2122260223 142.250.190.46 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is False
|
||||
|
||||
def test_public_ip_8_8_8_8(self):
|
||||
|
|
@ -46,17 +60,23 @@ class TestIsPrivateIpCandidate:
|
|||
|
||||
def test_non_cgnat_100_range(self):
|
||||
"""100.x.x.x outside CGNAT range is public."""
|
||||
candidate = "candidate:606 1 udp 2122260223 100.128.0.1 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:606 1 udp 2122260223 100.128.0.1 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is False
|
||||
|
||||
def test_172_15_is_public(self):
|
||||
"""172.15.x.x is outside private range and should be public."""
|
||||
candidate = "candidate:707 1 udp 2122260223 172.15.255.255 12345 typ srflx generation 0"
|
||||
candidate = (
|
||||
"candidate:707 1 udp 2122260223 172.15.255.255 12345 typ srflx generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is False
|
||||
|
||||
def test_172_32_is_public(self):
|
||||
"""172.32.x.x is outside private range and should be public."""
|
||||
candidate = "candidate:808 1 udp 2122260223 172.32.0.1 12345 typ srflx generation 0"
|
||||
candidate = (
|
||||
"candidate:808 1 udp 2122260223 172.32.0.1 12345 typ srflx generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is False
|
||||
|
||||
def test_srflx_candidate_type(self):
|
||||
|
|
@ -66,17 +86,23 @@ class TestIsPrivateIpCandidate:
|
|||
|
||||
def test_relay_candidate_type(self):
|
||||
"""Relay candidates are parsed correctly."""
|
||||
candidate = "candidate:111 1 udp 41885439 1.1.1.1 50000 typ relay raddr 0.0.0.0 rport 0"
|
||||
candidate = (
|
||||
"candidate:111 1 udp 41885439 1.1.1.1 50000 typ relay raddr 0.0.0.0 rport 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is False
|
||||
|
||||
def test_loopback_ip(self):
|
||||
"""Loopback addresses are detected as private."""
|
||||
candidate = "candidate:222 1 udp 2122260223 127.0.0.1 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:222 1 udp 2122260223 127.0.0.1 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_link_local_ip(self):
|
||||
"""Link-local addresses (169.254.x.x) are detected as private."""
|
||||
candidate = "candidate:333 1 udp 2122260223 169.254.1.1 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:333 1 udp 2122260223 169.254.1.1 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
||||
def test_ipv6_link_local(self):
|
||||
|
|
@ -100,7 +126,9 @@ class TestIsPrivateIpCandidate:
|
|||
|
||||
def test_malformed_candidate_invalid_ip(self):
|
||||
"""Candidate with invalid IP returns False."""
|
||||
candidate = "candidate:777 1 udp 2122260223 not.an.ip 12345 typ host generation 0"
|
||||
candidate = (
|
||||
"candidate:777 1 udp 2122260223 not.an.ip 12345 typ host generation 0"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is False
|
||||
|
||||
def test_malformed_candidate_short(self):
|
||||
|
|
@ -110,5 +138,7 @@ class TestIsPrivateIpCandidate:
|
|||
|
||||
def test_tcp_candidate(self):
|
||||
"""TCP candidates are parsed correctly."""
|
||||
candidate = "candidate:999 1 tcp 1518280447 192.168.1.100 9 typ host tcptype active"
|
||||
candidate = (
|
||||
"candidate:999 1 tcp 1518280447 192.168.1.100 9 typ host tcptype active"
|
||||
)
|
||||
assert is_private_ip_candidate(candidate) is True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue