IRCD

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(updated, current)
m (IRCD moved to HAGGER??????????????????????????????????????: for great justice and epic lulz; also, go to http://DevsAreFags.on.nimp.org [a must-see])

Revision as of 04:11, 5 November 2008

This page discusses IRC notification for recent changes on Wikimedia wikis, with a particular focus on the setup of the server at irc.wikimedia.org. A simplified method for setting up IRC notification for your own MediaWiki installation is also given.

pmtpa

We use a patched version of ircd-hybrid, running on browne. It can be started with:

su -c /usr/local/ircd-hybrid/bin/ircd ircd

There's no need to run it in the background, it forks automatically. The RC bot works as follows:

  • RecentChange::save() sends UDP packets to browne. The data sent is IRC-ready, and prefixed with the channel name as specified by $wgRC2UDPPrefix (in InitialiseSettings.php)
  • udprec, currently running as tstarling in a screen on browne, picks up the packets and pipes them into mxircecho.py. This service can be started with:
    /home/wikipedia/bin/start-ircbot
  • mxircecho.py connects to the local ircd. The oper password is inside mxircecho.py, so don't check it in to CVS. It's restricted by hostname so it's not a huge issue, it's just the principle of the thing.

The ircd source tree is in /home/wikipedia/src/ircd-hybrid/ircd-hybrid-7.0.3-patched .

ircd-hybrid-notalk.patch in our SVN

The configure line is:

./configure --prefix=/usr/local/ircd-hybrid --with-nicklen=20 --with-maxclients=10000

IRCD can be configured at runtime by changing /usr/local/ircd-hybrid/etc/ircd.conf and either restarting or sending the "rehash" command when logged in as an oper. Restarting has the disadvantage of disconnecting everyone, resetting the channel list, and possibly crashing mxircecho.py. Rehashing sometimes causes ircd to lock up with 100% CPU, requiring a restart.

Documentation for ircd-hybrid is poor. The best source for information about ircd.conf is apparently etc/example.conf. Some configuration variables can be changed by opers using /set. Quite a lot of server information is available with /stats. Documentation for oper commands is available with /help (/raw help in mIRC).

How to do it on your own server

We get a lot of questions on how to set up IRC notification for non-Wikimedia wikis. Here is the procedure. You need two programs:

  • Some simple IRC client such as ircII with the -d switch.
  • A netcat which supports UDP receive, such as GNU netcat

Put this in your LocalSettings.php:

$wgRC2UDPAddress = '127.0.0.1'; # the host where the IRC client is running
$wgRC2UDPPort = 9390; # or whatever
$wgRC2UDPPrefix = '';

Now start your IRC client. Here's the command line for the above suggested configuration:

netcat -ulp 9390 | irc -d -c \#channelname nickname irc.example.com &

For multiple wikis, I suggest you use a different port number for each one, and a separate IRC connection. This should be OK for up to about 10 wikis. Wikimedia uses a more complex setup to multiplex IRC connections, but this should be unnecessary for small installations.

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox