legion-server 0.1.0

🏛️ Legion Server - Secure IRC server with Legion Protocol support
# IronChatD Configuration File
# This is a comprehensive configuration file for the IronChat IRC server

[server]
# Server identity
name = "ironchatd.local"
description = "IronChat IRC Server - Modern IRCv3 Implementation"

# Network binding
listen_addresses = ["127.0.0.1:6667", "0.0.0.0:6667"]
tls_listen_addresses = ["127.0.0.1:6697", "0.0.0.0:6697"]

# Message of the day file (optional)
motd_file = "motd.txt"

[network]
# Network information
name = "IronChat"
admin_name = "Server Administrator"
admin_email = "admin@example.com"
server_id = "001"

[database]
# Database connection
# Supports both PostgreSQL and SQLite
# PostgreSQL: "postgres://user:password@localhost/ironchatd"
# SQLite: "sqlite://ironchatd.db"
url = "sqlite://ironchatd.db"
max_connections = 10
connection_timeout = 30

[security]
# TLS configuration (optional but recommended for production)
# tls_cert_file = "/etc/ironchatd/server.crt"
# tls_key_file = "/etc/ironchatd/server.key"
require_tls = false
min_tls_version = "1.2"

# Password hashing algorithm
password_hash_algorithm = "argon2"

# Operator password (hashed)
# Generate with: ironchatd --hash-password
# operator_password = "$argon2id$v=19$m=19456,t=2,p=1$..."

[limits]
# Connection limits
max_clients = 10000
max_clients_per_ip = 10

# Per-user limits
max_channels_per_user = 50
max_nickname_length = 30

# Channel limits
max_channel_name_length = 50
max_topic_length = 390

# Message limits
max_message_length = 512
max_away_length = 255
max_kick_reason_length = 255

# Timing
ping_frequency = 120  # seconds
ping_timeout = 60     # seconds

# Flood protection
flood_messages = 10   # max messages
flood_interval = 1    # per second
throttle_duration = 60 # penalty duration in seconds

[features]
# Core IRCv3 capabilities (Ratified) - enable/disable specific features
enable_sasl = true
enable_message_tags = true
enable_server_time = true
enable_account_notify = true
enable_account_tag = true
enable_away_notify = true
enable_batch = true
enable_cap_notify = true
enable_chghost = true
enable_echo_message = true
enable_extended_join = true
enable_invite_notify = true
enable_labeled_response = true
enable_monitor = true
enable_multi_prefix = true
enable_setname = true
enable_standard_replies = true
enable_userhost_in_names = true
enable_bot_mode = true
enable_utf8only = true
enable_strict_transport_security = true
enable_chathistory = true

# 2024 Bleeding-edge capabilities (Latest IRCv3 features)
enable_message_redaction = true      # April 2024 - Message deletion/redaction
enable_account_extban = true         # July 2024 - Account-based bans
enable_metadata_2 = true             # September 2024 - User metadata v2

# Draft capabilities (Work in Progress) - Experimental features
enable_multiline = true              # Multi-line messages with batching
enable_read_marker = true            # Read receipt tracking
enable_relaymsg = true               # Bot message relaying
enable_typing = true                 # Typing indicators
enable_pre_away = true               # Away status during registration
enable_websocket = false             # WebSocket transport (not implemented)

# Standard IRC features
enable_ctcp = true
enable_dcc = false  # Disabled by default for security

# Advanced feature configuration
[features.advanced]
# Message redaction settings
redaction_window_seconds = 3600     # 1 hour window for message redaction
max_stored_messages = 10000         # Maximum messages stored for redaction

# Multiline message settings
multiline_max_bytes = 4096          # Maximum bytes in multiline message
multiline_max_lines = 100           # Maximum lines in multiline message

# Typing indicator settings
typing_timeout_seconds = 30         # How long typing status persists
typing_throttle_seconds = 3         # Minimum interval between typing notifications

# Read marker settings
read_marker_auto_send = true        # Automatically send read markers on join

# Chathistory settings
chathistory_max_messages = 1000     # Maximum messages in history request
chathistory_retention_days = 30     # How long to keep chat history

# Logging
[logging]
level = "info"
format = "pretty"  # pretty, json, compact
file = "/var/log/ironchatd/server.log"
max_file_size = "100MB"
max_files = 10

# Default channel modes for new channels
[defaults]
channel_modes = "nt"  # +n (no external messages), +t (topic protection)
user_modes = ""       # No default user modes

# MOTD configuration
[motd]
# If motd_file is not specified, use inline content
content = """
Welcome to IronChat IRC Network!

This server is running IronChatD - a modern IRC server written in Rust.

Features:
- Full IRCv3 protocol support
- SASL authentication
- TLS encryption available on port 6697
- Advanced channel management
- Flood protection and security features

For help, join #help or contact an operator.

Please follow the network rules and be respectful to other users.

Enjoy your stay!
"""

# Advanced security settings
[security.advanced]
# Enable connection throttling
enable_connection_throttling = true
connection_throttle_rate = 10  # connections per second
connection_throttle_burst = 50

# Enable hostname resolution
resolve_hostnames = true
hostname_timeout = 5  # seconds

# Enable ident lookups (RFC 1413)
enable_ident = false
ident_timeout = 3  # seconds

# Ban management
max_bans_per_channel = 100
ban_expire_time = 86400  # 24 hours in seconds

# Monitoring and metrics
[monitoring]
# Enable metrics endpoint for Prometheus
enable_metrics = true
metrics_bind = "127.0.0.1:9090"

# Enable health check endpoint
enable_health_check = true
health_check_bind = "127.0.0.1:8080"

# Statistics collection
collect_statistics = true
statistics_interval = 60  # seconds

# Server linking (for future network expansion)
[linking]
enabled = false
# hub_password = "secure_hub_password"
# allowed_hubs = ["hub1.example.com", "hub2.example.com"]
# max_servers = 10