# Styrene Configuration Example
# Location: ~/.styrene/config.yaml
#
# This file shows all available configuration options with defaults.
# Copy to ~/.styrene/config.yaml and customize as needed.

# TUI display settings
tui:
  theme: imperial-crt         # Visual theme (currently only imperial-crt)
  log_level: info             # Logging: debug, info, warning, error
  show_hardware_panel: true   # Show hardware info on dashboard
  confirm_destructive: true   # Confirm before dangerous operations

# Fleet management
fleet:
  edge_fleet_path: null       # Path to edge-fleet repo (optional)
  inventory_file: inventory/devices.yaml
  auto_sync_inventory: true   # Update inventory after provisioning

# Provisioning defaults
provisioning:
  default_device_type: null   # Pre-select device type (e.g., "rpi4")
  ssh_key_paths:              # SSH keys to include (auto-detected)
    - ~/.ssh/id_ed25519.pub
    - ~/.ssh/id_rsa.pub
  default_hostname_prefix: node  # Prefix for auto-generated hostnames

# Mesh network defaults
mesh:
  enable: true                # Enable mesh networking by default
  mesh_id: styrene            # Mesh network identifier
  channel: 6                  # WiFi channel (1-14)
  gateway_mode: client        # off, client, or server
  interface: null             # Explicit interface or null for auto-detect

# Reticulum mesh configuration
reticulum:
  config_path_override: null  # Override RNS config location
  auto_initialize: true       # Auto-create RNS config if missing

  # Deployment mode
  mode: standalone            # standalone, hub, or peer

  # Transport settings
  enable_transport: null      # null=auto (hub=true, others=false), true, false

  # Operator identity
  operator_identity_path: null  # null = ~/.styrene/operator.key

  # Announce interval (seconds)
  announce_interval: 300      # Re-announce every 5 minutes

  # Network interfaces
  interfaces:
    auto: true                # Enable AutoInterface (local UDP discovery)

    # TCP server (hub mode)
    server:
      enabled: false          # Enable TCP server (auto-enabled in hub mode)
      listen_ip: 0.0.0.0      # Bind address (0.0.0.0 = all interfaces)
      port: 4242              # TCP port

    # Peer connections
    peers: []                 # List of peer hubs to connect to
    # Example peer:
    # - host: home.vanderlyn.house
    #   port: 4242
    #   name: Home Hub

  # Hub connection (Phase 2)
  hub_enabled: false          # Connect to Styrene Hub
  hub_address: null           # Hub LXMF address (32 hex chars)

# HTTP API (headless mode)
api:
  enabled: false              # Enable HTTP API
  host: 0.0.0.0               # Bind address
  port: 8000                  # API port

# Advanced settings
advanced:
  debug_mode: false           # Enable debug features
  telemetry_enabled: false    # Send anonymous usage stats (future)
  headless: false             # Run without TUI
  config_version: 1           # Config schema version


# ============================================================================
# USAGE EXAMPLES
# ============================================================================

# Example 1: Standalone laptop/mobile device
# -----------------------------------------
# reticulum:
#   mode: standalone
#   interfaces:
#     auto: true
#     server:
#       enabled: false
#     peers: []
#
# This is the default. Device discovers others via local UDP,
# no external connectivity.


# Example 2: Hub mode (fixed server)
# -----------------------------------
# reticulum:
#   mode: hub
#   enable_transport: true
#   interfaces:
#     auto: true
#     server:
#       enabled: true
#       port: 4242
#     peers: []
#
# Accepts connections from other devices, acts as transport node.
# Access via: other-device --peer yourhub.example.com:4242


# Example 3: Peer mode (connect to specific hubs)
# ------------------------------------------------
# reticulum:
#   mode: peer
#   interfaces:
#     auto: true
#     server:
#       enabled: false
#     peers:
#       - host: home.vanderlyn.house
#         port: 4242
#         name: Home Hub
#       - host: dublin.connect.reticulum.network
#         port: 4965
#         name: Dublin Global Hub
#
# Connects to specified hubs but still works offline via AutoInterface.


# Example 4: Headless hub with API
# ---------------------------------
# reticulum:
#   mode: hub
#   interfaces:
#     auto: true
#     server:
#       enabled: true
#       port: 4242
#
# api:
#   enabled: true
#   port: 8000
#
# advanced:
#   headless: true
#
# Run as background service, manage via HTTP API or remote TUI.


# ============================================================================
# CLI OVERRIDES
# ============================================================================
#
# You can override these settings via CLI arguments:
#
#   styrene --mode hub               # Override mode
#   styrene --port 4242              # Override server port
#   styrene --peer host:port         # Add peer (repeatable)
#   styrene --headless               # Enable headless mode
#   styrene --api-port 8000          # Enable API with port
#
# CLI arguments are saved back to this file when used.


# ============================================================================
# RETICULUM CONFIG
# ============================================================================
#
# Styrene generates Reticulum config at:
#   ~/.config/reticulum/config  (XDG-compliant, preferred)
#   OR
#   ~/.reticulum/config         (legacy fallback)
#
# If RNS config already exists, Styrene uses it.
# If not, Styrene generates it based on the settings above.
#
# You can manually edit RNS config, and Styrene will respect it.
# Or use Styrene CLI flags, and it will regenerate RNS config.
