All Projects → insomniacslk → Irc Slack

insomniacslk / Irc Slack

Licence: bsd-3-clause
IRC-to-Slack gateway

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Irc Slack

Localslackirc
IRC gateway for slack, running on localhost for one user
Stars: ✭ 84 (-31.71%)
Mutual labels:  slack, irc, gateway, irc-client
Irslackd
Self-hosted IRC gateway to Slack
Stars: ✭ 128 (+4.07%)
Mutual labels:  slack, irc, irc-client
Convos
Convos 👥 is the simplest way to use IRC in your browser
Stars: ✭ 789 (+541.46%)
Mutual labels:  irc, irc-client
Torpedo
Pluggable, multi-network asynchronous chat bot written in Go
Stars: ✭ 19 (-84.55%)
Mutual labels:  slack, irc
Kittehircclientlib
An IRC client library in Java
Stars: ✭ 116 (-5.69%)
Mutual labels:  irc, irc-client
Kiwiirc
🥝 Next generation of the Kiwi IRC web client
Stars: ✭ 488 (+296.75%)
Mutual labels:  irc, irc-client
Quassel
Quassel IRC: Chat comfortably. Everywhere.
Stars: ✭ 589 (+378.86%)
Mutual labels:  irc, irc-client
Alectro
A terminal IRC client in Rust.
Stars: ✭ 47 (-61.79%)
Mutual labels:  irc, irc-client
Revolution Irc
A modern Android IRC client. #revolutionirc on Freenode.
Stars: ✭ 325 (+164.23%)
Mutual labels:  irc, irc-client
Girc
💣 girc is a flexible IRC library for Go 👌
Stars: ✭ 59 (-52.03%)
Mutual labels:  irc, irc-client
Biboumi
IRC gateway for XMPP
Stars: ✭ 51 (-58.54%)
Mutual labels:  irc, gateway
Rirc
A terminal IRC client in C
Stars: ✭ 115 (-6.5%)
Mutual labels:  irc, irc-client
Thelounge
💬 ‎ Modern, responsive, cross-platform, self-hosted web IRC client
Stars: ✭ 4,618 (+3654.47%)
Mutual labels:  irc, irc-client
Kirc
A tiny IRC client written in POSIX C99.
Stars: ✭ 416 (+238.21%)
Mutual labels:  irc, irc-client
Dispatch
Web-based IRC client in Go.
Stars: ✭ 595 (+383.74%)
Mutual labels:  irc, irc-client
Matterbridge
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Stars: ✭ 4,452 (+3519.51%)
Mutual labels:  slack, irc
Irackbot
Bridge between Slack and IRC channels allowing message filtering and logging while keeping communication public
Stars: ✭ 25 (-79.67%)
Mutual labels:  slack, irc
Birch
An IRC client written in bash
Stars: ✭ 256 (+108.13%)
Mutual labels:  irc, irc-client
Yetibot
🤖 Extreme chatops bot for Slack and IRC 🔧 New contributors welcome 🏗
Stars: ✭ 311 (+152.85%)
Mutual labels:  slack, irc
Marvin
The paranoid bot (framework)
Stars: ✭ 51 (-58.54%)
Mutual labels:  slack, irc

IRC-to-Slack gateway

irc-slack is an IRC-to-Slack gateway. It is an IRC server that lets you connect to your Slack teams with your IRC client.

(That guy is me)

Slack has ended support for IRC and XMPP gateway on the 15th of May 2018. So what's left to do for people like me, who want to still be able to log in via IRC? Either you use wee-slack (but I don't use WeeChat), or you implement your own stuff.

NOTE: after Slack turned down their IRC gateway I got a lot of contacts from users of irc-slack asking me to fix and improve it. I didn't expect people to actually use it, but thanks to your feedback I'm now actively developing it again :-) Please keep reporting bugs and sending PRs!

How to use it

cd cmd/irc-slack
make
./irc-slack # by default on port 6666

Then configure your IRC client to connect to localhost:6666 and use one of the methods in the Tokens section to set the connection password.

You can also run it with Docker.

Feature matrix

