diff --git a/config.yaml.example b/config.yaml.example index a830119..61b7bd6 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -39,7 +39,7 @@ mesh: # Global flood policy - controls whether the repeater allows or denies flooding by default # true = allow flooding globally, false = deny flooding globally # Individual transport keys can override this setting - global_flood_allow: false + global_flood_allow: true radio: # Frequency in Hz (869.618 MHz for EU) @@ -147,8 +147,8 @@ storage: letsmesh: - enabled: true - iata_code: "test" # e.g., "SFO", "LHR", "test" + enabled: false + iata_code: "Test" # e.g., "SFO", "LHR", "Test" broker_index: 0 # Which LetsMesh broker (0=EU, 1=US West) status_interval: 60 diff --git a/manage.sh b/manage.sh index 98bc01d..4435349 100644 --- a/manage.sh +++ b/manage.sh @@ -567,7 +567,7 @@ import yaml from collections import OrderedDict def merge_yaml_configs(user_config_path, example_config_path, output_path): - """Merge user config with new example config, preserving user values""" + """Merge user config with new example config, preserving user values and protecting critical sections""" try: # Load user config with open(user_config_path, 'r') as f: @@ -577,9 +577,16 @@ def merge_yaml_configs(user_config_path, example_config_path, output_path): with open(example_config_path, 'r') as f: example_config = yaml.safe_load(f) or {} + # Sections to preserve completely from user config (don't overwrite with example) + protected_sections = ['radio', 'sx1262'] + # Deep merge function def deep_merge(base, overlay): for key, value in overlay.items(): + # Skip protected sections - keep user's version completely + if key in protected_sections: + continue + if key in base and isinstance(base[key], dict) and isinstance(value, dict): deep_merge(base[key], value) elif key not in base: @@ -589,6 +596,12 @@ def merge_yaml_configs(user_config_path, example_config_path, output_path): # Start with example config as base (gets all new sections) merged = deep_merge(dict(example_config), user_config) + # Explicitly preserve protected sections from user config + for section in protected_sections: + if section in user_config: + merged[section] = user_config[section] + print(f" ✓ Preserved user {section} configuration") + # Write merged config with open(output_path, 'w') as f: yaml.dump(merged, f, default_flow_style=False, indent=2)