This repository contains a split-architecture IRC client/bouncer written in Go.
The system consists of two main components:
-
Server (
server/):- Connects to an upstream IRC network (e.g., Libera.Chat).
- Maintains a persistent connection and buffers recent messages for configured channels.
- Exposes a gRPC service for clients to connect, retrieve history, and receive live updates.
- Supports mTLS (Mutual TLS) for secure client-server communication.
-
Client (
client/):- Connects to the Server via gRPC using mTLS.
- Provides a terminal interface (raw mode) to view messages.
- Supports channel switching (
Ctrl-N,Ctrl-P) and graceful disconnect (Ctrl-D).
- Persistent Presence: The server stays connected even when the client disconnects.
- Message History: Clients receive recent message history upon connection.
- Security: gRPC connection is secured with Mutual TLS (mTLS), ensuring only authorized clients can connect.
- Configuration: All configuration is handled via a
textprotofile for readability.
- Bazel: The project uses Bazel as its build system. Please install the latest version of Bazel (e.g., via Bazelisk) to build and run the code.
Run the helper script to generate a Certificate Authority (CA), Server, and Client certificates:
./gen_certs.shThis will create a certs/ directory containing:
ca.crt,ca.keyserver.crt,server.keyclient.crt,client.key(Common Name:client_user)
Edit config.textproto to set your IRC details and certificate paths:
irc: {
host: "irc.libera.chat"
port: 6697
use_tls: true
nick: "MyBotNick"
user: "MyBotUser"
# password: "optional_password"
}
channels: {
name: "#go-nuts"
history_limit: 100
}
service: {
port: 50051
}
tls: {
ca_file: "certs/ca.crt"
cert_file: "certs/server.crt"
key_file: "certs/server.key"
client_cn: "client_user" # Must match CN in gen_certs.sh
client_cert_file: "certs/client.crt"
client_key_file: "certs/client.key"
}bazel run //server:server -- --config $(pwd)/config.textprotobazel run //client:client- Ctrl-N: Next Channel
- Ctrl-P: Previous Channel
- Ctrl-C / Ctrl-D: Quit
Run unit tests for all components using Bazel:
bazel test //...