ircd

package module
v0.0.0-...-9a64fde Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 15 Imported by: 0

README

ircd

Somewhat complex IRC server which implements a subset of RFC1459.

By default the server will run on port 6667 and prometheus metrics are exposed on port 2112. See docker-compose.yml for example environment variable configuration.

Features

IRC Commands
  • TLS
  • CAP
  • PRIVMSG
  • NICK
  • USER
  • JOIN
  • PART
  • TOPIC
  • WHO
  • WHOIS
  • KICK
  • LUSERS
  • PASS
  • OPER (pertial, no commands)
  • LIST (partial, no ELIST)
  • INVITE
  • VERSION (partial, local server only)
  • ADMIN
  • MODE (client: iortz, channel: mspnzt, member: vhoaq)
  • AWAY
  • LINK
  • IRCv3

Environment variables

  • SERVER_NAME (string)
  • SERVER_VERSION (string)
  • PORT (int)
  • PORT_TLS (int)
  • PROMETHEUS (unset is false)
  • TLS (unset is false)
  • TLS_CERTIFICATE (path)
  • TLS_KEY (path)

Installation

Generate TLS Key Pair
mkdir tls && cd tls
openssl genrsa -out servercakey.pem
openssl req -new -x509 -key servercakey.pem -out serverca.crt
openssl genrsa -out server.key
openssl req -new -key server.key -out server_reqout.txt
openssl x509 -req -in server_reqout.txt -days 3650 -sha256 \
 -CAcreateserial -CA serverca.crt -CAkey servercakey.pem -out server.crt
Local
  1. Run go mod download && go build -v -o ./dist/ircd ./cmd.
  2. The binary can be found under the dist directory.
  3. Run with SERVER_NAME=foo SERVER_VERSION=0.1 PORT=6667 ./dist/ircd
Docker

Note: in order for clients to discover their IP address and get the real remote IP address, the server needs to run using the host network driver. If host networking is not enabled all clients will use the Docker gateway address which might lead to interesting situations.

  1. Configure the environment variables in in docker-compose.yml.
  2. Run docker compose up.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChannelStore

func NewChannelStore(id string) *channelStore

func NewClientStore

func NewClientStore(id string) *clientStore

func NewCommandRouter

func NewCommandRouter(s *server) *commandRouter

func NewServer

func NewServer(config ServerConfig) *server

Types

type ChannelStorer

type ChannelStorer interface {
	// contains filtered or unexported methods
}

type ClientStorer

type ClientStorer interface {
	// contains filtered or unexported methods
}

type OperatorStore

type OperatorStore struct {
	// contains filtered or unexported fields
}

func NewOperatorStore

func NewOperatorStore() *OperatorStore

type OperatorStorer

type OperatorStorer interface {
	// contains filtered or unexported methods
}

type ServerConfig

type ServerConfig struct {
	Name     string
	Password string
	Network  string
	Version  string
	MOTD     []string

	TLS             bool
	CertificateFile string
	CertificateKey  string

	PingFrequency  int
	PongMaxLatency int

	Parameters ServerConfigParameters
}

type Serverer

type Serverer interface {
	Run(listener net.Listener, isTLS bool)
}

Directories

Path Synopsis
tools
flood Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL