「Irssi」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(文字列「[[zh-TW:」を「[[zh-hant:」に置換)
(関連記事を追加)
 
(3人の利用者による、間の11版が非表示)
1行目: 1行目:
 
[[Category:Internet Relay Chat]]
 
[[Category:Internet Relay Chat]]
  +
[[Category:コンソールアプリケーション]]
[[bg:Irssi]]
 
 
[[de:Irssi]]
 
[[de:Irssi]]
 
[[en:Irssi]]
 
[[en:Irssi]]
 
[[es:Irssi]]
 
[[es:Irssi]]
 
[[fr:Irssi]]
 
[[fr:Irssi]]
[[sv:Irssi]]
 
[[tr:Irssi]]
 
 
[[zh-hans:Irssi]]
 
[[zh-hans:Irssi]]
[[zh-hant:Irssi]]
 
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|IRC チャンネル}}
 
{{Related|IRC チャンネル}}
 
{{Related|WeeChat}}
 
{{Related|WeeChat}}
 
{{Related|HexChat}}
 
{{Related|HexChat}}
  +
{{Related|Irssi-otr}}
 
{{Related articles end}}
 
{{Related articles end}}
 
[http://www.irssi.org/ irssi] はモジュール式の、ncurses ベースの IRC (Internet Relay Chat) クライアントです。プラグインにより [[Wikipedia:SILC_(protocol)|SILC]] と [http://www.icb.net/_jrudd/icb/protocol.html ICB] プロトコルもサポートしています。
 
[http://www.irssi.org/ irssi] はモジュール式の、ncurses ベースの IRC (Internet Relay Chat) クライアントです。プラグインにより [[Wikipedia:SILC_(protocol)|SILC]] と [http://www.icb.net/_jrudd/icb/protocol.html ICB] プロトコルもサポートしています。
136行目: 134行目:
 
$ openssl x509 -sha1 -fingerprint -noout -in ~/.irssi/irssi.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'
 
$ openssl x509 -sha1 -fingerprint -noout -in ~/.irssi/irssi.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'
   
  +
これにより、フィンガープリントが標準出力に書き込まれます。(sed コマンドは、不要なテキストや文字を削除してフィンガープリントを正しくフォーマットするために使用されます。)指紋の文字列をコピーします。後で irssi に登録します。
This will write the fingerprint to stdout. (The sed command is there to format the fingerprint correctly by removing unwanted text and characters.)
 
Copy the fingerprint string as you will register it in irssi shortly.
 
   
  +
irssi で、ネットワークから切断し、クライアント証明書とキーを追加します。証明書がパスワードなしで作成された場合は、-ssl_pass オプションを省略します。
In irssi, disconnect from the network and add the client certificate and keys. Omit the -ssl_pass option if your certificate was built without a password:
 
   
 
/disconnect Freenode
 
/disconnect Freenode
 
/server add -ssl_cert ~/.irssi/irssi.pem -ssl_pass <irssi.pem_password> -network freenode chat.freenode.net 6697
 
/server add -ssl_cert ~/.irssi/irssi.pem -ssl_pass <irssi.pem_password> -network freenode chat.freenode.net 6697
   
Now connect (not {{ic|/reconnect}}) and register your fingerprint
+
ここで接続し ({{ic|/reconnect}} ではなく) フィンガープリントを登録します。
   
 
/connect Freenode
 
/connect Freenode
150行目: 147行目:
 
/msg NickServ cert add YOUR_FINGERPRINT
 
/msg NickServ cert add YOUR_FINGERPRINT
   
  +
この時点で、設定ファイルからパスワードを削除し (設定ファイルにパスワードを保存した場合) 、次のコマンドで設定を保存できます。
At this point, you can remove your password from the configuration file (if you saved it in there) and save your config with:
 
   
 
/save
 
/save
160行目: 157行目:
   
 
=== join, part, quit を隠す ===
 
=== join, part, quit を隠す ===
  +
すべてのチャネルのユーザの参加、脱退、終了の表示を隠すには、 irssi に次のように入力します:
 
In order to ignore showing of joining, leaving and quiting of users for all channels type the following in irssi:
 
   
 
/ignore * joins
 
/ignore * joins
167行目: 163行目:
 
/ignore * quits
 
/ignore * quits
   
See [https://github.com/lifeforms/irssi-smartfilter smartfilter] to restrict join messages to active users.
+
参加メッセージをアクティブ・ユーザーに制限するには、 [https://github.com/lifeforms/irssi-smartfilter smartfilter] を参照してください。
  +
  +
=== マウススクロール ===
  +
  +
マウスを有効にするには、''irssi'' に次のように入力します。
  +
  +
/run scriptassist
  +
/script install mouse.pl
  +
  +
永続的に有効にするには:
  +
  +
/script autorun mouse.pl
  +
  +
上記が動作しない場合は、 {{ic|~/.irssi/scripts}} または {{ic|~/.irssi/scripts/autorun}} からスクリプトを手動で次のようにロードできます。
  +
  +
/script load mouse.pl
   
  +
== ヒントとテクニック ==
== Tips and tricks ==
 
   
 
=== HTTP プロキシ ===
 
=== HTTP プロキシ ===
182行目: 193行目:
 
/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
 
/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
   
  +
''irssi'' はそれに応じて設定ファイルを変更します。プロキシが必要ない場合は、 use_proxy を OFF に設定します。
''irssi'' should then alter its config file correspondingly; if the proxy is not required, just set use_proxy to OFF.
 
   
  +
プロキシがパスワードを要求する場合は、以下を試してください。
Should the proxy require a password, try:
 
   
 
/SET proxy_password your_pass
 
/SET proxy_password your_pass
   
  +
そうでない場合:
Otherwise:
 
   
 
/SET -clear proxy_password
 
/SET -clear proxy_password
   
  +
{{Note|プロキシを使ったSSL接続は失敗します。}}
{{Note|SSL behind a proxy will fail with these settings.}}
 
   
 
=== tmux で irssi と nicklist ===
 
=== tmux で irssi と nicklist ===
   
The ''irssi'' plugin '[http://scripts.irssi.org/scripts/nicklist.pl nicklist]' offers to add a pane listing the users on the channel currently viewed. It has two methods to do this:
+
''irssi'' プラグイン [http://scripts.irssi.org/scripts/nicklist.pl nicklist] は、現在表示されているチャンネルのユーザーを一覧表示するペインを追加します。これには2つの方法があります。
   
  +
* '''screen''' は単に ''irssi'' の右側にリストを追加するだけですが、 ''irssi'' が行を印刷するたびにウィンドウ全体が再描画されるという欠点があります。
* '''screen''', which simply adds the list to the right of ''irssi'', but brings the disadvantage that the entire window gets redrawn every time ''irssi'' prints a line.
 
   
* '''fifo''', which like the name suggests writes the list into a fifo that can then be continuously read with e. g. ''cat ~/.irssi/nicklistfifo''.
+
* '''fifo''' は名前が示すようにリストを fifo に書き込み、連続的に読むことができます。例えば ''cat~/.irssi/nicklistfifo'' です。
   
  +
nicklist はより効率的な ''FIFO'' を以下で使用します。
nicklist will use the more efficient ''fifo'' with:
 
   
 
/NICKLIST FIFO
 
/NICKLIST FIFO
   
  +
この fifo は [[tmux]] ウィンドウで使用することができます。左側のペインの ''irssi'' と ''cat'' は、その右側の小さいものの上から垂直に分割できます。 ペインは tmux セッションのジオメトリの作成に依存するため、異なる1つのセッションは再作成する必要があります(fifo を補充するための ''irssi'' ウィンドウのスイッチも意味します)。
This fifo can be used in a [[tmux]] window split vertically with ''irssi'' in its left pane and the ''cat'' from above in a small one in its right. Since the pane is dependent on its creating tmux session's geometry, a subsequent session with a different one needs to recreate it (which also implies a switch in ''irssi'' windows to refill the fifo).
 
   
  +
例えば、次のスクリプトは最初に実行中の irssi をチェックし、以前の自分自身の実行によって実行されたと推定されます。 見つけられない限り、新しい tmux セッション、 ''irssi'' の後に名前と実行されたウィンドウ、次に ''cat'' のペインを作成します。 ただし、 ''irssi'' が見つかった場合は、それは単にセッションに添付され、 ''cat'' のペインを再現します。
E. g., the following script first checks for a running ''irssi'', presumed to have been run by a previous execution of itself. Unless found it creates a new tmux session, a window named after and running ''irssi'' and then the pane with ''cat''. If however ''irssi'' was found it merely attaches to the session and recreates the ''cat'' pane.
 
   
 
#!/bin/bash
 
#!/bin/bash
237行目: 248行目:
 
exit 0
 
exit 0
   
{{Tip|Instead of doing all this work, [http://anti.teamidiot.de/static/nei/*/Code/Irssi/tmux-nicklist-portable.pl this plugin] does all the work needed for a nice nicklist inside tmux.}}
+
{{Tip|[http://anti.teamidiot.de/static/nei/*/Code/Irssi/tmux-nicklist-portable.pl このプラグイン] tmux 内の nicklist に必要なすべての作業を行います。}}
   
 
=== バーチャルホストネーム (vhost) ===
 
=== バーチャルホストネーム (vhost) ===
  +
バーチャルホストは、 IRC サーバに接続しているときにホスト名を変更するために使用できます。 IRC サーバは、一般的に whois に参加したり別れたりするときに表示されます。これは、静的 IP アドレスを持つサーバで最も一般的に行われます。 vhost がなければ、'whois' を実行したときに普通はこのようになります。
 
A vhost can be used to change your hostname when connected to an IRC-server, commonly viewed when joining/parting or doing a whois. This is most commonly done on a server which have a static IP address. Without a vhost it would commonly look like so when doing a 'whois':
 
   
 
nick@123.456.78.90.isp.com
 
nick@123.456.78.90.isp.com
   
  +
ドメイン example.com が使用可能な場合、成功した vhost の結果は次のようになります。
The result of a successfull vhost could be like so if you have the domain example.com available:
 
   
 
nick@example.com
 
nick@example.com
   
  +
すべての IRC サーバが vhost の使用をサポートしているわけではないことに注意してください。これは、ネットワークではなくサーバ間で個別に設定される場合があるため、サーバで問題が発生した場合は、同じネットワーク上の別のサーバを試してください。
Keep in mind that not every IRC-server supports the use of vhost. This might be individually set between the servers and not the network, so if you are experiencing issues with one server try another on the same network.
 
   
 
==== 必要な設定 ====
 
==== 必要な設定 ====
   
  +
irssi は、必要な構成が設定されている限り、バーチャルホストの使用をサポートします。これには、特にホストが[[wikipedia:List_of_DNS_record_types|ポインタレコード (PTR)]] を使用した [[wikipedia:Reverse_DNS_lookup|逆引きDNS検索 (rDNS)]] をサポートしていることが含まれます。さらに、 {{ic|/etc/hosts}} ファイルに適切な行を追加する必要があります。
irssi supports using a vhost as long as the required configurations has been set. This includes especially that your host supports [[wikipedia:Reverse_DNS_lookup|Recursive DNS Lookup (rDNS)]] using [[wikipedia:List_of_DNS_record_types|Pointer record (PTR)]]. Additionally you should add an appropriate line to your {{ic|/etc/hosts}} file.
 
   
  +
これが動作するかどうかを確認するには、 {{Pkg|bind}} に含まれている 'host' DNS lookup ユーティリティを使用して、次のようにテストします (ip は通常の IPv4 アドレス)
To see if this is working, test with the 'host' DNS lookup utility included in {{Pkg|bind-tools}} like so (where ''ip'' is a normal IPv4 address):
 
   
 
host ''ip''
 
host ''ip''
   
  +
この行で何かが返された場合、 rDNS が動作していることがわかります。
If this returns something in the lines of this then you know that your rDNS is working.
 
   
 
''ip''.in-addr.arpa domain name pointer example.com
 
''ip''.in-addr.arpa domain name pointer example.com

2023年11月7日 (火) 09:56時点における最新版

関連記事

irssi はモジュール式の、ncurses ベースの IRC (Internet Relay Chat) クライアントです。プラグインにより SILCICB プロトコルもサポートしています。

インストール

irssi パッケージをインストールしてください。

AUR の irssi-script や、irssi スクリプトリポジトリ にはスクリプトが多数用意されています。

使用方法

詳しい使い方は 公式ドキュメント を見て下さい。

ノート: このセクションでは IRC の基本的な知識を既に習得していて他のクライアントを使ったことがあるユーザーを対象にしています。

tmuxScreen などのターミナルマルチプレクサを使うことが推奨されています。簡単にセッションから切断したり再接続することができ、nicklist.pl などのスクリプトはセカンダリウィンドウを使用します。irssi を起動するには、次を実行:

$ irssi

コマンド

コマンド 説明
/server, /s 現在のネットワークサーバーを変更。
/connect, /c 新しくサーバーに接続する。複数のサーバーに同時に接続するときに使います (Ctrl+Shift+x でサーバーを切り替えられます)。
/disconnect, /dc サーバーとの接続を終了する。
ALT+(1-0,q-p,etc) 現在のアクティブウィンドウを変更。Ctrl+n で次のウィンドウに、Ctrl+p で前のウィンドウに変わります。
/window 1 最初のウィンドウに移動。キーボードの上段がウィンドウに対応しています: (1-0), (q-p)。
/window close, /wc カレントウィンドウを閉じる。
/window move 1 カレントウィンドウを最初のウィンドウの位置に移動。
/layout save カレントウィンドウの位置を後で使うために保存。
/set 現在の設定リストを表示。
/help パラメータの説明を表示。
/alias ショートカットを作成。

設定

個人設定ファイルは ~/.irssi/config に配置します。/etc/irssi.conf にテンプレートがあります。--config フラグを使うことで他の設定ファイルを使って irssi を起動できます。

  • /save を使うことで現在の設定を設定ファイルに保存できます。
  • /layout save と入力することで開いているウィンドウの位置を保存できます。

SASL で認証

ヒント: Irssi バージョン 0.8.18 には SASL のサポートが組み込まれています。

以下のようにネットワークを追加してください:

/SERVER ADD -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode -port 6697 irc.freenode.net
/NETWORK ADD -sasl_mechanism plain -sasl_username <username> -sasl_password <password> freenode
ノート:
  • ネットワーク名の大文字・小文字が正しいことを確認してください。
  • 最初のコマンドでは SSL 接続でサーバーを追加します。
  • 既存のネットワークが存在する場合、2番目のコマンドだけを実行してください。
  • あなたのパスワードに $ が含まれている場合、$ を前に付けることで irssi が正しく解析できるようになります。

irssi を再起動してネットワークに接続すると "SASL authentication succeeded" と表示されます。

起動時に #archlinux に自動で接続

irssi を起動して以下を入力してください:

/server add -auto -network freenode chat.freenode.net

freenode は自由な名前に置き換えることができます (例: fn)。

SASL を正しく設定してください。SASL の代わりに -autosendcmd を使って手動で NickServ を使うこともできますが、チャンネルに自動で参加するときに競合状態になってしまいます。出来るだけ、NickServ でパスワードを使うよりも、SSL 証明書で認証してください。

/channel add -auto #archlinux freenode
/channel add -auto #archlinux-offtopic freenode

SSL 接続

Freenode は SSL 接続にポート 6697, 7000, 7070 を使っています (6667 は使っていません)。Freenode IRC ネットワークに SSL を通して接続したい場合、新しい接続をセットアップする必要があります。irssi を起動して次を実行:

/server add -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode -port 6697 chat.freenode.net

そして新しい設定を保存:

/save

問題なければ "Z" モードがセットされるのが確認できます。次のように表示されます: "Mode change (+Zi) for user your-nick"。

クライアント証明書

Freenode と OFTC は平文のパスワード認証の代わりに、SSL 証明書による認証をサポートしています。詳しくは Freenode の Identifying with CERTFPCreating an SSL Certificate を見てください。

730日間有効な証明書を作成するには (国名や Common Name (CN) などの入力を求められた場合、自由に入力してください):

$ openssl req -newkey rsa:2048 -days 730 -x509 -keyout irssi.key -out irssi.crt -nodes 
$ cat irssi.crt irssi.key > ~/.irssi/irssi.pem
$ chmod 600 ~/.irssi/irssi.pem
$ rm irssi.crt irssi.key

次に、フィンガープリントを確認してください:

$ openssl x509 -sha1 -fingerprint -noout -in ~/.irssi/irssi.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'

これにより、フィンガープリントが標準出力に書き込まれます。(sed コマンドは、不要なテキストや文字を削除してフィンガープリントを正しくフォーマットするために使用されます。)指紋の文字列をコピーします。後で irssi に登録します。

irssi で、ネットワークから切断し、クライアント証明書とキーを追加します。証明書がパスワードなしで作成された場合は、-ssl_pass オプションを省略します。

/disconnect Freenode
/server add -ssl_cert ~/.irssi/irssi.pem  -ssl_pass <irssi.pem_password> -network freenode chat.freenode.net 6697

ここで接続し (/reconnect ではなく) フィンガープリントを登録します。

/connect Freenode
/msg NickServ identify YOUR_PASSWORD
/msg NickServ cert add YOUR_FINGERPRINT

この時点で、設定ファイルからパスワードを削除し (設定ファイルにパスワードを保存した場合) 、次のコマンドで設定を保存できます。

/save

自動ログイン

/SET autolog ON
/save

join, part, quit を隠す

すべてのチャネルのユーザの参加、脱退、終了の表示を隠すには、 irssi に次のように入力します:

/ignore * joins
/ignore * parts
/ignore * quits

参加メッセージをアクティブ・ユーザーに制限するには、 smartfilter を参照してください。

マウススクロール

マウスを有効にするには、irssi に次のように入力します。

 /run scriptassist
 /script install mouse.pl

永続的に有効にするには:

 /script autorun mouse.pl

上記が動作しない場合は、 ~/.irssi/scripts または ~/.irssi/scripts/autorun からスクリプトを手動で次のようにロードできます。

 /script load mouse.pl

ヒントとテクニック

HTTP プロキシ

irssi で HTTP プロキシを使うには、以下のコマンドが必要です:

/SET use_proxy ON
/SET proxy_address <Proxy host address>
/SET proxy_port <Proxy port>
/SET -clear proxy_string
/SET proxy_string_after conn %s %d
/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n

irssi はそれに応じて設定ファイルを変更します。プロキシが必要ない場合は、 use_proxy を OFF に設定します。

プロキシがパスワードを要求する場合は、以下を試してください。

/SET proxy_password your_pass

そうでない場合:

/SET -clear proxy_password
ノート: プロキシを使ったSSL接続は失敗します。

tmux で irssi と nicklist

irssi プラグイン nicklist は、現在表示されているチャンネルのユーザーを一覧表示するペインを追加します。これには2つの方法があります。

  • screen は単に irssi の右側にリストを追加するだけですが、 irssi が行を印刷するたびにウィンドウ全体が再描画されるという欠点があります。
  • fifo は名前が示すようにリストを fifo に書き込み、連続的に読むことができます。例えば cat~/.irssi/nicklistfifo です。

nicklist はより効率的な FIFO を以下で使用します。

/NICKLIST FIFO

この fifo は tmux ウィンドウで使用することができます。左側のペインの irssicat は、その右側の小さいものの上から垂直に分割できます。 ペインは tmux セッションのジオメトリの作成に依存するため、異なる1つのセッションは再作成する必要があります(fifo を補充するための irssi ウィンドウのスイッチも意味します)。

例えば、次のスクリプトは最初に実行中の irssi をチェックし、以前の自分自身の実行によって実行されたと推定されます。 見つけられない限り、新しい tmux セッション、 irssi の後に名前と実行されたウィンドウ、次に cat のペインを作成します。 ただし、 irssi が見つかった場合は、それは単にセッションに添付され、 cat のペインを再現します。

#!/bin/bash

T3=$(pgrep -u $USER -x irssi)

irssi_nickpane() {
    tmux setw main-pane-width $(( $(tput cols) - 21));
    tmux splitw -v "cat ~/.irssi/nicklistfifo";
    tmux selectl main-vertical;
    tmux selectw -t irssi;
    tmux selectp -t 0;
}

irssi_repair() {
    tmux selectw -t irssi
    (( $(tmux lsp | wc -l) > 1 )) && tmux killp -a -t 0
    irssi_nickpane
}

if [ -z "$T3" ]; then
    tmux new-session -d -s main;
    tmux new-window -t main -n irssi irssi;
    irssi_nickpane ;
fi
    tmux attach-session -d -t main;
    irssi_repair ;
exit 0
ヒント: このプラグイン は tmux 内の nicklist に必要なすべての作業を行います。

バーチャルホストネーム (vhost)

バーチャルホストは、 IRC サーバに接続しているときにホスト名を変更するために使用できます。 IRC サーバは、一般的に whois に参加したり別れたりするときに表示されます。これは、静的 IP アドレスを持つサーバで最も一般的に行われます。 vhost がなければ、'whois' を実行したときに普通はこのようになります。

nick@123.456.78.90.isp.com

ドメイン example.com が使用可能な場合、成功した vhost の結果は次のようになります。

nick@example.com

すべての IRC サーバが vhost の使用をサポートしているわけではないことに注意してください。これは、ネットワークではなくサーバ間で個別に設定される場合があるため、サーバで問題が発生した場合は、同じネットワーク上の別のサーバを試してください。

必要な設定

irssi は、必要な構成が設定されている限り、バーチャルホストの使用をサポートします。これには、特にホストがポインタレコード (PTR) を使用した 逆引きDNS検索 (rDNS) をサポートしていることが含まれます。さらに、 /etc/hosts ファイルに適切な行を追加する必要があります。

これが動作するかどうかを確認するには、 bind に含まれている 'host' DNS lookup ユーティリティを使用して、次のようにテストします (ip は通常の IPv4 アドレス)

host ip

この行で何かが返された場合、 rDNS が動作していることがわかります。

ip.in-addr.arpa domain name pointer example.com

vhost の有効化

ホストネームを指定してサーバーに接続する方法は複数存在します。-host 引数を使用して 'server' コマンドを実行する方法:

/server -host example.com irc.freenode.org

'set' コマンドを使用してホストネーム (vhost) を設定する方法 (ホストネームは ~/.irssi/config に保存されます):

/set hostname example.com
/save
/server irc.freenode.org

参照