Synopsis
Titlebot is a minimal IRC bot that announces the title of web pages.
Features
- TOML-formatted configuration file with integrity checking using BLAKE2b
- On-the-fly configuration reload upon receiving signal SIGUSR1
- Graceful termination upon receiving signal SIGINT and SIGTERM
- Minimalistic permission system (permitted actions per NickServ account)
- Caching of titles, using both in-memory and persistent databases
- Use of archive.org's API for web pages that would otherwise have the title "Violation of ToS" or the like
- Automatic conversion of YouTube URLs to the form of
https://www.youtube.com/embed/ID
, and skip looking for an archived version
- Proxy support
For details, please do consult config.toml.example
and main.go
.
Planned Features
- Parsing of
PRIVMSG NickServ :ACC
when the IRCd has no account-tag
capability
Prerequisites
github.com/BurntSushi/toml
github.com/lrstanley/girc
golang.org/x/crypto/blake2b
golang.org/x/net/html
golang.org/x/net/proxy
zolk3ri.name/go/logger
Getting Started
# Rename `config.toml.example` to `config.toml`:
mv config.toml.example config.toml
Note: do NOT forget to modify config.toml
before executing any of the steps below, including deployment with Docker!
# With go version >= 1.11:
go build -mod vendor
# Otherwise you have to `go get <prerequisite>`, then:
go build
# And finally:
./titlebot
Deployment with Docker
docker build -t titlebot .
docker volume create titlebot
docker run -d --name titlebot -v titlebot:/go/src/zolk3ri.name/go/titlebot --restart always titlebot
This will 1) build an image from the Dockerfile
and copy your current config.toml
to it, 2) create a volume called titlebot for persistent storage, and 3) run titlebot through a daemon that will automatically restart on failure. This will render the configuration setting auto-reconnect
pointless. Additionally, expertise in Docker is required to be able to use some of the features, for example the on-the-fly configuration reload, as it relies on sending and receiving signals. You may simply use screen
or tmux
instead.
Reporting Bugs
Do not hesitate to contact me via the e-mail address provided in the license file.
Author
Written by Zoltán Kéri.
License
ISC. Consult license file LICENSE
for more information.