Skip to content
Help Center
Home / Help Center / I'm a developer

CR-Avatar for ircd-hybrid

One page: get the open-source module, install it on ircd-hybrid 8.2.47, check it works, and run its 74 automated tests.

cr_avatar is a module for ircd-hybrid 8.2.47 that adds the CR-AVATAR protocol: your ircd advertises CR-AVATAR=1, offers the capability conferencerooms.org/avatar, and sends AVATAR messages to clients that ask for them. Clients that do not know the protocol notice nothing. It is free software (GPL-2.0-or-later, like ircd-hybrid).

On this page: Download - What you need - Install - Check that it works - Run the tests - Troubleshooting - Upgrade and uninstall - License and questions

Download

FileWhat it is
ircd-hybrid-cr-avatar-0.1.0.zipThe whole package: module source, core patch, tests, documents.
SHA-25637220e78356e428b6a5a771de950d13a1f36ee10cfadc223f80f066ee12e54a2

Check it before you use it: shasum -a 256 ircd-hybrid-cr-avatar-0.1.0.zip (Linux: sha256sum). The package contains:

cr_avatar/
  README.md  INSTALL.md  LICENSE  CHANGELOG.md
  src/cr_avatar.c            the module
  src/Makefile               builds it against your ircd-hybrid tree
  patches/ircd-hybrid-8.2.47-cr-avatar-hooks.patch     six small core changes
  tests/                     build_and_test.sh, the test scripts, a scratch configuration
  docs/                      SERVICES.md, TESTING.md, PORTING.md

You also need the ircd-hybrid 8.2.47 source from the ircd-hybrid project.

What you need

Install

Read this first. The core patch adds hooks to ircd-hybrid, so the ircd must be rebuilt and restarted once. A restart disconnects every user: choose a quiet time and announce it. Try everything on a scratch copy first (see Run the tests).

1. Back up

Back up your source tree, the installed binary and modules folder, ircd.conf and modules.conf.

2. Unpack and patch the source

sh
unzip ircd-hybrid-cr-avatar-0.1.0.zip
tar xzf ircd-hybrid-8.2.47.tar.gz && cd ircd-hybrid-8.2.47
patch -p1 --dry-run < ../cr_avatar/patches/ircd-hybrid-8.2.47-cr-avatar-hooks.patch   # must list 6 files and no rejects
patch -p1 < ../cr_avatar/patches/ircd-hybrid-8.2.47-cr-avatar-hooks.patch

If you already carry your own patches to src/channel.c, modules/m_join.c or modules/m_sjoin.c, apply the three one-line hook_dispatch(...) additions by hand (docs/PORTING.md shows where).

3. Build and install ircd-hybrid

Use the same ./configure options as your running ircd.

sh
./configure --prefix=/opt/ircd-hybrid     # plus your usual options
make && make install

4. Build and install the module

Install it into the folder that holds the other .la files (m_join.la, cap_chghost.la ...).

sh
make -C ../cr_avatar/src HYBRID_SRC=$PWD MODDIR=/opt/ircd-hybrid/lib/ircd-hybrid/modules install

If you gave ./configure a CPPFLAGS (for example -I/opt/openssl/include so TLS is built in), export the same CPPFLAGS first. Without it the build stops with openssl/ssl.h file not found.

5. Load it

Add one line to modules.conf:

loadmodule "cr_avatar.la";

6. Restart the ircd

In the log you should see Module cr_avatar.la ... loaded.

Check that it works

Connect with any client (or openssl s_client -connect your.server:6697) and look for three things:

CAP LS 302                          -> the list contains  conferencerooms.org/avatar
(the 005 lines)                     -> one of them contains  CR-AVATAR=1
CAP REQ :conferencerooms.org/avatar
CAP END
JOIN #somechannel                   -> right after the end-of-NAMES reply (366):
                                       :nick!user@host AVATAR <emoji> <name>     for each member that has an avatar

