$shibayu36->blog;

クラスター株式会社のソフトウェアエンジニアです。エンジニアリングや読書などについて書いています。

znc 1.0をインストールした

 そろそろちゃんとIRC Proxyのセットアップとかしようと思っていたら、zncが1.0になって、SSL周りの設定がさらに簡単になっていたのでやってみた。tiarra+stoneを卒業してZNCを使い始めた - すぎゃーんメモ時点では、複数のネットワークに接続するには複数ユーザ作らないといけなかったんだけど、1.0の時点では単一ユーザで複数ネットワークに接続出来るようにもなっていた。

インストール

aptitudeのstableとかに1.0がまだ来てなかったので、sourceからインストールする。http://wiki.znc.in/Installation を参考に。

$ wget http://znc.in/releases/znc-1.0.tar.gz
$ tar -xzvf znc-1.0.tar.gz
$ cd znc-1.0
$ ./configure --prefix=$HOME/znc
$ make
$ make install

なんとなくglobalに入れたくなかったので自分のhomeに入れるため--prefixをつけた

設定作成

まず設定を作成する。~/znc/bin/znc --makeconfして適当に質問に答えていく。オレオレ証明書とかも勝手に発行してくれたりする。

$ ~/znc/bin/znc --makeconf
[ ok ] Checking for list of available modules...
[ ** ] Building new config
[ ** ]
[ ** ] First let's start with some global settings...
[ ** ]
[ ?? ] What port would you like ZNC to listen on? (1025 to 65535): 6668
[ ?? ] Would you like ZNC to listen using SSL? (yes/no) [no]: yes
[ ?? ] Would you like ZNC to listen using ipv6? (yes/no) [yes]: no
[ ?? ] Listen Host (Blank for all ips):
[ ok ] Verifying the listener...
[ ** ]
[ ** ] -- Global Modules --
[ ** ]
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] | Name      | Description                                              |
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] | partyline | Internal channels and queries for users connected to znc |
[ ** ] | webadmin  | Web based administration module                          |
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] And 9 other (uncommon) modules. You can enable those later.
[ ** ]
[ ?? ] Load global module <partyline>? (yes/no) [no]:
[ ?? ] Load global module <webadmin>? (yes/no) [no]: yes
[ ** ]
[ ** ] Now we need to set up a user...
[ ** ]
[ ?? ] Username (AlphaNumeric): shibayu36
[ ?? ] Enter Password:
[ ?? ] Confirm Password:
[ ?? ] Would you like this user to be an admin? (yes/no) [yes]: yes
[ ?? ] Nick [shibayu36]:
[ ?? ] Alt Nick [shibayu36_]:
[ ?? ] Ident [shibayu36]:
[ ?? ] Real Name [Got ZNC?]:
[ ?? ] Bind Host (optional): 0.0.0.0
[ ?? ] Number of lines to buffer per channel [50]: 100
[ ?? ] Would you like to clear channel buffers after replay? (yes/no) [yes]:
[ ?? ] Default channel modes [+stn]:
[ ** ]
[ ** ] -- User Modules --
[ ** ]
[ ** ] +--------------+------------------------------------------------------------------------------------------+
[ ** ] | Name         | Description                                                                              |
[ ** ] +--------------+------------------------------------------------------------------------------------------+
[ ** ] | chansaver    | Keep config up-to-date when user joins/parts                                             |
[ ** ] | controlpanel | Dynamic configuration through IRC. Allows editing only yourself if you're not ZNC admin. |
[ ** ] | perform      | Keeps a list of commands to be executed when ZNC connects to IRC.                        |
[ ** ] +--------------+------------------------------------------------------------------------------------------+
[ ** ] And 22 other (uncommon) modules. You can enable those later.
[ ** ]
[ ?? ] Load module <chansaver>? (yes/no) [no]:
[ ?? ] Load module <controlpanel>? (yes/no) [no]:
[ ?? ] Load module <perform>? (yes/no) [no]:
[ ** ]
[ ?? ] Would you like to set up a network? (yes/no) [no]:
[ ** ]
[ ?? ] Would you like to set up another user? (yes/no) [no]:
[ ok ] Writing config [/home/shibayu36/.znc/configs/znc.conf]...
[ ** ]
[ ** ] To connect to this ZNC you need to connect to it as your IRC server
[ ** ] using the port that you supplied.  You have to supply your login info
[ ** ] as the IRC server password like this: user/network:pass.
[ ** ]
[ ** ] Try something like this in your IRC client...
[ ** ] /server <znc_server_ip> +6668 shibayu36:<pass>
[ ** ] And this in your browser...
[ ** ] https://<znc_server_ip>:6668/
[ ** ]
[ ?? ] Launch ZNC now? (yes/no) [yes]: no

ここでハマりどころがあって、Bind Hostに0.0.0.0を設定しておかないとうまく接続できなくなってしまうらしい。難しい。

これで~/.znc/辺りに設定が作られる。

複数ネットワークの設定

 webadminのpluginを有効にしておけばネットワークの設定はweb上で行える。https://irchost:6668/ とかにアクセスしてあげると、管理画面に行ける。

 それでユーザの設定に行くとNetworksというのがあるので、Add。適宜ネットワークの設定をする。
f:id:shiba_yu36:20130901141533p:plain

 Networkの設定をすると、IRCクライアントのサーバパスワードのところに、/:と入力すると、そのネットワークに接続することが出来るようになる。たとえばshibayu36/freenode:hogehoge みたいに設定する。

 あとは適宜ネットワークを追加していって、IRCクライアントの設定をしておくと良い。