Files
meshcore-bot/config.ini.minimal-example
agessaman 3575d025ba Implement feed manager configuration and refactor command settings
- Added a new [Feed_Manager] section in the configuration to enable or disable RSS/API feed subscriptions, defaulting to false.
- Updated the FeedManager class to handle missing configuration sections gracefully, ensuring compatibility with upgrades.
- Refactored joke command configuration to standardize the use of an `enabled` key, replacing legacy `*_enabled` keys for clarity.
- Adjusted the PathCommand class to enable the "p" shortcut by default, improving user experience.
2026-02-12 22:03:02 -08:00

487 lines
18 KiB
Plaintext

####################################################################################################
# #
# Minimal Configuration Example #
# #
# This is a minimal configuration file that enables only the core testing commands: #
# - ping: Simple connectivity test #
# - test (t): Connection info with optional phrase #
# - path (p): Decode hex path data to show repeaters #
# - prefix: Look up repeaters by two-character prefix #
# - multitest (mt): Listen for multiple path variations #
# #
# All other commands and service plugins are explicitly disabled. This configuration is #
# intended for users who only want basic testing functionality without additional features. #
# #
# To use this configuration: #
# 1. Copy this file to config.ini #
# 2. Update the [Connection] section with your device settings #
# 3. Update the [Bot] section with your bot name and location #
# 4. Adjust other settings as needed #
# #
# To enable additional commands, set enabled = true in the appropriate command section below. #
# - Some disabled commands will require additional configuration options found in #
# config.ini.example to enable #
# #
####################################################################################################
[Connection]
# Connection type: serial, ble, or tcp
# serial: Connect via USB serial port
# ble: Connect via Bluetooth Low Energy
# tcp: Connect via TCP/IP
connection_type = serial
# Serial port (for serial connection)
# Common ports: /dev/ttyUSB0, /dev/tty.usbserial-*, COM3 (Windows)
serial_port = /dev/ttyUSB0
# BLE device name (for BLE connection)
# Leave commented out for auto-detection, or specify exact device name
#ble_device_name = MeshCore
# TCP hostname or IP address (for TCP connection)
#hostname = 192.168.1.60
# TCP port (for TCP connection)
#tcp_port = 5000
# Connection timeout in seconds
timeout = 30
[Bot]
# Bot name for identification and logging
bot_name = MeshCoreBot
# RF Data Correlation Settings
# Time window for correlating RF data with messages (seconds)
rf_data_timeout = 15.0
# Time to wait for RF data correlation (seconds)
message_correlation_timeout = 10.0
# Enable enhanced correlation strategies
enable_enhanced_correlation = true
# Bot node ID (leave empty for auto-assignment)
node_id =
# Enable/disable bot responses
# true: Bot will respond to keywords and commands
# false: Bot will only listen and log messages
enabled = true
# Passive mode (only listen, don't respond)
# true: Bot will not send any messages
# false: Bot will respond normally
passive_mode = false
# Rate limiting in seconds between messages
# Prevents spam by limiting how often the bot can send messages
rate_limit_seconds = 10
# Bot transmission rate limit in seconds between bot messages
# Prevents bot from overwhelming the mesh network
bot_tx_rate_limit_seconds = 1.0
# Per-user rate limit: minimum seconds between bot replies to the same user
# User key: public key when available, else sender name
per_user_rate_limit_seconds = 5
per_user_rate_limit_enabled = true
# Transmission delay in milliseconds before sending messages
# Helps prevent message collisions on the mesh network
# Recommended: 100-500ms for busy networks, 0 for quiet networks
tx_delay_ms = 250
# DM retry settings for improved reliability (meshcore-2.1.6+)
# Maximum number of retry attempts for failed DM sends
dm_max_retries = 3
# Maximum flood attempts (when path reset is needed)
dm_max_flood_attempts = 2
# Number of attempts before switching to flood mode
dm_flood_after = 2
# Timezone for bot operations
# Use standard timezone names (e.g., America/New_York, Europe/London, UTC)
# Leave empty to use system timezone
timezone =
# Bot location for geographic proximity calculations and astronomical data
# Default latitude for bot location (decimal degrees)
# Example: 40.7128 for New York City, 48.50 for Victoria BC
bot_latitude = 40.7128
# Default longitude for bot location (decimal degrees)
# Example: -74.0060 for New York City, -123.00 for Victoria BC
bot_longitude = -74.0060
# Maximum number of channels to fetch from MeshCore node
# MeshCore supports up to 40 channels (default: 40)
# Set to a lower value if you want to limit channel fetching for performance
max_channels = 12
# Interval-based advertising settings
# Send periodic flood adverts at specified intervals
# 0: Disabled (default)
# >0: Send flood advert every N hours
advert_interval_hours = 0
# Send startup advert when bot finishes initializing
# false: No startup advert (default)
# zero-hop: Send local broadcast advert
# flood: Send network-wide flood advert
startup_advert = false
# Auto-manage contact list when new contacts are discovered
# device: Device handles auto-addition using standard auto-discovery mode, bot manages contact list capacity (purge old contacts when near limits)
# bot: Bot automatically adds new companion contacts to device, bot manages contact list capacity (purge old contacts when near limits)
# false: Manual mode - no automatic actions, use !repeater commands to manage contacts (default)
auto_manage_contacts = false
# Database path for main bot database
# Default: meshcore_bot.db
db_path = meshcore_bot.db
[Localization]
# Language code for bot responses (en, es, es-MX, es-ES, fr, de, ja, etc.)
# Default: en (English)
# The bot will use translations from translations/{language}.json
# Supports locale codes:
# - Simple codes: en, es, fr, de, ja
# - Locale codes: es-MX (Mexican Spanish), es-ES (Spain Spanish), fr-CA (Canadian French)
# If locale-specific file not found, falls back to base language (e.g., es.json)
# If translation file is missing or key not found, falls back to English
language = en
# Path to translation files directory (relative to bot root)
# Default: translations/
translation_path = translations/
[Admin_ACL]
# Admin Access Control List (ACL) for restricted commands
# Only users with public keys listed here can execute admin commands
#
# SECURITY IMPORTANT:
# - Public keys MUST be exactly 64 hexadecimal characters (ed25519 format)
# - Invalid formats will be rejected with error logs
# - Empty or whitespace-only values disable admin access
# - Keys are case-insensitive (normalized to lowercase)
#
# Format: comma-separated list of 64-character hex public keys (without spaces)
# Example: f5d2b56d19b24412756933e917d4632e088cdd5daeadc9002feca73bf5d2b56d,1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
#
# IMPORTANT: Leave blank to disable all admin commands. Set your actual admin pubkey(s) here.
admin_pubkeys =
# Commands that require admin access (comma-separated)
# These commands will only work for users in the admin_pubkeys list
# reload: Reload configuration without restarting (radio settings cannot be changed)
admin_commands = repeater,webviewer,reload
[Keywords]
# Available placeholders (message-based):
# {sender} - Name/ID of message sender
# {connection_info} - Path info, SNR, and RSSI combined (e.g., "01,5f (2 hops) | SNR: 15 dB | RSSI: -120 dBm")
# {snr} - Signal-to-noise ratio in dB
# {rssi} - Received signal strength indicator in dBm
# {timestamp} - Message timestamp in HH:MM:SS format
# {path} - Message routing path (e.g., "01,5f (2 hops)")
# {path_distance} - Total distance between all hops in path with locations (e.g., "123.4km (3 segs, 1 no-loc)")
# {firstlast_distance} - Distance between first and last repeater in path (e.g., "45.6km" or empty if locations missing)
# {elapsed} - Elapsed time (e.g. 1234ms) or "Sync Device Clock" when device clock is invalid (use {elapsed} only; do not append ms)
test = "ack @[{sender}]{phrase_part} | {connection_info} | Received at: {timestamp}"
ping = "Pong!"
[Channels]
# Channels to monitor (comma-separated)
# Bot will only respond to messages on these channels
# Use exact channel names as configured on your MeshCore node
monitor_channels = general,test,emergency
# Enable DM responses
# true: Bot will respond to direct messages
# false: Bot will ignore direct messages
respond_to_dms = true
# Optional: limit channel responses to certain keywords (e.g. help,ping,test).
# When set, only these triggers work in channels; DMs get all triggers.
# channel_keywords =
[Banned_Users]
# List of banned sender names (comma-separated). Matching is prefix (starts-with):
# "Awful Username" also matches "Awful Username 🍆". No bot responses in channels or DMs.
banned_users =
[Feed_Manager]
# Enable or disable RSS/API feed subscriptions (disabled by default)
feed_manager_enabled = false
[Logging]
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
# DEBUG: Most verbose, shows all details
# INFO: Standard logging level
# WARNING: Only warnings and errors
# ERROR: Only errors
# CRITICAL: Only critical errors
log_level = INFO
# Log file path (leave empty for console only)
# Bot will write logs to this file in addition to console
log_file = meshcore_bot.log
# Enable colored console output
# true: Use colors in console output
# false: Plain text output
colored_output = true
# MeshCore library log level (separate from bot log level)
# Controls debug output from the meshcore library itself
# Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
meshcore_log_level = INFO
####################################################################################################
# #
# Core Testing Commands Configuration #
# #
# This minimal configuration enables only the core testing commands: #
# - ping: Simple connectivity test #
# - test (t): Connection info with optional phrase #
# - path (p): Decode hex path data to show repeaters #
# - prefix: Look up repeaters by two-character prefix #
# - multitest (mt): Listen for multiple path variations #
# #
####################################################################################################
[Ping_Command]
# Enable or disable the ping command
# true: Ping command is available
# false: Ping command is disabled
enabled = true
[Test_Command]
# Enable or disable the test command
# true: Test command is available (responds to 'test' or 't')
# false: Test command is disabled
enabled = true
[Path_Command]
# Enable or disable the path command
# true: Path command is available (responds to 'path', 'decode', 'route')
# false: Path command is disabled
enabled = true
# Enable "p" shortcut for path command (similar to "t" for test command)
# true: Respond to just "p" or "p <path_data>" as a shortcut for "path"
# false: Only respond to "path", "decode", or "route" keywords (default)
enable_p_shortcut = true
# Geographic proximity calculation method
# simple: Use proximity to bot location (default)
# path: Use proximity to previous/next nodes in the path for more realistic routing
proximity_method = simple
# Enable path proximity fallback
# When path proximity can't be calculated (missing location data), fall back to simple proximity
# true: Fall back to bot location proximity when path data unavailable
# false: Show collision warning when path proximity unavailable
path_proximity_fallback = true
# Maximum range for geographic proximity guessing (kilometers)
# Repeaters beyond this distance will have reduced confidence or be rejected
# Set to 0 to disable range limiting
max_proximity_range = 200
# Maximum age for repeater data in path matching (days)
# Only include repeaters that have been heard within this many days
# Helps filter out stale or inactive repeaters from path decoding
# Set to 0 to disable age filtering
max_repeater_age_days = 14
# Recency vs Proximity weighting (0.0 to 1.0)
# Controls how much recency (when last heard) vs proximity (distance) matters
# 0.0 = 100% proximity (only distance matters)
# 1.0 = 100% recency (only when last heard matters)
# 0.4 = 40% recency, 60% proximity (default - balanced for path routing)
recency_weight = 0.4
[Prefix_Command]
# Enable or disable the prefix command
# true: Prefix command is available (responds to 'prefix', 'repeater', 'lookup')
# false: Prefix command is disabled
enabled = true
# Enable or disable repeater geolocation in prefix command
# true: Show city names with repeaters when location data is available
# false: Show only repeater names without location information
show_repeater_locations = true
# Use reverse geocoding for coordinates without city names
# true: Automatically look up city names from GPS coordinates
# false: Only show coordinates if no city name is available
use_reverse_geocoding = true
# Hide prefix source information
# true: Hide "Source: domain.com" line from prefix command output
# false: Show source information (default)
hide_source = false
# Prefix heard time window (days)
# Number of days to look back when showing prefix results (default command behavior)
# Only repeaters heard within this window will be shown by default
# Use "prefix XX all" to show all repeaters regardless of time
prefix_heard_days = 7
# Prefix free time window (days)
# Number of days to look back when determining which prefixes are "free"
# Only repeaters heard within this window will be considered as using a prefix
# Repeaters not heard in this window will be excluded from used prefixes list
prefix_free_days = 7
# Maximum range for prefix filtering (kilometers)
# Repeaters beyond this distance from bot location will be excluded from prefix lookups
# This prevents prefix collisions from far-away repeaters from affecting local prefix availability
# Set to 0 to disable range limiting
max_prefix_range = 200
[Multitest_Command]
# Enable or disable the multitest command
# true: Multitest command is available (responds to 'multitest' or 'mt')
# false: Multitest command is disabled
enabled = true
# Response format for multitest command results
# Available fields: {sender}, {path_count}, {paths}, {listening_duration}
# {sender}: Name/ID of message sender
# {path_count}: Number of unique paths found
# {paths}: Newline-separated list of paths
# {listening_duration}: Listening window duration in seconds
# Leave empty to use default format
# Example: "Found {path_count} unique path(s) for @[{sender}]:\n{paths}"
response_format =
####################################################################################################
# #
# All Other Commands Disabled #
# #
# The following commands are explicitly disabled in this minimal configuration. #
# To enable any of these commands, uncomment and set enabled = true in the appropriate section. #
# #
####################################################################################################
[Help_Command]
# Enable or disable the help command
enabled = false
[Cmd_Command]
# Enable or disable the cmd command
enabled = false
[Joke_Command]
enabled = false
[DadJoke_Command]
enabled = false
[Sports_Command]
enabled = false
[Stats_Command]
enabled = false
[Hacker_Command]
enabled = false
[Greeter_Command]
# Enable or disable the greeter command
enabled = false
[Alert_Command]
enabled = false
[Announcements_Command]
# Enable or disable the announcements command
enabled = false
[Web_Viewer]
# Enable or disable the web data viewer
# SECURITY NOTE: Web viewer has NO AUTHENTICATION built-in
# Only enable if you understand the security implications
enabled = false
[Wx_Command]
# Enable or disable the weather command
enabled = false
[Aqi_Command]
# Enable or disable the AQI command
enabled = false
[Sun_Command]
# Enable or disable the sun command
enabled = false
[Moon_Command]
# Enable or disable the moon command
enabled = false
[Solar_Command]
# Enable or disable the solar command
enabled = false
[Aurora_Command]
# Enable or disable the aurora command
enabled = false
[Solarforecast_Command]
# Enable or disable the solar forecast command
enabled = false
[Hfcond_Command]
# Enable or disable the HF conditions command
enabled = false
[Satpass_Command]
# Enable or disable the satellite pass command
enabled = false
[Catfact_Command]
# Enable or disable the catfact command
enabled = false
[Hello_Command]
# Enable or disable the hello command
enabled = false
[Channels_Command]
# Enable or disable the channels command
enabled = false
[Advert_Command]
# Enable or disable the advert command
enabled = false
[Dice_Command]
# Enable or disable the dice command
enabled = false
[Roll_Command]
# Enable or disable the roll command
enabled = false
[Magic8_Command]
# Enable or disable the magic 8 ball command
enabled = false
[Repeater_Command]
# Enable or disable the repeater command
enabled = false
[WebViewer_Command]
# Enable or disable the webviewer command
enabled = false
[Feed_Command]
# Enable or disable the feed command
enabled = false