How to IRC: Difference between revisions

From CSCWiki
Jump to navigation Jump to search
(add instructions for The Lounge)
(Add section describing setup with emacs x erc.)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= Chatting with us =
Chat with us!


== The Lounge ==
== The Lounge ==
We have a web UI for IRC at [https://chat.csclub.uwaterloo.ca The Lounge].
We have a web UI for IRC at [https://chat.csclub.uwaterloo.ca The Lounge].
[[File:The_lounge_screenshot.png|alt=The Lounge screenshot of #csc channel|400px|top|left|thumbnail|A screen capture of the #csc channel, as seen from The Lounge web client]]
[[File:The_lounge_screenshot.png|alt=The Lounge screenshot of #csc channel|400px|thumbnail|A screen capture of the #csc channel, as seen from The Lounge web client]]
If you are a first-time IRC user, this is by far the easiest way to join.
If you are a first-time IRC user, this is by far the easiest way to join.
The steps are (roughly):
The steps are (roughly):
<ol>
<ol>
<li> Login using your CSC credentials. </li>
<li> Login using your CSC credentials. </li>
<li> Follow the prompts to join the Freenode server (make sure TLS is enabled). </li>
<li> Follow the prompts to join the Libera server (make sure TLS is enabled). </li>
<li> Type <code>/join #csc</code> </li>
<li> Type <code>/join #csc</code> </li>
<li> Say hi! </li>
<li> Say hi! </li>
</ol>
</ol>


If you are a syscom member, you will need to join the #csc-syscom channel, which requires nick (nickname) registration. To do this, run the following commands in The Lounge (or any IRC client):
If you are a termcom member, you will need to join the #csc-termcom channel, which requires nick (nickname) registration. To do this, run the following commands in The Lounge (or any IRC client):
<pre>
<pre>
/nick my_nickname
/nick my_nickname
/msg NickServ REGISTER my_password my_email@example.com
/msg NickServ REGISTER my_password my_email@example.com
</pre>
</pre>
Fill in your nickname, password and email as appropriate. You will receive an email from Freenode asking you to verify your email address.
Fill in your nickname, password and email as appropriate. You will receive an email from Libera asking you to verify your email address.
Once you have done so, go back to The Lounge, go the Freenode window, click on the three-dots button in the top right corner, and click "Edit this network". There, you can specify the nick and password which you just created.
Once you have done so, go back to The Lounge, go the Libera window, click on the three-dots button in the top right corner, and click "Edit this network". There, you can specify the nick and password which you just created.


== Mattermost ==
== Mattermost ==
[[File:Mattermost-csc-sample.png|alt=Mattermost #csc screen capture, including a conversation between members of the channel|372x372px|right|thumbnail|A screen capture of the #csc channel, as seen from Mattermost desktop]]
We self-host [https://mattermost.csclub.uwaterloo.ca/ Mattermost] now, it's easier to use if you're not familiar with IRC. If you know how to use IRC, we're #csc on Freenode and there should be a #csc bridge that relays messages between #csc and our Mattermost instance.


[[File:Mattermost-phone-sample.jpg|alt=Mattermost android screenshot of #csc channel|362x362px|thumbnail|A screen capture of the #csc channel, as seen from Mattermost Android client]]
Both #csc on Freenode ([http://webchat.freenode.net/?channels=%23csc&uio=d4 Freenode Webchat] or via IRC clients e.g. irssi, weechat) and ~freenode-csc on Mattermost are official channels to interact with CSC members!
We self-host [https://mattermost.csclub.uwaterloo.ca/ Mattermost] now, it's easier to use if you're not familiar with IRC. If you know how to use IRC, we're #csc on libera.chat and there should be a #csc bridge that relays messages between #csc and our Mattermost instance.


Both #csc on libera.chat ([https://web.libera.chat/#csc Libera Webchat] or via IRC clients e.g. irssi, weechat) and ~csc on Mattermost are official channels to interact with CSC members!
= Mattermost Setup =


=== Mattermost Setup ===
[[File:Mattermost-phone-sample.jpg|alt=Mattermost android screenshot of #csc channel|200px|top|left|thumbnail|A screen capture of the #csc channel, as seen from Mattermost Android client]]
[[File:Mattermost-csc-sample.png|alt=Mattermost #csc screen capture, including a conversation between members of the channel|200px|top|right|thumbnail|A screen capture of the #csc channel, as seen from Mattermost desktop]]


Make an account at [https://mattermost.csclub.uwaterloo.ca/signup_email our self-hosted Mattermost]. For username, you can put your questid (i.e. your CSC username), although you can always set your full name as it will appear in Mattermost.
Make an account at [https://mattermost.csclub.uwaterloo.ca/signup_email our self-hosted Mattermost]. For username, you can put your questid (i.e. your CSC username), although you can always set your full name as it will appear in Mattermost.
Line 38: Line 36:
For iOS users, Mattermost's mobile app is also a superior option if you wish to receive push notifications as it supports Apple's native push via iCloud/APN.
For iOS users, Mattermost's mobile app is also a superior option if you wish to receive push notifications as it supports Apple's native push via iCloud/APN.


= IRC Setup =
== Weechat ==


[[File:Glowing-bear-screencap.png|alt=glowing-bear screen capture of #csc IRC channel|right|thumbnail|450px|A screen capture of the #csc IRC channel, as seen from glowing-bear client]]
[[File:Glowing-bear-screencap.png|alt=glowing-bear screen capture of #csc IRC channel|right|thumbnail|450px|A screen capture of the #csc IRC channel, as seen from glowing-bear client]]
Line 44: Line 42:
[[File:Weechat-Android-screenshot.png|alt=Weechat Android screen capture of #csc IRC channel|right|thumbnail|A screen capture of the #csc IRC channel, as seen from Weechat Android client]]
[[File:Weechat-Android-screenshot.png|alt=Weechat Android screen capture of #csc IRC channel|right|thumbnail|A screen capture of the #csc IRC channel, as seen from Weechat Android client]]


This method will establish a persistent IRC sessions that you can connect to with different clients. A weechat server program running on a CSClub server will remain connected to IRC networks at all times, and simply connecting to your weechat server program will give you all the chat history upon connection.
This method will establish a persistent IRC session that you can connect to with different clients. A [https://weechat.org/ weechat] server program running on a CSClub server will remain connected to IRC networks at all times, and simply connecting to your <code>weechat</code> server program will give you all the chat history upon connection.


To set up your weechat server program:
To set up your <code>weechat</code> server program:
<ol>
<ol>
<li>Log in to a CS Club general-use server, such as taurine.csclub.uwaterloo.ca, and run `weechat` in such a way that it will keep running after you log out</li>
<li>Log in to a CS Club general-use server, such as <code>neotame.csclub.uwaterloo.ca</code>, and run <code>weechat</code> in such a way that it will keep running after you log out.</li>


Replace ctdalek with your username
Replace ctdalek with your username:


<pre>
$ ssh ctdalek@taurine.csclub.uwaterloo.ca
$ ssh ctdalek@neotame.csclub.uwaterloo.ca
$ screen -U weechat
$ screen -U weechat
</pre>


A "WeeChat" window should have opened up. Type the following commands into this window, replacing [yourpassword] with a password of your choice and [yourport] with a number in the range of [28100-28400]:
A "WeeChat" window should have opened up. Type the following commands into this window, replacing [yourpassword] with a password of your choice and [yourport] with a number in the range of [28100-28400]:


<pre>
> /set relay.network.password [yourpassword]
> /relay add weechat [yourport]
/set relay.network.password [yourpassword]
/relay add weechat [yourport]
> /save
/save
</pre>


Once you have entered in all these commands, you don't need your terminal anymore. You can close your ssh window!
Once you have entered in all these commands, you don't need your terminal anymore. You can close your ssh window!
Line 65: Line 67:
<li>Your personal WeeChat server is set up. Now connect to it using a pretty client:</li>
<li>Your personal WeeChat server is set up. Now connect to it using a pretty client:</li>


[http://www.glowing-bear.org/ glowing-bear] is a free and open source web-based weechat client. It works well as a desktop client, and on iOS. To connect using glowing-bear, fill in "Connection Settings" with `taurine.csclub.uwaterloo.ca`, `[yourport]`, and `[yourpassword]`. Make sure to use the http version of the website with this guide! HTTPS only works if you set up encryption. That's not covered here.
[http://www.glowing-bear.org/ glowing-bear] is a free and open source web-based weechat client. It works well as a desktop client, and on iOS. To connect using glowing-bear, fill in "Connection Settings" with <code>neotame.csclub.uwaterloo.ca</code>, <code>[yourport]</code>, and <code>[yourpassword]</code>. Make sure to use the <code>http</code> version of the website with this guide! <code>https</code> only works if you set up encryption. That's not covered here.


'''Recommended''': [https://play.google.com/store/apps/details?id=com.ubergeek42.WeechatAndroid Weechat Android] is a free and open source android weechat client. It gives notifications when your receive a direct message or your name is mentioned in one of the channels you are in. To connect using Weechat Android, fill in Settings > Connection with `taurine.csclub.uwaterloo.ca`, `[yourport]`, and `[yourpassword]`.
'''Recommended''': [https://play.google.com/store/apps/details?id=com.ubergeek42.WeechatAndroid Weechat Android] is a free and open source android <code>weechat</code> client. It gives notifications when your receive a direct message or your name is mentioned in one of the channels you are in. To connect using Weechat Android, fill in Settings > Connection with <code>neotame.csclub.uwaterloo.ca</code>, <code>[yourport]</code>, and <code>[yourpassword]</code>.


<li>Join the #csc IRC channel</li>
<li>Join the #csc IRC channel</li>


In your weechat client (e.g. glowing-bear or Weechat Android), switch to the 'Freenode' tab and type:
In your weechat client (e.g. glowing-bear or Weechat Android), switch to the 'Libera' tab and type:


<pre>
> /server add freenode chat.freenode.net/7000 -ssl -autoconnect
/server add libera irc.libera.chat/6697 -ssl -autoconnect
> /set irc.server.freenode.autojoin "#csc"
/set irc.server.libera.autojoin "#csc"
> /save
/save
> /connect freenode
/connect libera
</pre>


You're now connected to the main IRC network! Connected by an SSL connection, so you're super sneaky as well. Way to go.
You're now connected to the main IRC network! Connected by an SSL connection, so you're super sneaky as well. Way to go.
Line 82: Line 86:
Now, to join the CSC channel!
Now, to join the CSC channel!


In your client, you'll now have two buffers that you can switch to. One is called "weechat" and the other is "freenode".
In your client, you'll now have two buffers that you can switch to. One is called "weechat" and the other is "libera".


Switch to the "freenode" buffer and type:
Switch to the "libera" buffer and type:


> /join #csc
/join #csc


Congratulations you win!
Congratulations you win!
Line 94: Line 98:
Welcome to the channel! Go ahead and say something, like
Welcome to the channel! Go ahead and say something, like


<pre>
> Good morning ctdalek http://www.total-knowledge.com/~ilya/mips/ugt.html
Good morning ctdalek http://www.total-knowledge.com/~ilya/mips/ugt.html
</pre>


If you want to privately message someone, use
If you want to privately message someone, use

> /q [nick] [optional message]
<pre>
which will open a new tab with that person. For example `/q pj2melan ping pong`.
/q [nick] [optional message]
</pre>

which will open a new tab with that person. For example <code>/q pj2melan ping pong</code>.


If you want to join another channel, use
If you want to join another channel, use
> /join [channel]
<pre> /join [channel]
</pre>
For example `/join #csc`.

For example <code>/join #csc</code>.
</ol>
</ol>
''Note about CSClub server restarts:'' If taurine or any server you're using to run the weechat program on is restarted for any reason (we'll email you if it does), Make sure to run `screen -U weechat` again to start your server. You won't have to reconfigure weechat (step 2) though.
''Note about CSClub server restarts:'' If <code>neotame</code> or any server you're using to run the <code>weechat</code> program on is restarted for any reason (we'll email you if it does), Make sure to run <code>screen -U weechat</code> again to start your server. You won't have to reconfigure <code>weechat</code> (step 2) though.


== Securing Glowing Bear - SSL/TLS Setup ==
=== Securing Glowing Bear - SSL/TLS Setup ===


With the default setup, when you log in to your weechat relay using a client such as glowing-bear or Weechat Android ''your password is sent in the clear''. If you believe this to be a bad thing, follow these steps to enable SSL encryption between you and your weechat relay running on taurine.
With the default setup, when you log in to your <code>weechat</code> relay using a client such as glowing-bear or Weechat Android, ''your password is sent in the clear''. If you believe this to be a bad thing, follow these steps to enable SSL encryption between you and your <code>weechat</code> relay running on <code>neotame</code>.


<ol>
<ol>
<li>Log in to caffeine.csclub.uwaterloo.ca to generate an SSL certificate:
<li>Log in to <code>neotame.csclub.uwaterloo.ca</code> to generate an SSL certificate:


<pre>
<pre>
$ ssh caffeine.csclub.uwaterloo.ca
$ ssh neotame.csclub.uwaterloo.ca
$ mkdir ~/.weechat/ssl
$ mkdir ~/.weechat/ssl
$ cd ~/.weechat/ssl
$ cd ~/.weechat/ssl
Line 122: Line 134:
</li>
</li>


<li>Tell weechat to use the new certificate you generated, and add a new relay with a different password (since your old password was likely compromised):
<li>Tell <code>weechat</code> to use the new certificate you generated, and add a new relay with a different password (since your old password was likely compromised):


<p>In your weechat client (glowing-bear, or Weechat Android), run</p>
<p>In your <code>weechat</code> client (glowing-bear, or Weechat Android), run</p>


<pre>
<pre>
> /set relay.network.password [newpassword]
/set relay.network.password [newpassword]
> /relay sslcertkey
/relay sslcertkey
> /relay del weechat
/relay del weechat
> /relay add ssl.weechat [yourport]
/relay add ssl.weechat [yourport]
</pre>
</pre>
</li>
</li>
Line 149: Line 161:
== Quick SSH-based Setup ==
== Quick SSH-based Setup ==


1. Open up an IRC client, i.e. irssi. Launch irssi in a screen session, which you
1. Open up an IRC client, i.e. <code>irssi</code>. Launch <code>irssi</code> in a screen session, which you
can return to later.
can return to later.


$ ssh taurine.csclub.uwaterloo.ca
$ ssh neotame.csclub.uwaterloo.ca
$ screen -U irssi
$ screen -U irssi


2. In irssi, connect to the freenode network and join our channel.
2. In irssi, connect to the libera network and join our channel.


/server add -auto -net freenode -ssl -ssl_verify chat.freenode.net 6697
/server add -auto -net libera -ssl -ssl_verify irc.libera.chat 6697
/save
/save
/connect freenode
/connect libera
/join #csc
/join #csc


Line 167: Line 179:
/save
/save


You can register your nickname on the freenode network by messaging NickServ.
You can register your nickname on the libera network by messaging NickServ.


/msg NickServ REGISTER password email
/msg NickServ REGISTER password email
Line 177: Line 189:
5. Return to your screen session. You will have remained connected to the channel.
5. Return to your screen session. You will have remained connected to the channel.


$ ssh taurine.csclub.uwaterloo.ca -t "screen -Urd"
$ ssh neotame.csclub.uwaterloo.ca -t "screen -Urd"

== Emacs ==
If you are comfortable with Emacs, then you can also configure the editor to act as an IRC client via <code>erc</code>. For a quick introduction, you can run <code>M-x erc-tls</code>where you will be prompted for a server, a port (the defaults are correct), and a nickname. For a detailed overview of possible configuration options see the [https://www.emacswiki.org/emacs/ERC ERC Emacs Wiki]. To prettify the default display and for simiilar QOL changes, consider applying some of the configuration options from [https://systemcrafters.cc/live-streams/june-04-2021/ this guide] by System Crafters.

=== ZNC.el ===
To keep track of chat logs while your machine is powered down, consider setting up [[ZNC]] with the help of [https://www.emacswiki.org/emacs/ErcZNC ZNC.el].

= syscom =

To kick (and optionally ban) a user:

/cs op #<channel>
/mode #<channel> +b <nick_to_ban>
/kick <nick_to_kick>
/mode -o <your_nick>

If the user need not be banned you can skip the second line. If other accounts from the same user/host should be banned, replace <code>nick_to_ban/kick</code> with <code>nick!username@host</code>.

Latest revision as of 00:54, 30 July 2022

Chat with us!

The Lounge

We have a web UI for IRC at The Lounge.

The Lounge screenshot of #csc channel
A screen capture of the #csc channel, as seen from The Lounge web client

If you are a first-time IRC user, this is by far the easiest way to join. The steps are (roughly):

  1. Login using your CSC credentials.
  2. Follow the prompts to join the Libera server (make sure TLS is enabled).
  3. Type /join #csc
  4. Say hi!

If you are a termcom member, you will need to join the #csc-termcom channel, which requires nick (nickname) registration. To do this, run the following commands in The Lounge (or any IRC client):

/nick my_nickname
/msg NickServ REGISTER my_password my_email@example.com

Fill in your nickname, password and email as appropriate. You will receive an email from Libera asking you to verify your email address. Once you have done so, go back to The Lounge, go the Libera window, click on the three-dots button in the top right corner, and click "Edit this network". There, you can specify the nick and password which you just created.

Mattermost

Mattermost #csc screen capture, including a conversation between members of the channel
A screen capture of the #csc channel, as seen from Mattermost desktop
Mattermost android screenshot of #csc channel
A screen capture of the #csc channel, as seen from Mattermost Android client

We self-host Mattermost now, it's easier to use if you're not familiar with IRC. If you know how to use IRC, we're #csc on libera.chat and there should be a #csc bridge that relays messages between #csc and our Mattermost instance.

Both #csc on libera.chat (Libera Webchat or via IRC clients e.g. irssi, weechat) and ~csc on Mattermost are official channels to interact with CSC members!

Mattermost Setup

Make an account at our self-hosted Mattermost. For username, you can put your questid (i.e. your CSC username), although you can always set your full name as it will appear in Mattermost.

The benefit of Mattermost over Slack and family is that Slack stores all your information on Slack's servers, wherever they are in the US. They do this so they can sell your data back to you (e.g. not allowing you to see old messages), but Slack is also closed-source even though it was derived from IRC. Mattermost is open-source and hosted on CSC servers.

For iOS users, Mattermost's mobile app is also a superior option if you wish to receive push notifications as it supports Apple's native push via iCloud/APN.

Weechat

glowing-bear screen capture of #csc IRC channel
A screen capture of the #csc IRC channel, as seen from glowing-bear client
Weechat Android screen capture of #csc IRC channel
A screen capture of the #csc IRC channel, as seen from Weechat Android client

This method will establish a persistent IRC session that you can connect to with different clients. A weechat server program running on a CSClub server will remain connected to IRC networks at all times, and simply connecting to your weechat server program will give you all the chat history upon connection.

To set up your weechat server program:

  1. Log in to a CS Club general-use server, such as neotame.csclub.uwaterloo.ca, and run weechat in such a way that it will keep running after you log out.
  2. Replace ctdalek with your username:
    $ ssh ctdalek@neotame.csclub.uwaterloo.ca
    $ screen -U weechat
    

    A "WeeChat" window should have opened up. Type the following commands into this window, replacing [yourpassword] with a password of your choice and [yourport] with a number in the range of [28100-28400]:

      /set relay.network.password [yourpassword]
      /relay add weechat [yourport]
      /save
    

    Once you have entered in all these commands, you don't need your terminal anymore. You can close your ssh window!

  3. Your personal WeeChat server is set up. Now connect to it using a pretty client:
  4. glowing-bear is a free and open source web-based weechat client. It works well as a desktop client, and on iOS. To connect using glowing-bear, fill in "Connection Settings" with neotame.csclub.uwaterloo.ca, [yourport], and [yourpassword]. Make sure to use the http version of the website with this guide! https only works if you set up encryption. That's not covered here. Recommended: Weechat Android is a free and open source android weechat client. It gives notifications when your receive a direct message or your name is mentioned in one of the channels you are in. To connect using Weechat Android, fill in Settings > Connection with neotame.csclub.uwaterloo.ca, [yourport], and [yourpassword].
  5. Join the #csc IRC channel
  6. In your weechat client (e.g. glowing-bear or Weechat Android), switch to the 'Libera' tab and type:
      /server add libera irc.libera.chat/6697 -ssl -autoconnect
      /set irc.server.libera.autojoin "#csc"
      /save
      /connect libera
    

    You're now connected to the main IRC network! Connected by an SSL connection, so you're super sneaky as well. Way to go.

    Now, to join the CSC channel!

    In your client, you'll now have two buffers that you can switch to. One is called "weechat" and the other is "libera".

    Switch to the "libera" buffer and type:

      /join #csc
    

    Congratulations you win!

  7. Know some IRC commands
  8. Welcome to the channel! Go ahead and say something, like
      Good morning ctdalek http://www.total-knowledge.com/~ilya/mips/ugt.html
    

    If you want to privately message someone, use

      /q [nick] [optional message] 
    

    which will open a new tab with that person. For example /q pj2melan ping pong.

    If you want to join another channel, use

      /join [channel]
    

    For example /join #csc.

Note about CSClub server restarts: If neotame or any server you're using to run the weechat program on is restarted for any reason (we'll email you if it does), Make sure to run screen -U weechat again to start your server. You won't have to reconfigure weechat (step 2) though.

Securing Glowing Bear - SSL/TLS Setup

With the default setup, when you log in to your weechat relay using a client such as glowing-bear or Weechat Android, your password is sent in the clear. If you believe this to be a bad thing, follow these steps to enable SSL encryption between you and your weechat relay running on neotame.

  1. Log in to neotame.csclub.uwaterloo.ca to generate an SSL certificate:
    $ ssh neotame.csclub.uwaterloo.ca
    $ mkdir ~/.weechat/ssl
    $ cd ~/.weechat/ssl
    $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out relay.pem # Fill in the fields as it asks
    $ exit
    
  2. Tell weechat to use the new certificate you generated, and add a new relay with a different password (since your old password was likely compromised):

    In your weechat client (glowing-bear, or Weechat Android), run

     /set relay.network.password [newpassword]
     /relay sslcertkey
     /relay del weechat
     /relay add ssl.weechat [yourport]
    
  3. Tell your client to connect to your relay using SSL:

    For glowing-bear, refresh and simply check the "Encryption. Check settings for help." checkbox when logging in with your new password.

    For Weechat Android, in Settings > Connection, change Connection type to WeeChat SSL and change your Relay password.

Enjoy fully encrypted communication!

You might have warnings about untrusted certificates, but since you made the certificate yourself you can trust yourself and add required security exceptions.

Quick SSH-based Setup

1. Open up an IRC client, i.e. irssi. Launch irssi in a screen session, which you can return to later.

 $ ssh neotame.csclub.uwaterloo.ca
 $ screen -U irssi

2. In irssi, connect to the libera network and join our channel.

 /server add -auto -net libera -ssl -ssl_verify irc.libera.chat 6697
 /save
 /connect libera
 /join #csc

3. Please set your nickname to your Quest ID so we know who you are.

 /nick $YOUR_QUEST_ID
 /save

You can register your nickname on the libera network by messaging NickServ.

 /msg NickServ REGISTER password email 

4. Close your screen session, which you can return to later.

 CTRL-A CTRL-D

5. Return to your screen session. You will have remained connected to the channel.

 $ ssh neotame.csclub.uwaterloo.ca -t "screen -Urd"

Emacs

If you are comfortable with Emacs, then you can also configure the editor to act as an IRC client via erc. For a quick introduction, you can run M-x erc-tlswhere you will be prompted for a server, a port (the defaults are correct), and a nickname. For a detailed overview of possible configuration options see the ERC Emacs Wiki. To prettify the default display and for simiilar QOL changes, consider applying some of the configuration options from this guide by System Crafters.

ZNC.el

To keep track of chat logs while your machine is powered down, consider setting up ZNC with the help of ZNC.el.

syscom

To kick (and optionally ban) a user:

/cs op #<channel>
/mode #<channel> +b <nick_to_ban>
/kick <nick_to_kick>
/mode -o <your_nick>

If the user need not be banned you can skip the second line. If other accounts from the same user/host should be banned, replace nick_to_ban/kick with nick!username@host.