Then set or change an avatar with your services. Clients that asked for the capability get one AVATAR line about 1 to 3 seconds later; AVATAR * means it was removed. /WHOIS still shows has an avatar set: <emoji> :<name>: for everybody. If services leave, clients get 005 ... -CR-AVATAR and the capability disappears from CAP LS; when services come back, both return.

Run the tests

The tests never touch your real ircd or any network. They build a throw-away ircd-hybrid 8.2.47 in a temporary folder with the patch and the module, start it on 127.0.0.1 ports 47740 to 47743, link a fake services server and a fake second server to it, and talk to it with plain sockets.

sh
cd cr_avatar
tests/build_and_test.sh /path/to/ircd-hybrid-8.2.47.tar.gz [/path/to/prefix-with-jansson-and-openssl]

The optional second argument is a folder with include/ and lib/ for jansson (and OpenSSL, if you want the TLS tests; without OpenSSL headers the TLS tests are skipped and the script says so). The last line is ==> all tests passed.

What is checked (74 checks: 37 on plain connections, the same 37 over TLS):

GroupChecks
Token and capabilityNot offered before services are linked; offered and ACKed afterwards; the 005 token is visible even to clients that do not ask for the capability.
Bulk and liveOne AVATAR per member that has one, after the 366 reply; members without an avatar are not mentioned; a change reaches each capable client once; removal is AVATAR *; a joiner with an avatar is announced right after the JOIN; the user is told about their own avatar.
SafetyClients without the capability get no AVATAR line; /WHOIS is unchanged; a value with whitespace and the operator badge text are never announced.
Services come and go005 -CR-AVATAR when services leave; capability removed from CAP LS; both return when services return; avatars that are still there are announced again.
A second linked serverA remote user's avatar is announced after an SJOIN and after a plain remote JOIN; bulk after 366 includes remote members; a remote change reaches a local member once; services connected through the second server work like services linked directly.
NetsplitWhen the second server splits, its users quit with the split message, no AVATAR line is produced, the ircd keeps working; after the re-link the returning user is announced again, once; splitting the server that carries services withdraws the token.
TLSEvery check above again, with clients on a TLS port and both server links over TLS (a self-signed certificate; TLS 1.2 was negotiated in the test log).

Not tested by the authors: other ircd-hybrid versions (only 8.2.47), a production network, auditorium or other special channel modes, three or more linked servers, and TLS with a certificate check. To try it on a copy of your own configuration, point your client at the scratch ircd (./bin/ircd -f -c etc/ircd.conf inside the scratch prefix) or add the module to a test server of your own.

Troubleshooting

SymptomLikely cause
Module cr_avatar.la ... loaded is not in the logWrong MODDIR, or the module was built against a different tree than the running ircd. Rebuild it after every rebuild of ircd-hybrid.
openssl/ssl.h file not found while building the moduleExport the same CPPFLAGS you gave ./configure.
The capability is not in CAP LSServices are not linked, or your services server is not named in a service {} block. The capability appears about a second after services link.
An avatar never changesYour services append SVSTAG tags instead of replacing them. To change an avatar, send SVSTAG <nick> 0 - first and then every tag again. See services authors.
Services send the tag but nothing happensThe user-mode field of the SVSTAG must start with + (for "visible to everybody").
A server that carries services is refusedIn ircd.conf the connect block of the hub needs hub_mask = "*"; so it may introduce other servers.

Upgrade and uninstall

License and questions

The package is licensed GPL-2.0-or-later, the same as ircd-hybrid, so that adopting it is simple: a module for ircd-hybrid is part of a GPL program. The license applies to this package only. It does not apply to the CR-AVATAR protocol (anybody may implement it under any license), to ConferenceRooms' other software, or to modules for other ircds: each of those is licensed on its own. This is a summary, not legal advice.

Say hi in #CR.

Support Room

Ask HelpServ.

Type /hs in any room for help on every command.

Open the Web Chat