aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/config.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-03 16:20:23 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-03 16:20:28 +0200
commit753653b4df62723b82d32799825135822886eac7 (patch)
tree14829922bf343e6353093eaceaa84986fe5f84df /packages/meshbay-node/src/meshbay_node/config.py
parent675beed6ff688733a9598f9d82d41578f48316be (diff)
downloadmeshbay-753653b4df62723b82d32799825135822886eac7.tar.gz
refactor(node): platform abstraction for Windows portability (W1-W2-W5-W6-W7)
Platform directories, signal handling, chmod guards, ffmpeg discovery, and platform-conditional CLI messages — all testable on Linux. See docs/WINDOWS-PORT.md §5 for the plan these implement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/config.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/config.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/config.py b/packages/meshbay-node/src/meshbay_node/config.py
index 78ee873..cfbec50 100644
--- a/packages/meshbay-node/src/meshbay_node/config.py
+++ b/packages/meshbay-node/src/meshbay_node/config.py
@@ -11,6 +11,8 @@ import os
from dataclasses import dataclass, field
from pathlib import Path
+from meshbay_node.platform import config_dir, data_dir
+
try:
import tomllib # Python 3.11+
except ImportError:
@@ -25,7 +27,7 @@ DEFAULT_STUN_SERVERS: list[str] = [
"stun:stun.services.mozilla.com:3478",
]
-DEFAULT_CONFIG_PATH = Path.home() / ".config" / "meshbay" / "node.toml"
+DEFAULT_CONFIG_PATH = config_dir() / "node.toml"
EXAMPLE_CONFIG = """\
# MeshBay Node configuration — multi-group example
@@ -169,6 +171,8 @@ class NodeConfig:
# machine with a Tailscale wt0 interface.
ice_interfaces: list[str] = field(default_factory=list) # include-list overrides auto
stun_servers: list[str] = field(default_factory=list) # empty = DEFAULT_STUN_SERVERS
+ ffmpeg_path: str = "ffmpeg"
+ ffprobe_path: str = "ffprobe"
@dataclass
@@ -234,7 +238,7 @@ class Config:
node: NodeConfig = field(default_factory=NodeConfig)
groups: list[GroupConfig] = field(default_factory=list)
keystore: KeystoreConfig = field(default_factory=KeystoreConfig)
- data_dir: Path = field(default_factory=lambda: Path.home() / ".local" / "share" / "meshbay")
+ data_dir: Path = field(default_factory=data_dir)
# Back-compat: single-group access
@property
@@ -333,6 +337,10 @@ def load_config(path: Path = DEFAULT_CONFIG_PATH) -> Config:
stun = nd.get("stun_servers")
if isinstance(stun, list):
cfg.node.stun_servers = [str(s) for s in stun]
+ if "ffmpeg_path" in nd:
+ cfg.node.ffmpeg_path = str(nd["ffmpeg_path"])
+ if "ffprobe_path" in nd:
+ cfg.node.ffprobe_path = str(nd["ffprobe_path"])
# Multi-group: [[groups]] array
if "groups" in raw: