IRC is not dead, long live IRC!
Orion (Orione in italiano) is my cat and this project is dedicated to him.
Orion is a modern, scalable IRC server built with .NET 9.0, designed to provide robust functionality while maintaining performance and flexibility.
- π Secure connections with SSL/TLS support
- π IPv4 and IPv6 support
- π οΈ Completely modular and extensible architecture
- π Scripting support via JavaScript engine (Jint)
- π Performance metrics and diagnostics
- π Text templating with Scriban
- π§© Plugin system
- π³ Docker support
- π Planning to create bridges for Discord, Matrix, and other platforms
Orion is built as a collection of modular components:
- Orion.Core: Base utilities, extensions and common functionality
- Orion.Core.Server: Server-side core functionality
- Orion.Core.Server.Web: Web API and HTTP interface
- Orion.Irc.Core: IRC protocol implementation
- Orion.Network.Core: Networking abstractions
- Orion.Network.Tcp: TCP implementation for network transports
- Orion.Server: Main application entry point
Orion uses YAML for configuration. On first run, a default configuration file is created at the specified path. Key configuration sections include:
# Server identification
server:
id: auto-generated
host: irc.orion.io
network: OrionNet
description: Orion IRC server
admin:
name: Orion Admin
email: [email protected]
nickname: OrionAdmin
# Network settings
network:
ssl:
certificate_path: path/to/certificate
password: certificate_password
binds:
- host: 0.0.0.0
ports: 6660-6669,6670
network_type: clients
secure: false
use_web_socket: false
# Web HTTP API
web_http:
is_enabled: true
listen_address: 0.0.0.0
listen_port: 23021
jwt_auth:
issuer: Orion
audience: Orion
expiration_in_minutes: 44640 # 31 days
refresh_token_expiry_days: 1
- .NET 9.0 SDK
- SSL certificate (optional, for secure connections)
- Clone the repository:
git clone https://github.com/tgiachi/orion.git cd orion
You can run Orion using Docker:
docker pull tgiachi/orionirc-server
docker run -p 6667:6667 -p 23021:23021 tgiachi/orionirc-server
-
Build the solution:
dotnet build
-
Run the server:
dotnet run --project src/Orion.Server
-c, --config Path to configuration file (default: orion.yml)
-r, --root-directory Root directory for the server
-s, --show-header Show header in console (default: true)
-l, --log-level Log level (Trace, Debug, Information, Warning, Error)
-v, --verbose Enable verbose output
Orion includes a JavaScript engine that allows you to extend functionality through scripts. Scripts are stored in the scripts
directory and can use the modules registered with the server.
Example:
// Access the logger module
logger.info("Server is running!");
// Define event handlers
function onStarted() {
logger.info("Server has started successfully");
// Custom initialization code here
}
The script engine automatically generates TypeScript definitions (index.d.ts
) to provide code completion and documentation for available modules and functions.
To implement a new IRC command:
- Create a class that inherits from
BaseIrcCommand
- Implement the
Parse
andWrite
methods - Register the command with the
IrcCommandParser
service
Example:
public class MyCommand : BaseIrcCommand
{
public MyCommand() : base("MYCMD") { }
public override void Parse(string line)
{
// Parse command logic
}
public override string Write()
{
// Serialize command logic
return $"MYCMD :parameters";
}
}
To handle IRC commands:
- Create a class that inherits from
BaseIrcCommandListener
- Implement the
IIrcCommandHandler<T>
interface - Register the handler for specific server network types
Example:
public class MyCommandHandler : BaseIrcCommandListener, IIrcCommandHandler<MyCommand>
{
public MyCommandHandler(
ILogger<BaseIrcCommandListener> logger,
IIrcCommandService ircCommandService,
IHyperPostmanService postmanService,
IIrcSessionService sessionService
) : base(logger, ircCommandService, postmanService, sessionService)
{
RegisterCommandHandler<MyCommand>(this, ServerNetworkType.Clients);
}
public async Task OnCommandReceivedAsync(
IrcUserSession session,
ServerNetworkType serverNetworkType,
MyCommand command
)
{
// Handle the command
}
}
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: https://github.com/tgiachi/orion