_ _
| | | |
| |_ ___ _ __ _ _| | _____
| __/ _ \ '_ \| | | | |/ / __|
| || __/ | | | |_| | <\__ \ The IRC bot for hackers.
\__\___|_| |_|\__, |_|\_\___/
__/ |
|___/
Tenyks is a computer program designed to relay messages between connections to IRC networks and custom built services written in any number of languages. More detailed, Tenyks is a service oriented IRC bot rewritten in Go. Service/core communication is handled by ZeroMQ 4 PubSub via json payloads.
The core acts like a relay between IRC channels and remote services. When a message comes in from IRC, that message is turned into a json data structure, then sent over the pipe on a Pub/Sub channel that services can subscribe to. Services then parse or pattern match the message, and possibly respond back via the same method.
This design, while not anything new, is very flexible because one can write their service in any number of languages. The current service implementation used for proof of concept is written in Python. You can find that here. It's also beneficial because you can take down or bring up services without the need to restart the bot or implement a complicated hot pluggable core. Services that crash also don't run the risk of taking everything else down with it.
Current supported Go version is 1.7. All packages are vendored with Godep and stored in the repository. I update these occasionally. Make sure you have a functioning Go 1.7 environment.
- Install ZeroMQ4 (reference your OSs package install documentation) and make sure libzmq exists on the system.
go get github.com/kyleterry/tenyks
cd ${GOPATH}/src/github.com/kyleterry/tenyks
make
- this will run tests and buildsudo make install
- otherwise you can find it in./bin/tenyks
cp config.json.example config.json
- Edit
config.json
to your liking.
Why would you ever want to do that?
cd ${GOPATH}/src/github.com/kyleterry/tenyks
sudo make uninstall
There is a Docker image on Docker hub called kyleterry/tenyks
. No
configuration is available in the image so you need to use it as a base image.
You can pass your own configuration in like so:
FROM kyleterry/tenyks:latest
COPY my-config.json /etc/tenyks/config.json
Then you can build your image: docker build -t myuser/tenyks .
and run it
with: docker run -d -P --name tenyks myuser/tenyks
.
You can find binary builds on bintray.
I cross compile for Linux {arm,386,amd64} and Darwin {386,amd64}.
Configuration is just json. The included example contains everything you need to get started. You just need to swap out the server information.
cp config.json.example ${HOME}/tenyks-config.json
tenyks ${HOME}/tenyks-config.json
If a config file is excluded when running, Tenyks will look for configuration
in /etc/tenyks/config.json
first, then
${HOME}/.config/tenyks/config.json
then it will give up. These are defined
in tenyks/tenyks.go and added with ConfigSearch.AddPath(). If you feel more
paths should be searched, please feel free to add it and submit a pull request.
If you want to play right fucking now, you can just use vagrant: vagrant up
and then vagrant ssh
. Tenyks should be built and available in your $PATH
.
There is also an IRC server running you can connect to server on 192.168.33.66
with your IRC client.
Just run tenyks & && disown
from the vagrant box and start playing.
I'm a horrible person. There aren't tests yet. I'll get right on this....
There are only a few tests.
Tenyks comes with very few commands that the core responds to directly. You can get a list of services and get help for those services.
tenyks: !services
will list services that have registered with the bot
through the service registration API..
tenyks: !help
will show a quick help menu of all the commands available to
tenyks.
tenyks: !help servicename
will ask the service to sent their help message to
the user.