]> git.donarmstrong.com Git - don.git/blob - posts/switching_to_kgb.mdwn
fix comment
[don.git] / posts / switching_to_kgb.mdwn
1 [[!meta title="Switching to KGB from CIA"]] 
2
3 [CIA.vc](http://cia.vc) has unfortunately
4 [disappeared](http://shadowm.rewound.net/blog/archives/245-CIA.vc-is-dead.html),
5 and is [unlikely to return](http://pastebin.com/9RBBniM1) any time
6 soon. I personally have decided to switch to
7 [KGB](http://kgb.alioth.debian.org/), but other alternatives such as
8 [FBI](http://fbi.github.com) and
9 [irker](http://www.catb.org/esr/irker/) exist.
10
11
12 To switch, you first need to find or set up a kgb bot. If this is a
13 Debian associated FOSS project, feel free to contact me or join
14 \#kgb-devel on irc.oftc.net and ask for someone to allow your project
15 to talk to their bot. Once you've found a bot, we need to set up the
16 client. [I'll talk about bot set up at the end.]
17
18 kgb-client configuration
19 ------------------------
20
21 Install the `kgb-client` and `kgb-client-git` packages. Currently, kgb
22 only supports subversion and git, but I suspect this will be rectified
23 shortly.
24
25 For git repositories, add a post-receive hook like the following:
26
27     #!/bin/sh
28     tee hooks/reflog | kgb-client --conf /path/to/kgbclient.conf --repository git --git-reflog -
29
30 For subversion repositories, add a post-commit hook like the following:
31
32     #!/bin/sh
33     kgb-client --conf /path/to/kgbclient.conf --repository svn "$1" "$2"
34         
35 Then update the configuration file `/path/to/kgbclient.conf`:
36
37     ---
38         repo-id: my-repository
39         servers:
40          - uri: http://servername:9999/
41            password: verysecret
42
43
44 Then, send the bot owner the password, repo-id, channel, and network
45 you'd like the changes to be reported to.
46
47 Configuring kgb-bot
48 -------------------
49
50 The bots just listen to soap requests and if the password matches,
51 sends the commit to the appropriate IRC channel. To set one up,
52 install `kgb-bot`.
53
54 Then, enable the bot (set `BOT_ENBALED=1` in `/etc/default/kgb-bot`),
55 and configure the bot's configuration file `/etc/kgb-bot/kgb.conf`:
56
57     ---
58     soap:
59       server_addr: 0.0.0.0
60       server_port: 9999
61       service_name: KGB
62     queue_limit: 150
63     log_file: "/var/log/kgb-bot.log"
64     repositories:
65       # just a name to identify it
66       my-repository:
67         # needs to be the same on the client
68         password: verysecret
69         networks:
70       oftc:
71         nick: KGB-you
72         ircname: KGB bot
73         username: kgb
74         password: ~
75         nickserv_password: yournickservpassword
76         server: irc.oftc.net
77         port: 6667
78       freenode:
79         nick: KGB-you
80         ircname: KGB bot
81         username: kgb
82         password: ~
83         nickserv_password: yournickservpassword
84         server: irc.freenode.net
85         port: 6667
86         channels:
87       - name: '#your-channel'
88         network: oftc
89         repos:
90          - your-repo
91           - name: '#commits'
92             network: freenode
93                 repos:
94                  - your-repo
95                 
96
97 Then start the bot (`/etc/init.d/kgb-bot start`), and watch as it
98 joins channels and reports your changes!
99
100 You'll probably actually want to register whatever nick you are using
101 on the networks, etc... but you can figure that out yourself!
102
103
104 [[!tag debian tech kgb]]