{"id":13715742,"url":"https://github.com/insomniacslk/irc-slack","last_synced_at":"2025-04-04T17:05:32.002Z","repository":{"id":41447420,"uuid":"127798941","full_name":"insomniacslk/irc-slack","owner":"insomniacslk","description":"IRC-to-Slack gateway","archived":false,"fork":false,"pushed_at":"2025-03-24T02:44:19.000Z","size":582,"stargazers_count":200,"open_issues_count":26,"forks_count":19,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T16:04:47.972Z","etag":null,"topics":["gateway","irc","irc-client","irc-slack","irssi","slack","slack-team","weechat"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insomniacslk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-02T18:55:41.000Z","updated_at":"2025-03-07T10:34:20.000Z","dependencies_parsed_at":"2024-01-09T09:49:09.872Z","dependency_job_id":"d9877614-4bee-4d78-8217-0aff2c38c1ff","html_url":"https://github.com/insomniacslk/irc-slack","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomniacslk%2Firc-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomniacslk%2Firc-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomniacslk%2Firc-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomniacslk%2Firc-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insomniacslk","download_url":"https://codeload.github.com/insomniacslk/irc-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217174,"owners_count":20903008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gateway","irc","irc-client","irc-slack","irssi","slack","slack-team","weechat"],"created_at":"2024-08-03T00:01:02.964Z","updated_at":"2025-04-04T17:05:31.964Z","avatar_url":"https://github.com/insomniacslk.png","language":"Go","funding_links":[],"categories":["Frameworks"],"sub_categories":["Bridges"],"readme":"# IRC-to-Slack gateway\n\n`irc-slack` is an IRC-to-Slack gateway. It is an IRC server that lets you\nconnect to your Slack teams with your IRC client.\n\n[![](images/team_chat_2x.png)](https://xkcd.com/1782/)\n\n(That guy is me)\n\nSlack has ended support for IRC and XMPP gateway on the 15th of May 2018. So\nwhat's left to do for people like me, who want to still be able to log in via\nIRC? Either you use [wee-slack](https://github.com/wee-slack/wee-slack) (~~but I\ndon't use WeeChat~~), or you implement your own stuff.\n\nNOTE: 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 :-)\nPlease keep reporting bugs and sending PRs!\n\n## How to use it\n\n```\ncd cmd/irc-slack\nmake # use `make` instead of `go build` to include build information when running with `-v`\n./irc-slack # by default on port 6666\n```\n\nThen configure your IRC client to connect to localhost:6666 and use one of the methods in the Tokens section to set the connection password.\n\nYou can also [run it with Docker](#run-it-with-docker).\n\n## Feature matrix\n\n|     | public channel | private channel | multiparty IM | IM |\n| --- | --- | --- | --- | --- |\n| from me | works | works | doesn't work ([#168](https://github.com/insomniacslk/irc-slack/issues/168)) | works |\n| to me | works | works | works | works |\n| thread from me | doesn't work ([#168](https://github.com/insomniacslk/irc-slack/issues/168)) | doesn't work ([#168](https://github.com/insomniacslk/irc-slack/issues/168)) | untested | doesn't work ([#166](https://github.com/insomniacslk/irc-slack/issues/166)) |\n| thread to me | works | works | untested | works but sends in the IM chat ([#167](https://github.com/insomniacslk/irc-slack/issues/167)) |\n\n## Encryption\n\n`irc-slack` by default does not use encryption when communicating with your IRC\nclient (but the communication between `irc-slack` and the Slack servers is\nencrypted).\nIf you want to use TLS, you can use the `-key` and `-cert` command line\nparameters, and point them to a TLS certificate that you own.\nThis is useful if you plan to connect to to `irc-slack` over the internet.\n\nFor example, you can generate a valid certificate with LetsEncrypt (adjust the relevant\nfields of course):\n```\nsudo certbot certonly \\\n    -n \\\n    -d your.domain.example.com \\\n    --test-cert \\\n    --standalone \\\n    -m your@email.example.com \\\n    --agree-tos\n```\n\nThen your key and certificate will be generated under\n`/etc/letsencrypt/live/your.domain.example.com`\nwith the names `privkey.pem` and `cert.pem` respectively.\n\n## Authentication\n\nTo connect to Slack via `irc-slack` you need an authentication string. There are\nthree possible methods:\n* User tokens with auth cookies (recommended)\n* Slack app tokens (if you can install apps on your slack team)\n* legacy tokens (soon to be deprecated)\n\nThese options are discussed in more detail below.\nThen just add `-key \u003cpath/to/privkey.pem\u003e -cert \u003cpath/to/cert.pem\u003e` to enable\nTLS on `irc-slack`, and enable TLS on your IRC client.\n\n\n### User tokens with auth cookie\n\nThis approach does not require legacy tokens nor installing any app, but in order to\nget the token there are a few manual steps to execute.\n\nThis type of token starts with `xoxc-`, and requires an auth cookie to be paired\nto it in order to work.\n\nThere are two possible procedures, an entirely manual one, using the browser\nconsole, and a semi-automated one, which requires Chrome or Chromium in headless\nmode.\n\n**manual procedure via browser**\n\nThis is the same procedure as described in two similar projects, see:\n* https://github.com/adsr/irslackd/wiki/IRC-Client-Config#xoxc-tokens\n* https://github.com/ltworf/localslackirc/#obtain-a-token\n\nBut in short, log via browser on the Slack team, open the browser's network tab\nin the developer tools, and look for an XHR transaction. Then look for\n* the token (it starts with `xoxc-`) in the request data\n* the auth cookie, contained in the `d` key-value in the request cookies (it looks like `d=XXXX;`)\n\nThen concatenate the token and the auth cookie using a `|` character, like this:\n```\nxoxc-XXXX|d=XXXX;\n```\n\nand use the above as your IRC password.\n\n**semi-automated procedure using Chrome/Chromium in headless mode**\n\nSee [autotoken](tools/autotoken). Just build it with `go build` and run with\n`./autotoken -h` to see the usage help.\n\nIf you prefer to run `autotoken` via Docker, you can test your luck with:\n```\ndocker build -t insomniacslk/irc-slack/tools-autotoken -f Dockerfile.autotoken .\ndocker run --rm -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix insomniacslk/irc-slack/tools-autotoken autotoken -h\n```\n\n### Slack App tokens\n\nAs an alternative, you can install the irc-slack app on your workspace, and use the token that it returns after you authorize it.\n\nIn order to run the application, you need to do the following steps:\n* create a Slack app using their v1 OauthV2 API (note: not their v2 version) at https://api.slack.com/apps\n* configure the redirect URL to your endpoint (in this case\n  https://my-server/irc-slack/auth/)\n* run the web app under [slackapp](tools/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\n\nThe token starts with `xoxp-`, and you can use it as your IRC password when\nconnecting to `irc-slack`.\n\nThis is a Slack app with full user permissions, that is used to generate a Slack user token.\nNote that you need to install this app on every workspace you want to use it\nfor, and the workspace owners may reject it.\n\nThis app exchanges your temporary authentication code with a permanent token.\n\n### Legacy tokens\n\nThis is the easiest method, but it's deprecated and Slack will soon disable it.\nSlack has announced that they will stop issuing legacy tokens starting the 4th\nof May 2020, so this section will stay here for historical reasons.\n\nGet you Slack legacy token at https://api.slack.com/custom-integrations/legacy-tokens ,\nand set it as your IRC password when connecting to `irc-slack`.\n\n\n## Run it with Docker\n\nThanks to [halkeye](https://github.com/halkeye) you can run `irc-slack` via\nDocker. The `Dockerfile` is published on\nhttps://hub.docker.com/r/insomniacslk/irc-slack and will by default listen on\n`0.0.0.0:6666`. You can pull and run it with:\n\n```\ndocker run --rm -p 6666:6666 insomniacslk/irc-slack\n```\n\nIf you want to build it locally, just run:\n```\ndocker build -f Dockerfile . -t insomniacslk/irc-slack\n```\n\n\n### Connecting with irssi\n```\n/network add yourteam.slack.com\n/server add -auto -network yourteam.slack.com localhost 6666 xoxp-\u003cyour-slack-token\u003e\n/connect yourteam.slack.com\n```\n\nRemember to add `-tls` to the `/connect` command if you're running `irc-slack`\nwith TLS.\nAlso remember to replace `localhost` with the name of the host you're connecting to,\nif different.\n\n### Connecting with WeeChat\n\n```\n/server add yourteam.slack.com localhost/6666\n/set irc.server.yourteam.slack.com.password xoxp-\u003cyour-slack-token\u003e\n/connect yourteam.slack.com\n```\n\nTo enable TLS, also run the following before the `/connect` command:\n```\n/set irc.server.yourteam.slack.com.ssl on\n/set irc.server.yourteam.slack.com.ssl_verify on\n```\n\nAlso remember to replace `localhost` with the name of the host you're connecting to,\nif different.\n\n## Gateway usage\n\nThere are a few options that you can pass to the server, e.g. to change the listener port, or the server name:\n\n```\n$ ./irc-slack -h\nUsage of ./irc-slack:\n  -c, --cert string         TLS certificate for HTTPS server. Requires -key\n  -C, --chunk int           Maximum size of a line to send to the client. Only works for certain reply types (default 512)\n  -D, --debug               Enable debug logging of the Slack API\n  -d, --download string     If set will download attachments to this location\n  -l, --fileprefix string   If set will overwrite urls to attachments with this prefix and local file name inside the path set with -d\n  -H, --host string         IP address to listen on (default \"127.0.0.1\")\n  -k, --key string          TLS key for HTTPS server. Requires -cert\n  -L, --loglevel string     Log level. One of [none debug info warning error fatal] (default \"info\")\n  -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\n  -p, --port int            Local port to listen on (default 6666)\n  -s, --server string       IRC server name (i.e. the host name to send to clients)\npflag: help requested\nexit status 2\n```\n\n## Deploying with Puppet\n\nYou can use the [irc-slack module for Puppet](https://github.com/b4ldr/puppet-irc_slack) by [John Bond](https://github.com/b4ldr).\n\n## TODO\n\nA lot of things. Want to help? Grep \"TODO\", \"FIXME\" and \"XXX\" in the code and send me a PR :)\n\nThis currently \"works for me\", but I published it in the hope that someone would use it so we can find and fix bugs.\n\n## BUGS\n\nPlenty 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.\n\n## Authors\n\n* [Andrea Barberio](https://insomniac.slackware.it)\n* [Josip Janzic](https://github.com/janza)\n\n## Thanks\n\nSpecial thanks to\n* Stefan Stasik for helping me find, fix and troubleshoot a zillion of bugs :)\n* [Mauro Codella](https://github.com/codella) for patiently reading and replying for two hours in a private conversation that I used to test the fix at [pull/23](https://github.com/insomniacslk/irc-slack/pull/23) :D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsomniacslk%2Firc-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsomniacslk%2Firc-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsomniacslk%2Firc-slack/lists"}