RemoteRF 0.0.7.45__tar.gz → 0.0.7.46__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-0.0.7.45/src/remoteRF.egg-info → remoterf-0.0.7.46}/PKG-INFO +1 -1
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/setup.py +2 -3
- remoterf-0.0.7.46/src/remoteRF/core/certs/ca.crt +32 -0
- remoterf-0.0.7.46/src/remoteRF/core/certs/ca.key +52 -0
- remoterf-0.0.7.46/src/remoteRF/core/certs/cert.pem +19 -0
- remoterf-0.0.7.46/src/remoteRF/core/certs/key.pem +28 -0
- remoterf-0.0.7.46/src/remoteRF/core/certs/server.crt +19 -0
- remoterf-0.0.7.46/src/remoteRF/core/certs/server.key +28 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/core/grpc_client.py +5 -7
- {remoterf-0.0.7.45 → remoterf-0.0.7.46/src/remoteRF.egg-info}/PKG-INFO +1 -1
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF.egg-info/SOURCES.txt +7 -3
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF.egg-info/entry_points.txt +0 -1
- remoterf-0.0.7.45/src/remoteRF/config/cert_fetcher.py +0 -140
- remoterf-0.0.7.45/src/remoteRF/config/config_cli.py +0 -139
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/LICENSE +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/MANIFEST.in +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/README.md +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/setup.cfg +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/grpc/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/grpc/grpc_pb2.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/grpc/grpc_pb2_grpc.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/utils/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/utils/ansi_codes.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/utils/api_token.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/utils/list_string.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/common/utils/process_arg.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/core/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/core/acc_login.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/core/app.py +0 -0
- {remoterf-0.0.7.45/src/remoteRF/config → remoterf-0.0.7.46/src/remoteRF/core/certs}/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/core/grpc_acc.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/core/version.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/drivers/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/drivers/adalm_pluto/__init__.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF/drivers/adalm_pluto/pluto_remote.py +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF.egg-info/dependency_links.txt +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF.egg-info/requires.txt +0 -0
- {remoterf-0.0.7.45 → remoterf-0.0.7.46}/src/remoteRF.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remoterf
|
|
3
|
-
Version: 0.0.7.
|
|
3
|
+
Version: 0.0.7.46
|
|
4
4
|
Summary: A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.
|
|
5
5
|
Author: Ethan Ge
|
|
6
6
|
Author-email: ethoGalaxy@gmail.com
|
|
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="remoterf",
|
|
9
|
-
version="0.0.7.
|
|
9
|
+
version="0.0.7.46",
|
|
10
10
|
author="Ethan Ge",
|
|
11
11
|
author_email="ethoGalaxy@gmail.com",
|
|
12
12
|
description="A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.",
|
|
@@ -28,8 +28,7 @@ setup(
|
|
|
28
28
|
entry_points={
|
|
29
29
|
'console_scripts': [
|
|
30
30
|
'remoterf-login=remoteRF.core.acc_login:main',
|
|
31
|
-
'remoterf-v=remoteRF.core.version:main'
|
|
32
|
-
'remoterf-config=remoteRF.config.config_cli:main',
|
|
31
|
+
'remoterf-v=remoteRF.core.version:main'
|
|
33
32
|
],
|
|
34
33
|
},
|
|
35
34
|
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIFmzCCA4OgAwIBAgIURcP62Zj3L/2bVIIdFu+UcAMklBQwDQYJKoZIhvcNAQEL
|
|
3
|
+
BQAwXTELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVN0YXRlMQ0wCwYDVQQHDARDaXR5
|
|
4
|
+
MRUwEwYDVQQKDAxDb21wYW55IE5hbWUxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNv
|
|
5
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oEFTphAQnD5ieNFvChmY6x0NpSVPstcWj7NSNOHfTU9ctptg8
|
|
18
|
+
LkuJtfDgcfoPUuRKqFZx30EAr/zDce3tvhR/98KyffjomYOdycUPWgVaIdcpXp+A
|
|
19
|
+
8eIS3C42EwKBgAlkTd48uSra1Z4uWbmz1ZwM/mWRQBY8COk1ZdIf5vwXrPI+PyZ6
|
|
20
|
+
HoiNQ3CLXJYn2TMatjmvi+I8tQ4w6e57EIa0VmxhDxoKgJky5v5C9jUcTufMriGC
|
|
21
|
+
rGepbJMODXlV2Kn6omRwd/1Mb/j4oxB57PrZP6ldOKegKayckVJ5vTInAoGAUeP7
|
|
22
|
+
l0XF65gzbSdlfFqhjWH/PiDNR+zSHclOeT45L2C4pj3f4Uz4uRiuxMI8CMs0JKNA
|
|
23
|
+
fvugLAJosVbAVtB0mbesYnPo68hHsKAQoK4x0BiDuBH011RAymiZTzsigqB8eEnE
|
|
24
|
+
j0A8aE61z0Bk/6jJCv9ntXYTx/MU9YEc+1jGYCECgYB9Y32sH3xV2LdMKlhFtjux
|
|
25
|
+
WAyyAN+C7Ly8jzwpHQMxpSxHZ16tO/V+0mMIqZHRz1X+DKqO4h6t1j3Bn0u9Tm/i
|
|
26
|
+
vXNDEfy9RF/9U16s0ByK6QzwTodevNg7SEP6YzagR6DlCzIwj0Xbs9m9BHT7Ypia
|
|
27
|
+
J2qGfS7rsnmSP31AtQhikA==
|
|
28
|
+
-----END PRIVATE KEY-----
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import socket
|
|
2
2
|
import getpass
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
import os
|
|
5
|
-
from dotenv import load_dotenv
|
|
6
4
|
|
|
7
5
|
import grpc
|
|
8
6
|
from ..common.grpc import grpc_pb2
|
|
9
7
|
from ..common.grpc import grpc_pb2_grpc
|
|
10
8
|
from ..common.utils import *
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
# wlab credentials
|
|
11
|
+
server_ip = '164.67.195.207'
|
|
12
|
+
server_port = '61005'
|
|
15
13
|
|
|
16
14
|
options = [
|
|
17
15
|
('grpc.max_send_message_length', 100 * 1024 * 1024),
|
|
@@ -19,12 +17,12 @@ options = [
|
|
|
19
17
|
]
|
|
20
18
|
|
|
21
19
|
# Server.crt
|
|
22
|
-
certs_path = Path(
|
|
20
|
+
certs_path = Path(__file__).resolve().parent.parent/'core'/'certs'/'server.crt'
|
|
23
21
|
with certs_path.open('rb') as f:
|
|
24
22
|
trusted_certs = f.read()
|
|
25
23
|
|
|
26
24
|
credentials = grpc.ssl_channel_credentials(root_certificates=trusted_certs)
|
|
27
|
-
channel = grpc.secure_channel(
|
|
25
|
+
channel = grpc.secure_channel(f'{server_ip}:{server_port}', credentials, options=options)
|
|
28
26
|
stub = grpc_pb2_grpc.GenericRPCStub(channel)
|
|
29
27
|
|
|
30
28
|
tcp_calls = 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remoterf
|
|
3
|
-
Version: 0.0.7.
|
|
3
|
+
Version: 0.0.7.46
|
|
4
4
|
Summary: A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.
|
|
5
5
|
Author: Ethan Ge
|
|
6
6
|
Author-email: ethoGalaxy@gmail.com
|
|
@@ -18,15 +18,19 @@ src/remoteRF/common/utils/ansi_codes.py
|
|
|
18
18
|
src/remoteRF/common/utils/api_token.py
|
|
19
19
|
src/remoteRF/common/utils/list_string.py
|
|
20
20
|
src/remoteRF/common/utils/process_arg.py
|
|
21
|
-
src/remoteRF/config/__init__.py
|
|
22
|
-
src/remoteRF/config/cert_fetcher.py
|
|
23
|
-
src/remoteRF/config/config_cli.py
|
|
24
21
|
src/remoteRF/core/__init__.py
|
|
25
22
|
src/remoteRF/core/acc_login.py
|
|
26
23
|
src/remoteRF/core/app.py
|
|
27
24
|
src/remoteRF/core/grpc_acc.py
|
|
28
25
|
src/remoteRF/core/grpc_client.py
|
|
29
26
|
src/remoteRF/core/version.py
|
|
27
|
+
src/remoteRF/core/certs/__init__.py
|
|
28
|
+
src/remoteRF/core/certs/ca.crt
|
|
29
|
+
src/remoteRF/core/certs/ca.key
|
|
30
|
+
src/remoteRF/core/certs/cert.pem
|
|
31
|
+
src/remoteRF/core/certs/key.pem
|
|
32
|
+
src/remoteRF/core/certs/server.crt
|
|
33
|
+
src/remoteRF/core/certs/server.key
|
|
30
34
|
src/remoteRF/drivers/__init__.py
|
|
31
35
|
src/remoteRF/drivers/adalm_pluto/__init__.py
|
|
32
36
|
src/remoteRF/drivers/adalm_pluto/pluto_remote.py
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
# cert_fetcher.py
|
|
2
|
-
"""
|
|
3
|
-
RemoteRF Client-Side Cert Fetcher (bootstrap)
|
|
4
|
-
|
|
5
|
-
Purpose:
|
|
6
|
-
- Fetch the public CA certificate (ca.crt) from a server's bootstrap endpoint
|
|
7
|
-
(your cert_provider) and save it locally for later use in:
|
|
8
|
-
grpc.ssl_channel_credentials(root_certificates=ca_bytes)
|
|
9
|
-
|
|
10
|
-
Security note (TOFU):
|
|
11
|
-
- This fetch is typically done over plaintext HTTP (or raw TCP). The CA cert is public,
|
|
12
|
-
but authenticity is not guaranteed on first fetch. If you want TOFU done "right",
|
|
13
|
-
you should display the SHA256 fingerprint and require user confirmation elsewhere.
|
|
14
|
-
This module focuses only on: fetch + save + return success.
|
|
15
|
-
|
|
16
|
-
Behavior:
|
|
17
|
-
- Attempts HTTP GET first: http://{host}:{port}/ca.crt
|
|
18
|
-
- If HTTP fails, falls back to raw TCP (reads until EOF).
|
|
19
|
-
- Saves to a per-profile file under ~/.config/remoterf/certs/ by default.
|
|
20
|
-
|
|
21
|
-
Exported API:
|
|
22
|
-
- fetch_and_save_ca_cert(host, port, *, out_path=None, profile=None, timeout_sec=3.0) -> bool
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
from __future__ import annotations
|
|
26
|
-
|
|
27
|
-
import hashlib
|
|
28
|
-
import os
|
|
29
|
-
import socket
|
|
30
|
-
import urllib.request
|
|
31
|
-
from pathlib import Path
|
|
32
|
-
from typing import Optional
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
CERT_FILENAME_DEFAULT = "ca.crt"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def _default_config_dir() -> Path:
|
|
39
|
-
# Cross-platform-ish default; adjust if you already have a standard in your project.
|
|
40
|
-
# Linux: ~/.config/remoterf
|
|
41
|
-
# macOS: also acceptable; if you want Apple-standard, use ~/Library/Application Support/remoterf
|
|
42
|
-
base = Path(os.path.expanduser("~")) / ".config" / "remoterf"
|
|
43
|
-
return base
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def _ensure_parent_dir(p: Path) -> None:
|
|
47
|
-
p.parent.mkdir(parents=True, exist_ok=True)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def _looks_like_pem_cert(data: bytes) -> bool:
|
|
51
|
-
return b"BEGIN CERTIFICATE" in data and b"END CERTIFICATE" in data
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def sha256_fingerprint_pem(pem_bytes: bytes) -> str:
|
|
55
|
-
h = hashlib.sha256(pem_bytes).hexdigest()
|
|
56
|
-
return ":".join(h[i:i+2] for i in range(0, len(h), 2))
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def _fetch_http(host: str, port: int, timeout_sec: float) -> bytes:
|
|
60
|
-
url = f"http://{host}:{port}/ca.crt"
|
|
61
|
-
req = urllib.request.Request(url, method="GET")
|
|
62
|
-
with urllib.request.urlopen(req, timeout=timeout_sec) as resp:
|
|
63
|
-
data = resp.read()
|
|
64
|
-
return data
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def _fetch_raw_tcp(host: str, port: int, timeout_sec: float) -> bytes:
|
|
68
|
-
chunks: list[bytes] = []
|
|
69
|
-
with socket.create_connection((host, port), timeout=timeout_sec) as s:
|
|
70
|
-
s.settimeout(timeout_sec)
|
|
71
|
-
while True:
|
|
72
|
-
try:
|
|
73
|
-
b = s.recv(4096)
|
|
74
|
-
except socket.timeout:
|
|
75
|
-
break
|
|
76
|
-
if not b:
|
|
77
|
-
break
|
|
78
|
-
chunks.append(b)
|
|
79
|
-
return b"".join(chunks)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def fetch_and_save_ca_cert(
|
|
83
|
-
host: str,
|
|
84
|
-
port: int,
|
|
85
|
-
*,
|
|
86
|
-
out_path: Optional[str | Path] = None,
|
|
87
|
-
profile: Optional[str] = None,
|
|
88
|
-
timeout_sec: float = 3.0,
|
|
89
|
-
overwrite: bool = True,
|
|
90
|
-
) -> bool:
|
|
91
|
-
"""
|
|
92
|
-
Fetch CA cert from the server bootstrap endpoint and save it to disk.
|
|
93
|
-
|
|
94
|
-
Args:
|
|
95
|
-
host: server host/ip running cert_provider
|
|
96
|
-
port: cert_provider port (NOT the TLS gRPC port)
|
|
97
|
-
out_path: explicit output path (overrides profile/default location)
|
|
98
|
-
profile: if provided, saves as ~/.config/remoterf/certs/<profile>.crt
|
|
99
|
-
timeout_sec: network timeout
|
|
100
|
-
overwrite: whether to overwrite existing file
|
|
101
|
-
|
|
102
|
-
Returns:
|
|
103
|
-
True on success, False on any failure.
|
|
104
|
-
"""
|
|
105
|
-
try:
|
|
106
|
-
if not isinstance(port, int):
|
|
107
|
-
port = int(port)
|
|
108
|
-
|
|
109
|
-
# Determine destination path
|
|
110
|
-
if out_path is not None:
|
|
111
|
-
dest = Path(out_path).expanduser().resolve()
|
|
112
|
-
else:
|
|
113
|
-
cfg = _default_config_dir()
|
|
114
|
-
certs_dir = cfg / "certs"
|
|
115
|
-
name = f"{profile}.crt" if profile else CERT_FILENAME_DEFAULT
|
|
116
|
-
dest = certs_dir / name
|
|
117
|
-
|
|
118
|
-
_ensure_parent_dir(dest)
|
|
119
|
-
|
|
120
|
-
if dest.exists() and not overwrite:
|
|
121
|
-
return True # already present, treat as success
|
|
122
|
-
|
|
123
|
-
# Fetch (HTTP first, then raw TCP fallback)
|
|
124
|
-
data = b""
|
|
125
|
-
try:
|
|
126
|
-
data = _fetch_http(host, port, timeout_sec)
|
|
127
|
-
except Exception:
|
|
128
|
-
data = _fetch_raw_tcp(host, port, timeout_sec)
|
|
129
|
-
|
|
130
|
-
if not data or not _looks_like_pem_cert(data):
|
|
131
|
-
return False
|
|
132
|
-
|
|
133
|
-
# Save
|
|
134
|
-
dest.write_bytes(data)
|
|
135
|
-
|
|
136
|
-
# Optional: you may want to return/print fingerprint, but requested API is bool.
|
|
137
|
-
return True
|
|
138
|
-
|
|
139
|
-
except Exception:
|
|
140
|
-
return False
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# src/remoteRF/core/remoterf_config.py
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import argparse
|
|
6
|
-
import os
|
|
7
|
-
import sys
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
from typing import Tuple
|
|
10
|
-
|
|
11
|
-
from .cert_fetcher import fetch_and_save_ca_cert # your earlier module
|
|
12
|
-
|
|
13
|
-
# -----------------------------
|
|
14
|
-
# Local config locations
|
|
15
|
-
# -----------------------------
|
|
16
|
-
def _config_root() -> Path:
|
|
17
|
-
# Keep it simple and consistent with earlier suggestions.
|
|
18
|
-
return Path(os.path.expanduser("~")) / ".config" / "remoterf"
|
|
19
|
-
|
|
20
|
-
def _env_path() -> Path:
|
|
21
|
-
return _config_root() / ".env"
|
|
22
|
-
|
|
23
|
-
def _certs_dir() -> Path:
|
|
24
|
-
return _config_root() / "certs"
|
|
25
|
-
|
|
26
|
-
def _parse_hostport(s: str) -> Tuple[str, int]:
|
|
27
|
-
s = s.strip()
|
|
28
|
-
if "://" in s:
|
|
29
|
-
s = s.split("://", 1)[1]
|
|
30
|
-
|
|
31
|
-
if ":" not in s:
|
|
32
|
-
raise ValueError("Expected format host:port")
|
|
33
|
-
|
|
34
|
-
host, port_str = s.rsplit(":", 1)
|
|
35
|
-
host = host.strip()
|
|
36
|
-
port = int(port_str.strip())
|
|
37
|
-
if not host:
|
|
38
|
-
raise ValueError("Host is empty")
|
|
39
|
-
if port <= 0 or port > 65535:
|
|
40
|
-
raise ValueError("Port out of range")
|
|
41
|
-
return host, port
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def _write_env_kv(path: Path, kv: dict[str, str]) -> None:
|
|
45
|
-
"""
|
|
46
|
-
Writes/overwrites a simple dotenv-style file.
|
|
47
|
-
(We overwrite the whole file for simplicity and correctness.)
|
|
48
|
-
"""
|
|
49
|
-
path.parent.mkdir(parents=True, exist_ok=True)
|
|
50
|
-
lines = []
|
|
51
|
-
for k, v in kv.items():
|
|
52
|
-
# Quote only if needed; keep simple and safe.
|
|
53
|
-
if any(c.isspace() for c in v) or any(c in v for c in ['"', "'"]):
|
|
54
|
-
v = v.replace('"', '\\"')
|
|
55
|
-
lines.append(f'{k}="{v}"')
|
|
56
|
-
else:
|
|
57
|
-
lines.append(f"{k}={v}")
|
|
58
|
-
path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
59
|
-
|
|
60
|
-
def main() -> None:
|
|
61
|
-
import argparse
|
|
62
|
-
import sys
|
|
63
|
-
|
|
64
|
-
parser = argparse.ArgumentParser(
|
|
65
|
-
prog="remoterf-config",
|
|
66
|
-
add_help=True,
|
|
67
|
-
formatter_class=argparse.RawTextHelpFormatter,
|
|
68
|
-
description=(
|
|
69
|
-
"Configure RemoteRF to talk to a server.\n"
|
|
70
|
-
"Fetches the server CA certificate and saves the gRPC target locally."
|
|
71
|
-
),
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
parser.add_argument(
|
|
75
|
-
"addr",
|
|
76
|
-
nargs="?",
|
|
77
|
-
help="Server address in host:port form. Example: 164.67.195.207:61005",
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
args = parser.parse_args()
|
|
81
|
-
|
|
82
|
-
if not args.addr:
|
|
83
|
-
print(
|
|
84
|
-
"\nError: missing required argument: host:port\n\n"
|
|
85
|
-
"Usage:\n"
|
|
86
|
-
" remoterf-config <host:port>\n\n"
|
|
87
|
-
"Example:\n"
|
|
88
|
-
" remoterf-config 123.45.678.901:12345\n"
|
|
89
|
-
)
|
|
90
|
-
sys.exit(2)
|
|
91
|
-
|
|
92
|
-
try:
|
|
93
|
-
host, grpc_port = _parse_hostport(args.addr)
|
|
94
|
-
except Exception as e:
|
|
95
|
-
print(f"Error: invalid addr '{args.addr}': {e}", file=sys.stderr)
|
|
96
|
-
sys.exit(2)
|
|
97
|
-
|
|
98
|
-
cert_port = args.cert_port if args.cert_port is not None else (grpc_port + 1)
|
|
99
|
-
|
|
100
|
-
# Destination CA cert file
|
|
101
|
-
certs_dir = _certs_dir()
|
|
102
|
-
certs_dir.mkdir(parents=True, exist_ok=True)
|
|
103
|
-
ca_out = certs_dir / f"{args.profile}.crt"
|
|
104
|
-
|
|
105
|
-
if ca_out.exists() and not (args.overwrite):
|
|
106
|
-
# Treat as OK; still (re)write env target.
|
|
107
|
-
fetched_ok = True
|
|
108
|
-
else:
|
|
109
|
-
fetched_ok = fetch_and_save_ca_cert(
|
|
110
|
-
host,
|
|
111
|
-
cert_port,
|
|
112
|
-
out_path=ca_out,
|
|
113
|
-
timeout_sec=args.timeout,
|
|
114
|
-
overwrite=True,
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
if not fetched_ok:
|
|
118
|
-
print(
|
|
119
|
-
f"Failed to fetch CA cert from {host}:{cert_port}.\n",
|
|
120
|
-
file=sys.stderr
|
|
121
|
-
)
|
|
122
|
-
sys.exit(1)
|
|
123
|
-
|
|
124
|
-
# Write local .env (or config) with chosen server and CA path
|
|
125
|
-
env_file = _env_path()
|
|
126
|
-
_write_env_kv(env_file, {
|
|
127
|
-
"REMOTERF_ADDR": f"{host}:{grpc_port}",
|
|
128
|
-
"REMOTERF_CA_CERT": str(ca_out),
|
|
129
|
-
"REMOTERF_PROFILE": args.profile,
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
print("RemoteRF configured successfully.")
|
|
133
|
-
print(f" gRPC target : {host}:{grpc_port}")
|
|
134
|
-
print(f" cert port : {host}:{cert_port}")
|
|
135
|
-
print(f" CA cert : {ca_out}")
|
|
136
|
-
print(f" env file : {env_file}")
|
|
137
|
-
|
|
138
|
-
if __name__ == "__main__":
|
|
139
|
-
main()
|
|
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
|
{remoterf-0.0.7.45/src/remoteRF/config → remoterf-0.0.7.46/src/remoteRF/core/certs}/__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
|