| Crates.io | legion-server |
| lib.rs | legion-server |
| version | 0.1.0 |
| created_at | 2025-08-21 03:35:57.308826+00 |
| updated_at | 2025-08-21 03:35:57.308826+00 |
| description | ποΈ Legion Server - Secure IRC server with Legion Protocol support |
| homepage | https://github.com/exec/centurion |
| repository | https://github.com/exec/centurion |
| max_upload_size | |
| id | 1804257 |
| size | 637,645 |
A high-performance IRC server built in Rust with comprehensive IRCv3 support, designed for modern chat networks and seamless integration with the Legion Protocol ecosystem.
message-tags - Attach metadata to messagesserver-time - Accurate timestamps on all messagesbatch - Message batching for efficiencyecho-message - Echo sent messages back to sendersasl - Standardized authentication (advertised)git clone https://github.com/dylan-k/centurion.git
cd centurion
cargo build --release
cargo install --git https://github.com/dylan-k/centurion
Centurion uses TOML configuration files. Here's a basic example:
[server]
name = "centurion.example.com"
description = "Centurion IRC Server"
listen_addresses = ["0.0.0.0:6667"]
tls_listen_addresses = ["0.0.0.0:6697"]
motd_file = "/etc/centurion/motd.txt"
[network]
name = "ExampleNet"
admin_name = "Server Admin"
admin_email = "admin@example.com"
server_id = "001"
[database]
url = "postgres://user:password@localhost/centurion"
max_connections = 10
connection_timeout = 30
[security]
tls_cert_file = "/etc/centurion/server.crt"
tls_key_file = "/etc/centurion/server.key"
require_tls = false
min_tls_version = "1.2"
password_hash_algorithm = "argon2"
[limits]
max_clients = 10000
max_clients_per_ip = 10
max_channels_per_user = 50
max_nickname_length = 30
max_channel_name_length = 50
max_topic_length = 390
max_message_length = 512
ping_frequency = 120
ping_timeout = 60
flood_messages = 10
flood_interval = 1
[features]
enable_sasl = true
enable_message_tags = true
enable_server_time = true
enable_account_notify = true
enable_extended_join = true
enable_batch = true
enable_labeled_response = true
enable_echo_message = true
# Use default configuration
centurion
# Specify configuration file
centurion --config /path/to/config.toml
# Run with debug logging
RUST_LOG=debug centurion
Before first run, initialize the database:
# For PostgreSQL
centurion --init-db --config config.toml
# For SQLite (automatic)
centurion --config config-sqlite.toml
FROM rust:1.70 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates libssl3 && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/centurion /usr/local/bin/
EXPOSE 6667 6697
CMD ["centurion"]
# Basic connection
nc localhost 6667
# Or use any IRC client
irssi -c localhost -p 6667
weechat
hexchat
# Request available capabilities
CAP LS
CAP REQ :message-tags server-time batch echo-message
CAP END
JOIN #general
PRIVMSG #general :Hello, world!
TOPIC #general :Welcome to our channel
MODE #general +tm
MODE #general +o alice
KICK #general baduser :Reason for kick
# TAGMSG with client tags (reactions)
@+draft/reply=msgid123;+draft/react=π TAGMSG #channel
# Server adds server-time and msgid tags automatically
@time=2024-01-01T12:00:00.000Z;msgid=abc123 PRIVMSG #channel :Hello!
# Grant operator privileges
MODE #channel +o username
# Set channel modes
MODE #channel +tn # Topic protection + no external messages
MODE #channel +k secret # Set channel key
MODE #channel +l 50 # Set user limit
# Remove modes
MODE #channel -t # Remove topic protection
MODE #channel -o username # Remove operator privileges
Centurion uses a modern actor-based architecture:
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β TCP Listener β β Connection β β Channel β
β βββββΆβ Actors βββββΆβ Actors β
β (Main Loop) β β (Per Client) β β (Per Channel) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
β βΌ β
β ββββββββββββββββββββ β
β β Server Actor βββββββββββββββ
β β (Global State) β
β ββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β Rate Limiter β β Database β
β & Security β β Layer β
βββββββββββββββββββ ββββββββββββββββββββ
Centurion is designed for high performance:
On a 4-core VPS with 2GB RAM:
Centurion implements comprehensive security measures:
Centurion includes comprehensive testing:
# Unit tests
cargo test
# Integration tests
cargo test --test integration
# Performance benchmarks
cargo bench
# IRC protocol compliance
irctest --controller centurion tests/
Centurion uses structured logging with the tracing crate:
# JSON logging for production
RUST_LOG=info CENTURION_LOG_FORMAT=json centurion
# Pretty logging for development
RUST_LOG=debug centurion
Built-in metrics export for monitoring:
/metrics/health for load balancersWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
git clone https://github.com/dylan-k/centurion.git
cd centurion
cargo build
cargo test
# All tests
cargo test
# Specific test category
cargo test --test protocol_tests
cargo test --test security_tests
# With coverage
cargo tarpaulin --out Html
Centurion is licensed under the MIT License. See LICENSE for details.
#centurion on your deployed serverCenturion: A modern IRC server built for the Legion Protocol ecosystem, combining IRC's proven architecture with modern Rust performance and safety.