diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/config.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/config.py | 12 |
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: |