public channel private channel multiparty IM IM
from me works works doesn't work (#168) works
to me works works works works
thread from me doesn't work (#168) doesn't work (#168) untested doesn't work (#166)
thread to me works works untested works but sends in the IM chat (#167)

Encryption

irc-slack by default does not use encryption when communicating with your IRC client (but the communication between irc-slack and the Slack servers is encrypted). If you want to use TLS, you can use the -key and -cert command line parameters, and point them to a TLS certificate that you own. This is useful if you plan to connect to to irc-slack over the internet.

For example, you can generate a valid certificate with LetsEncrypt (adjust the relevant fields of course):

sudo certbot certonly \
    -n \
    -d your.domain.example.com \
    --test-cert \
    --standalone \
    -m [email protected] \
    --agree-tos

Then your key and certificate will be generated under /etc/letsencrypt/live/your.domain.example.com with the names privkey.pem and cert.pem respectively.

Authentication

To connect to Slack via irc-slack you need an authentication string. There are three possible methods:

  • User tokens with auth cookies (recommended)
  • Slack app tokens (if you can install apps on your slack team)
  • legacy tokens (soon to be deprecated)

These options are discussed in more detail below. Then just add -key <path/to/privkey.pem> -cert <path/to/cert.pem> to enable TLS on irc-slack, and enable TLS on your IRC client.

User tokens with auth cookie

This approach does not require legacy tokens nor installing any app, but in order to get the token there are a few manual steps to execute.

This type of token starts with xoxc-, and requires an auth cookie to be paired to it in order to work.

There are two possible procedures, an entirely manual one, using the browser console, and a semi-automated one, which requires Chrome or Chromium in headless mode.

manual procedure via browser

This is the same procedure as described in two similar projects, see:

But in short, log via browser on the Slack team, open the browser's network tab in the developer tools, and look for an XHR transaction. Then look for

  • the token (it starts with xoxc-) in the request data
  • the auth cookie, contained in the d key-value in the request cookies (it looks like d=XXXX;)

Then concatenate the token and the auth cookie using a | character, like this:

xoxc-XXXX|d=XXXX;

and use the above as your IRC password.

semi-automated procedure using Chrome/Chromium in headless mode

See autotoken. Just build it with go build and run with ./autotoken -h to see the usage help.

Slack App tokens

As an alternative, you can install the irc-slack app on your workspace, and use the token that it returns after you authorize it.

In order to run the application, you need to do the following steps:

  • create a Slack app using their v1 OauthV2 API (note: not their v2 version) at https://api.slack.com/apps
  • configure the redirect URL to your endpoint (in this case https://my-server/irc-slack/auth/)
  • run the web app under slackapp passing your app client ID and client secret, you can find them in the Basic Information tab at the link at the previous step

The token starts with xoxp-, and you can use it as your IRC password when connecting to irc-slack.

This is a Slack app with full user permissions, that is used to generate a Slack user token. Note that you need to install this app on every workspace you want to use it for, and the workspace owners may reject it.

This app exchanges your temporary authentication code with a permanent token.

Legacy tokens

This is the easiest method, but it's deprecated and Slack will soon disable it. Slack has announced that they will stop issuing legacy tokens starting the 4th of May 2020, so this section will stay here for historical reasons.

Get you Slack legacy token at https://api.slack.com/custom-integrations/legacy-tokens , and set it as your IRC password when connecting to irc-slack.

Run it with Docker

Thanks to halkeye you can run irc-slack via Docker. The Dockerfile is published on https://hub.docker.com/r/insomniacslk/irc-slack and will by default listen on 0.0.0.0:6666. You can pull and run it with:

docker run --rm -p 6666:6666 insomniacslk/irc-slack

If you want to build it locally, just run:

docker build -f Dockerfile . -t insomniacslk/irc-slack

Connecting with irssi

/network add yourteam.slack.com
/server add -auto -network yourteam.slack.com localhost 6666 xoxp-<your-slack-token>
/connect yourteam.slack.com

Remember to add -tls to the /connect command if you're running irc-slack with TLS. Also remember to replace localhost with the name of the host you're connecting to, if different.

Connecting with WeeChat

/server add yourteam.slack.com localhost/6666
/set irc.server.yourteam.slack.com.password xoxp-<your-slack-token>
/connect yourteam.slack.com

To enable TLS, also run the following before the /connect command:

/set irc.server.yourteam.slack.com.ssl on
/set irc.server.yourteam.slack.com.ssl_verify on

Also remember to replace localhost with the name of the host you're connecting to, if different.

Gateway usage

There are a few options that you can pass to the server, e.g. to change the listener port, or the server name:

$ ./irc-slack -h
Usage of ./irc-slack:
  -c, --cert string         TLS certificate for HTTPS server. Requires -key
  -C, --chunk int           Maximum size of a line to send to the client. Only works for certain reply types (default 512)
  -D, --debug               Enable debug logging of the Slack API
  -d, --download string     If set will download attachments to this location
  -l, --fileprefix string   If set will overwrite urls to attachments with this prefix and local file name inside the path set with -d
  -H, --host string         IP address to listen on (default "127.0.0.1")
  -k, --key string          TLS key for HTTPS server. Requires -cert
  -L, --loglevel string     Log level. One of [none debug info warning error fatal] (default "info")
  -P, --pagination int      Pagination value for API calls. If 0 or unspecified, use the recommended default (currently 200). Larger values can help on large Slack teams
  -p, --port int            Local port to listen on (default 6666)
  -s, --server string       IRC server name (i.e. the host name to send to clients)
pflag: help requested
exit status 2

Deploying with Puppet

You can use the irc-slack module for Puppet by John Bond.

TODO

A lot of things. Want to help? Grep "TODO", "FIXME" and "XXX" in the code and send me a PR :)

This currently "works for me", but I published it in the hope that someone would use it so we can find and fix bugs.

BUGS

Plenty of them. I wrote this project while on a plane (like many other projects of mine) so this is hack-level quality - no proper design, no RFC compliance, no testing. I just fired up an IRC client until I could reasonably chat on a few Slack teams. Please report all the bugs you find on the Github issue tracker, or privately to me.

Authors

Thanks

Special thanks to

  • Stefan Stasik for helping me find, fix and troubleshoot a zillion of bugs :)
  • Mauro Codella for patiently reading and replying for two hours in a private conversation that I used to test the fix at pull/23 :D
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].