remoteRF-server-testing 0.0.11__tar.gz → 0.0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/PKG-INFO +1 -1
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/pyproject.toml +1 -1
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/serverrf_cli.py +70 -8
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server_testing.egg-info/PKG-INFO +1 -1
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/README.md +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/setup.cfg +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/grpc/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/grpc/grpc_host_pb2.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/grpc/grpc_host_pb2_grpc.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/grpc/grpc_pb2.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/grpc/grpc_pb2_grpc.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/idl/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/idl/device_schema.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/idl/pluto_schema.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/idl/schema.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/ansi_codes.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/api_token.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/db_connection.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/db_location.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/list_string.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/common/utils/process_arg.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/drivers/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/drivers/adalm_pluto/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/drivers/adalm_pluto/pluto_remote_server.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/host/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/host/host_auth_token.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/host/host_directory_store.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/host/host_tunnel_server.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/acc_perms.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/cert_provider.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/device_manager.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/grpc_server.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/reservation.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/rpc_manager.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/user_group_cli.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/server/user_group_handler.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/tools/__init__.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/tools/gen_certs.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/tools/gist_status.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/tools/gist_status_testing.py +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server_testing.egg-info/SOURCES.txt +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server_testing.egg-info/dependency_links.txt +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server_testing.egg-info/entry_points.txt +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server_testing.egg-info/requires.txt +0 -0
- {remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server_testing.egg-info/top_level.txt +0 -0
|
@@ -5,6 +5,8 @@ import os
|
|
|
5
5
|
import subprocess
|
|
6
6
|
import shutil
|
|
7
7
|
import re
|
|
8
|
+
import ssl
|
|
9
|
+
import ipaddress
|
|
8
10
|
from pathlib import Path
|
|
9
11
|
from typing import Optional, Dict, List, Tuple
|
|
10
12
|
from datetime import datetime, timezone
|
|
@@ -53,6 +55,59 @@ def _fmt_remaining(na_utc: datetime) -> str:
|
|
|
53
55
|
return f"{days}d {hours}h {mins}m"
|
|
54
56
|
|
|
55
57
|
|
|
58
|
+
_STATIC_IP_ENV_KEYS: Tuple[str, ...] = ("STATIC_IP", "SERVER_IP")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _is_ip_address(value: str) -> bool:
|
|
62
|
+
try:
|
|
63
|
+
ipaddress.ip_address((value or "").strip())
|
|
64
|
+
return True
|
|
65
|
+
except ValueError:
|
|
66
|
+
return False
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _x509_static_ip(cert_path: Path) -> str:
|
|
70
|
+
if not cert_path.exists():
|
|
71
|
+
raise FileNotFoundError(f"server cert not found: {cert_path}")
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
cert = ssl._ssl._test_decode_cert(str(cert_path))
|
|
75
|
+
except FileNotFoundError:
|
|
76
|
+
raise
|
|
77
|
+
except Exception as e:
|
|
78
|
+
raise ValueError(f"could not parse server cert {cert_path}: {e}") from e
|
|
79
|
+
|
|
80
|
+
for name, value in cert.get("subjectAltName", []):
|
|
81
|
+
if name.lower() == "ip address":
|
|
82
|
+
ip = (value or "").strip()
|
|
83
|
+
if ip:
|
|
84
|
+
return ip
|
|
85
|
+
|
|
86
|
+
for group in cert.get("subject", []):
|
|
87
|
+
for name, value in group:
|
|
88
|
+
if name.lower() != "commonname":
|
|
89
|
+
continue
|
|
90
|
+
cn = (value or "").strip()
|
|
91
|
+
if _is_ip_address(cn):
|
|
92
|
+
return cn
|
|
93
|
+
|
|
94
|
+
raise ValueError(f"server cert does not contain an IP SAN or IP common name: {cert_path}")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _resolve_static_ip(kv: Dict[str, str]) -> Tuple[Optional[str], str, Optional[str]]:
|
|
98
|
+
env_path = _server_env_path()
|
|
99
|
+
for key in _STATIC_IP_ENV_KEYS:
|
|
100
|
+
value = (kv.get(key, "") or "").strip()
|
|
101
|
+
if value:
|
|
102
|
+
return value, f"{env_path} ({key})", None
|
|
103
|
+
|
|
104
|
+
cert_path = _certs_dir() / "server.crt"
|
|
105
|
+
try:
|
|
106
|
+
return _x509_static_ip(cert_path), str(cert_path), None
|
|
107
|
+
except (FileNotFoundError, ValueError) as e:
|
|
108
|
+
return None, str(cert_path), str(e)
|
|
109
|
+
|
|
110
|
+
|
|
56
111
|
# -----------------------------
|
|
57
112
|
# Repo-local server config locations
|
|
58
113
|
# -----------------------------
|
|
@@ -126,7 +181,7 @@ def print_help() -> None:
|
|
|
126
181
|
"Port options:\n"
|
|
127
182
|
" --main-port <int> Set GRPC_PORT\n"
|
|
128
183
|
" --cert-port <int> Set CERT_PORT\n"
|
|
129
|
-
" --show | -s Show current ports\n"
|
|
184
|
+
" --show | -s Show current ports and static IP\n"
|
|
130
185
|
" -w | --wipe [-y] Wipe ONLY port config (server.env)\n"
|
|
131
186
|
"\n"
|
|
132
187
|
"Hosts:\n"
|
|
@@ -525,20 +580,27 @@ def _gen_certs(
|
|
|
525
580
|
|
|
526
581
|
def _config_show_ports() -> int:
|
|
527
582
|
p = _server_env_path()
|
|
528
|
-
if not p.exists():
|
|
529
|
-
print(f"No port config found (missing {p}).")
|
|
530
|
-
return 0
|
|
531
|
-
|
|
532
583
|
kv = _read_env_kv(p)
|
|
533
|
-
if not kv:
|
|
534
|
-
print("Port config is empty.")
|
|
535
|
-
return 0
|
|
536
584
|
|
|
537
585
|
print(f"Port config: {p}")
|
|
586
|
+
if not p.exists():
|
|
587
|
+
print(" (missing)")
|
|
588
|
+
elif not kv:
|
|
589
|
+
print(" (empty)")
|
|
590
|
+
|
|
538
591
|
if "GRPC_PORT" in kv:
|
|
539
592
|
print(f" GRPC_PORT={kv['GRPC_PORT']}")
|
|
540
593
|
if "CERT_PORT" in kv:
|
|
541
594
|
print(f" CERT_PORT={kv['CERT_PORT']}")
|
|
595
|
+
|
|
596
|
+
static_ip, source, err = _resolve_static_ip(kv)
|
|
597
|
+
if static_ip:
|
|
598
|
+
print(f" STATIC_IP={static_ip}")
|
|
599
|
+
if source != f"{p} (STATIC_IP)":
|
|
600
|
+
print(f" STATIC_IP_SOURCE={source}")
|
|
601
|
+
else:
|
|
602
|
+
print(" STATIC_IP=(not set)")
|
|
603
|
+
print(f" STATIC_IP_ERROR={err or f'could not resolve from {source}'}")
|
|
542
604
|
return 0
|
|
543
605
|
|
|
544
606
|
|
|
File without changes
|
|
File without changes
|
{remoterf_server_testing-0.0.11 → remoterf_server_testing-0.0.12}/src/remoteRF_server/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|