summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/config.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/config.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/config.py b/packages/meshbay-node/src/meshbay_node/config.py
index 04cb1d3..f3752ea 100644
--- a/packages/meshbay-node/src/meshbay_node/config.py
+++ b/packages/meshbay-node/src/meshbay_node/config.py
@@ -29,6 +29,11 @@ username = "myusername"
quic_port = 19010 # QUIC (MNP) — LAN, port-forwarded, hub-less direct access
ui_port = 18000 # local admin UI (127.0.0.1 only)
+# One-time codes. An invitation waits for someone to read their messages; an
+# operator pairing code is typed during the SSH session that printed it.
+invite_ttl_hours = 168 # 7 days
+pair_ttl_hours = 24
+
# Browser and native clients reach this node over WebRTC DataChannel via hub
# signaling — no inbound port to open. QUIC is the optional direct path.
@@ -70,6 +75,11 @@ class HubConfig:
class NodeConfig:
quic_port: int = 19010
ui_port: int = 18000
+ # How long a one-time code stays usable. Invitations travel through a human
+ # conversation and are answered days later; operator pairing happens during
+ # the SSH session that printed it.
+ invite_ttl_hours: int = 168 # 7 days
+ pair_ttl_hours: int = 24
@dataclass
@@ -129,6 +139,10 @@ def load_config(path: Path = DEFAULT_CONFIG_PATH) -> Config:
# in Phase 11.5 (findings C1, C6). Regenerate node.toml with `meshbay-node init`.
cfg.node.quic_port = nd.get("quic_port", cfg.node.quic_port)
cfg.node.ui_port = nd.get("ui_port", cfg.node.ui_port)
+ cfg.node.invite_ttl_hours = int(
+ nd.get("invite_ttl_hours", cfg.node.invite_ttl_hours))
+ cfg.node.pair_ttl_hours = int(
+ nd.get("pair_ttl_hours", cfg.node.pair_ttl_hours))
# Multi-group: [[groups]] array
if "groups" in raw: