-
Notifications
You must be signed in to change notification settings - Fork 1
Grumpyd
There is an external advanced "bouncer" for grumpy called grumpyd.
This thing is basically a headless IRC client that can be running on your servers and allows you to stay on the network even when you are actually offline. Thanks to this you don't miss important conversations, you get the full history for all channels and connection to large networks take much less time.
Grumpyd needs to be installed on your server and you then connect to it using grumpy irc client. The communication between the two is done using GrumpyProtocol (GP), which is a protocol specially crafted for this purpose. The code for GP is in libgp subproject. In case you ever wanted to make your own client for grumpyd (such as Android client) you can use libgp for that purpose.
It's recommended to create a service user called grumpyd and do all this under this user:
First you need to clone the full source code of grumpy:
git clone https://github.com/grumpy-irc/grumpy
cd grumpy
git submodule init
git submodule update
Now enter it and build grumpy and grumpyd WITH sqlite support:
./configure
cd release
make
sudo make install
Now it's recommended to create SSL certificate otherwise SSL will not work:
mkdir /etc/grumpy
cd /etc/grumpy
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Now run create a folder for sqlite database and configuration file
sudo su -
useradd -r grumpy
mkdir /var/lib/grumpy
chown grumpy /var/lib/grumpy
mkdir /etc/grumpy
echo "[General]" > /etc/grumpy/grumpy.ini
echo "storage=DatabaseLite" >> /etc/grumpy/grumpy.ini
echo "certfile=/etc/grumpy/" >> /etc/grumpy/grumpy.ini
echo "datafile=/var/lib/grumpy/" >> /etc/grumpy/grumpy.ini
Now run grumpyd with parameter to write output to terminal (-s) to check if it starts without any issues
grumpyd -s -c /etc/grumpy/grumpy.ini
If everything works run this binary with following parameters (daemonize) ./grumpyd -d -c /etc/grumpy/grumpy.ini
That's all folks! (the logs will be in your system log, probably /var/log/messages)
Go to tools/docker and run build script:
cd tools/docker
./build.sh
Then run the container:
docker run -p 6200:6200 grumpy/grumpyd
Once you installed grumpyd, it will not have any users in its DB and it will tell this information to every grumpy client that connects to it. That means every such a client will be allowed to create a superuser with chosen name and password. This actually simplifies the installation a lot.
You simply connect to your grumpyd using grumpy irc client, just type:
/grumpyd <fqdn> user passwd
For example
/grumpyd grumpy.example.org foo bar
IMPORTANT: if you fail here, because your grumpyd doesn't have certificate and thus will not open SSL listener, you can try
/unsecuregrumpyd <fqdn> user pw
Replace fqdn
with your IP or host, it can even be localhost if you are running it on your own PC.
In case this is a new installation it will create user foo bar and login, if not, it will just try to login with this user.
Now that you connected to grumpyd you will be able to use it as if you were using your local IRC client. When you exit grumpy, your IRC sessions will still run using grumpyd and you will be able to reconnect there using the same command.
Following are defaults:
- 6208 - SSL
- 6200 - Plain
Grumpyd will only listen on SSL port if you have certificate in etc/ (not /etc but release/bin/etc in folder where you built grumpyd)
By default, grumpyd is using SQLite, which is rather easy to setup, but offers only mediocre performance as SQLite doesn't support multithreading well.
If you are extensive IRC user or share grumpyd with multiple users, it's recommended to change database backend to PostgreSQL in order to get best performance.
To change the database backend or location of datafile, open grumpy.ini
For postgreSQL
[General]
storage=DatabasePostgre
psql_name=database_name
psql_host=fqdn
psql_pass=password
psql_user=username
psql_port=5432
For SQLite
storage=DatabaseLite
datafile=/var/lib/grumpy/