Friday, October 8, 2010

Create your IRC Channel and make the logs publicly available

I was trying to create an IRC channel for our final year project discussions and started with registering a channel at freenode. I thought of keeping logs to monitor the activities on the channel and with the help of Gryllida at #freenode, I was able to setup the log as well. So I thought of writing a blog entry to have all steps in one place so that it will be easy for my future reference as well as for some others.

Registering a channel at freenode:

Before registering the channel you should check the availability of the channel name. Use the following command
/msg ChanServ info #channelname
If the channel is already registered, it will give you some information about it. If not, you will get a response like the following
-ChanServ- The channel [#channelname] is not registered
To create the channel first you should join the channel.
/join #channelname
If you are the first person to join, then you create it. To register the channel use
/msg ChanServ register #channelname
This will link the channel with your nickname and will give your the top level access.

Registering for a shell space at Bshellz:

To persist the logs of your channel you should have to host a bot on a server somewhere. But sites like Bshellz provide free server account with limited space. To sign up for a free shell just send BeschBot ( after joining #bzhellz) the private message !wantshell.

To register, type
!register <desired-username> <email>
In a short while you will receive an email with the confirmation code. Then issue the command
!confirm <confirmation-code>
Once you have done that, your shell will be created in 5 minutes time and you will receive an email with all the details.

Once you have registered you every 168 hours visit channel #bshellz on Freenode Network, and say
!keep <username>
to make your shell active. If you fail to do this in a 168 hour period, then your account will be deleted.

You can access your server space via
$ ssh server1.bshellz.net -l <username>
if you are on a *nix platform. You can find the steps for other operating system here.

Enable auto logging:

After doing ssh into the server, you should issue the following commands
screen
irssi
/set autolog ON
/save
/connect irc.freenode.net
/join #channel
The logs will be located at ~/irclogs/

You can use Ctrl+A and then D to detach the screen. cd irclogs, ls , cd freenode,ls will take you to the freenode logs directory.

In this way you can access the logs by logging into your server space. But if you want to keep the logs accessible online, you can do the following.

Make the logs available publicly:

Make sure you have ~/public_html/. Then issue the command
screen -rAad
then
/set autolog_path ~/public_html/$tag/$0.log
and then
/save
In the above set command, $tag indicates the IRC server (freenode in this case) and $0 indicates the #channel. These variables change from network to network, from channel to channel, so they have a '$' before. The client would set these variables itself for any channels that you open. So it is enough to use the command /set autolog_path ~/public_html/$tag/$0.log

Then say something in the channel and do 'cd public_html'
Check whether you have the 'freenode' directory there by doing 'ls'.
If the freenode directory is not there then do 'cd ~' and 'chmod a+w public_html'.
Then issue
screen -rAad
/reload
then Ctrl+A ,D.
Say something in the channel and do 'cd public_html' and you should have 'freenode' inside.

You can access the logs via the following url

yourusername.bshells.net/freenode/#channel.log

If you couldn't access the page try the following
chmod a+x freenode
chmod a+r freenode
then
cd freenode
and
chmod a+r #channel.log

By doing this you will be able to access your logs via
yourusername.bshells.net/freenode/#channel.log.

You should remember to do
!keep <username>
weekly at
#bshellz.

This way I have successfully created the IRC channel with logs.

I should thank Gryllida at #freenode for the great support in figuring out the stuff with understanding.

Hope this will help someone...