From Mageia wiki
Jump to: navigation, search

Install stable package

$ urpmq -i bip
Name        : bip
Version     : 0.8.8
Release     : 5.mga2
Group       : Networking/IRC
Size        : 303253                       Architecture: x86_64
Source RPM  : bip-0.8.8-5.mga2.src.rpm
URL         : http://bip.milkypond.org/
Summary     : IRC Bouncer (proxy)
Description :

Bip is an IRC proxy, which means it keeps connected to your preferred IRC
servers, can store the logs for you, and even send them back to your IRC
client(s) upon connection.
You may want to use bip to keep your logfiles (in a unique format and on a
unique computer) whatever your client is, when you connect from multiple
workstations, or when you simply want to have a playback of what was said
while you were away.

Then configure it as root. First creating a new directory.

# mkdir ~/.bip && cd ~/.bip

Assigning the right permissions.

# chmod 600 bip.pem

Then editing, I use nano to do it, the bip.conf, the file that bip is looking as configuration.

# nano bip.conf

An examble of configuration file could be:

ip = "0.0.0.0";

# To connect a client to bip, try the port below, and
# be sure to set the password to the value
# specified in the network you want to connect to.
port = 7778;

# If you set this to true, you'll only be able to connect to bip
# with a SSL capable IRC client. Be sure to generate a certificate
# for bip with 'make cert'
# client_side_ssl = true;

log_level = 3;

pid_file="/var/run/bip/bip.pid";

# This is where logs go. Channel and private messages will use that
# configuration value as a prefix, and then log_format to determine
# full log filename.
log_root = "/var/log/bip/";

# Log format allows you to make log filenames depend on the log line's
# attributes. Here's a list :
# %u -> user name
# %n -> network name
# %Y -> 4 digit year
# %m -> 2 digit month
# %d -> 2 digit day
# %c -> destination (#chan, privates, ...)
log_format = "%n/%Y-%m/%c.%d.log";


# Sets the frequency (in seconds) of log syncing (real write to kernel)
#log_sync_interval = 5;

# Makes bip send the log of each channel and privates while
# you were not connected to the proxy upon connection.
backlog = true;         # enable backlog
backlog_lines = 0;              # number of lines in backlog, 0 means no limit
backlog_always = false;         # backlog even lines already backlogged
backlog_msg_only = true;

# If blreset_on_talk talking on an irc network has the same effect of issuing
# /bip blreset, meaning that stuffed logged before the command won't be read
# back on backlog
#blreset_on_talk = false;
blreset_on_talk = true;
backlog_reset_on_talk = true;

network {
        name = "freenode";
        server { host = "irc.freenode.net"; port = 6667; };
};

# Configuration example with one user who connects to two irc networks
# To use the multi-server feature:
#  - define the connections
#  - chose and setup a different login for each connection
# on your irc client:
#  - Use the multi server feature of your client, the server beeing each time
#    the server where bip is running. In your client setup server password to:
#      username:password:connectionname
#  - do not store the password in clear here, use the bipmkpw util to generate
# a hash

# User structure is grouping information for a given user
user {
        # The name in bip of the user
        # This is used by bip only
        name = "USERID";
        # this user's password (md5(md5("tata"))) with seed - generated by bipmkpw
        password = "generate the hash with bipmkpw";

        # SSL certificates checking mode for user:
        # - "none" to accept anything;
        # - "basic" to accept if the certificate is contained in the store;
        # In "basic" mode, encountered untrusted certificates can be added to
        # the store interactively by connecting a client and "trusting" them.
        # - "ca" to do a complete certificate chain checking with the objects
        # in the store below (you have to put in it every cert, CRL, up to the
        # root CA). You have to build your store manually, so you may prefer
        # using "basic" unless you're a crypto zealot...
        ssl_check_mode = "none";

        # Location of the user's store for SSL certificate check
        # In "basic" mode, that must point to a single file with all trusted
        # certs concatenated together (the interactive "trust" appends to this
        # file).
        # In "ca" mode, it's a directory of a standard openssl store; you must
        # put PEM objects (certificates, CRLs...) with .pem extension and run
        # `c_rehash .' in it
        # ssl_check_store = "/home/bip`debian/.bip/trustedcerts.txt";

        # These will be the default for each connections
        default_nick = "USERID";
        default_user = "USERID";
        default_realname = "NAME SURNAME";

        # A user can have mutiple connections to irc networks.
        # define a connection:

        #connect to Mageia channels on FreeNode:
        connection {
                name = "freenode";              # used by bip only
                network = "freenode";   # which ircnet to connect to

                # Some options:
                #follow_nick = true;
                ignore_first_nick = true;
                no_client_away_msg = "currently disconnected";
                #Optional - if you have your ID password protected:
                #on_connect_send = "PRIVMSG NickServ :IDENTIFY TODO_YOUR_VALUE";

                # Autojoined channels:
                channel {
                        name = "#mageia,#mageia-dev,#mageia-qa";
                };
        };
};

Remember to generate the hash of your password for bip using bipmkpw, and then paste into the bip.conf

Now we copy the bip.conf to /etc and we keep the copy in the root home as backup.

# mv /etc/bip.conf /etc/bip.conf.old
# cp ~/.bip/bip.conf /etc/bip.conf

the configuration is ready to be used by bip to work. You can invoke it in the terminal.

# service -f bip
Arresto di bip:   [FALLITO]
Avvio di bip:     [OK]

The bip service is now running and we can see it:

# # ps -ef|grep bip
bip      13471     1  0 14:48 ?        00:00:00 /usr/bin/bip -f /etc/bip.conf
root     13737  3398  0 14:49 pts/2    00:00:00 grep --color bip

The log of our IRC channel we set to be active and logged could be found in /var/log

# ls /var/log/bip
bip.log  freenode/

The pre.log should be like:

# tail -f /var/log/bip/bip.log
10-09-2012 14:49:22 [freenode] Connecting user 'stblack' using server irc.freenode.net:6667
10-09-2012 14:49:23 [freenode] Connected for user stblack

and into the directory freenode one of the logs could be like :

# tail -f /var/log/bip/freenode/2012-09/#mageia.10.log
10-09-2012 14:49:29 -!- stblack-bip!~stblack-b@xxx.xxx.xxx.xxx has joined #mageia
10-09-2012 14:49:29 -!- Topic for #mageia: Mageia, the magic continues! | http://www.mageia.org | Current Mageia Stable Release: Version 2 | 
10-09-2012 14:49:29 -!- Topic set by pterjan!pterjan@nat/google/x-qtaqrlclbydwrmjb [Wednesday 22 August 2012, 17:02:49]

If you want to connect using your IRC client and the user you specify in the bip.conf file you can do it with the following parameters:

Network:my_local_network
Port:7778
IP:127.0.0.1

on connection got something like:

[12:15:18]     [b.i.p] You should type /QUOTE PASS your_username:your_password:your_connection_name

So typing /QUOTE PASS your_userid:yourpassword:freenode, you will be connected on the channel you choose to log with bip.

Now following the testing procedures install the packages in the testing repository and test them.

More info abount bip could be found at [1] and [2]

Return to the QA portal