Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repeater:

# Path to identity file (public/private key)
# If not specified, a new identity will be generated
identity_file: null
identity_key: null

# Duplicate packet cache TTL in seconds
cache_ttl: 60
Expand Down
8 changes: 4 additions & 4 deletions repeater/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def load_config(config_path: Optional[str] = None) -> Dict[str, Any]:
except Exception as e:
raise RuntimeError(f"Failed to load configuration from {config_path}: {e}") from e

if "mesh" not in config:
config["mesh"] = {}
if "repeater" not in config:
config["repeater"] = {}

# Only auto-generate identity_key if not provided
if "identity_key" not in config["mesh"]:
config["mesh"]["identity_key"] = _load_or_create_identity_key()
if "identity_key" not in config["repeater"]:
config["repeater"]["identity_key"] = _load_or_create_identity_key()

if os.getenv("PYMC_REPEATER_LOG_LEVEL"):
if "logging" not in config:
Expand Down
2 changes: 1 addition & 1 deletion repeater/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def initialize(self):
self.dispatcher = Dispatcher(self.radio)
logger.info("Dispatcher initialized")

identity_key = self.config.get("mesh", {}).get("identity_key")
identity_key = self.config.get("repeater", {}).get("identity_key")
if not identity_key:
logger.error("No identity key found in configuration. Cannot init repeater.")
raise RuntimeError("Identity key is required for repeater operation")
Expand Down