insomniacslk / irc-slack Goto Github PK
View Code? Open in Web Editor NEWIRC-to-Slack gateway
License: BSD 3-Clause "New" or "Revised" License
IRC-to-Slack gateway
License: BSD 3-Clause "New" or "Revised" License
When a user reacts to a multi-line message, the reaction is reported (via notice) on the first line, but not on the subsequent lines, which trigger an invalid IRC command (visible in the status window of most clients).
Repro: react on a multi-line message, and observe the notice only on the first line and the error messages in the status window
Those two functions do basically the same thing.
Then remove IrcContext.GetUserInfo
Some commands contain sensitive information, e.g. PASS, and they are printed in the logs. Hide the sensitive information.
I see in channel list ids of the user
Currently the IRC Context is not cleaned up upon disconnection, and leaks memory until irc-slack is restarted. This increases memory pressure when disconnecting from large teams (e.g. on the Gophers team, currently ~65k people, it takes ~200MB of RSS)
irc-slack
uses too much memory. Without any connection it takes around 1MB RSS, but a large Slack team (thousands of people) that I'm testing on is taking 200 MB RSS.
Furthermore, upon disconnection it does not release the used memory.
Found another interesting bug --
Appears to be implemented properly for channels, but seems to be broken on PMs.
Reproduction steps:
Here's what I pulled from tcpdump -- (although I think this is correct? Might be a quassel issue on my end.)
<slack.username>!<slack.id>@10.9.2.201 PRIVMSG JohnDoe :asdfasdfa asdfasdfas asdfasdf asdfasdfa
331 RPL_NOTOPIC
"<channel> :No topic is set"
332 RPL_TOPIC
"<channel> :<topic>"
- When sending a TOPIC message to determine the
channel topic, one of two replies is sent. If
the topic is set, RPL_TOPIC is sent back else
RPL_NOTOPIC.
When replying to a multiline message in a thread, the server erroneously replies with messages like
cannot create nick "" for channel "+channame-12345"
At every release, also automatically publish the artifacts. See https://docs.travis-ci.com/user/deployment/releases/
If I use the Irssi command to add the server as described in the Readme, it results in a wrong entry in the Irssi config file.
Commands in Readme:
/network add SlackYourTeamName
/server add -auto SlackYourTeamName localhost 6666 xoxp-<your-slack-token>
Results in Irssi config:
servers = (
{
address = "SlackYourTeamName";
port = "0";
password = "6666";
use_tls = "no";
tls_verify = "no";
autoconnect = "yes";
}
);
chatnets = {
"SlackYourTeamName = { type = "IRC"; };
};
Running /connect SlackYourTeamName
afterwards results in:
No servers defined for this network, see /help server for how to add one
Add -network
to the /server add
command.
/network add SlackYourTeamName
/server add -auto -network SlackYourTeamName localhost 6666 xoxp-<your-slack-token>
Which results in this:
servers = (
{
chatnet = "SlackYourTeamName"
address = "localhost";
port = "6666";
password = "xoxp-<your-slack-token>";
use_tls = "no";
tls_verify = "no";
autoconnect = "yes";
}
);
chatnets = {
"SlackYourTeamName = { type = "IRC"; };
};
Currently slack.UserChangeEvent
simply triggers an update in the user cache, but if the user has changed nickname this is not shown in the channels.
This is definitely a feature request more than a bug. But when I issue a @usernameOnIRC it just comes across as just that straight text. Is there a way to do a translation so that the people on slack get the proper notification when messaging them?
It would appear that this translation already happens from slack to IRC, so half of the work is already done.
Hi,
thanks for this! This is much better than the bitlbee purple-slack gateway I had been using until. . . today, in a lot of small details, which I like.
I just have an issue when the server disconnects (happens pretty often from experience, remote closed the connection on slack side - I used to see this about once or twice a day), this also disconnects the irc client which reconnects 5 mins later.. and the new force join channels are recreated in different windows.
I'm not sure what's different, on most servers if I do e.g. /reconnect then channels are reused.
I figured many here would be using irssi and it probably doesn't do that for you, would you have a guess at what's different?
Ideally I'd also like to not have the 5 minutes of lost messages, so something like the irc-slack gateway trying to reconnect immediately after connection closed would just solve both issues.
I might try just calling connectToSlack(ctx);
from the slack.DisconnectedEvent
handler and see how this works out... :P
Thanks!
This is probably more of a feature request than a bug. But when you issue a /me command from your IRC client it shows up as:
ACTION is bored
And likewise in the IRC client, a /me command in slack just shows as a regular PRIVMSG. No rush or hurry on it it's just something to think about in the future.
Thanks again for making this app.
I was trying to get the app token but the hosted application seems to be down.
When sharing an attachment, also show the comment to the attachment
$ docker run insomniacslk/irc-slack
time="2020-04-29T16:02:00Z" level=info msg="Setting log level to 'info'" prefix=main
time="2020-04-29T16:02:00Z" level=info msg="Starting server on 127.0.0.1:6666" prefix=main
time="2020-04-29T16:02:00Z" level=info msg="Listening on 127.0.0.1:6666" prefix=main
However, the Docker container process does not listen on port 6666, as stated in the log.
$ sudo ss -tulwn | grep 6666
<no results>
If I use the git repo and build and run it myself it works:
$ ./irc-slack
[2020-04-29T17:55:32+02:00] INFO main: Setting log level to 'info'
[2020-04-29T17:55:32+02:00] INFO main: Starting server on 127.0.0.1:6666
[2020-04-29T17:55:32+02:00] INFO main: Listening on 127.0.0.1:6666
$ sudo ss -tulwn | grep 6666
tcp LISTEN 0 4096 127.0.0.1:6666 0.0.0.0:*
https://github.com/qaisjp/go-discord-irc
Maybe something to integrate / replicate?
First of all, thanks for the project!
When I connect to my IRC gateway using Quassel, queries don't show up in my chat list, only rooms. I haven't yet tried with other clients, but will try to do so.
I am having an issue with irc-slack when connecting to public, highly trafficked slacks with lots of users, who are now inactive on the slack. Thousands of mostly inactive users create memory usage in the app which is excessive on the small VPS server I run this app on.
Slack seems to have a concept of an 'away' slack user when they have been away/logged out of the slack for an extended time.
Is there a way to set a flag to have irc-slack connect and use a list of slack users who are not away?
It might make the loading of thousands of slack users a lot less if this flag could be set.
Thank you, Stefan S
When I'm trying to send single word/url to user or to channel, message is not relayed and console log throws "Invalid PRIVMSG command args" error:
2019/12/10 09:51:01 127.0.0.1:51172: PRIVMSG user https://github.com/insomniacslk/irc-slack/issues
2019/12/10 09:51:01 Invalid PRIVMSG command args: [user https://github.com/insomniacslk/irc-slack/issues]
2019/12/10 09:51:01 Got new message {@user }
The moment I append whitespace at the end it gets through:
2019/12/10 09:51:09 127.0.0.1:51172: PRIVMSG user :https://github.com/insomniacslk/irc-slack/issues .
2019/12/10 09:51:09 Got new message {@user https://github.com/insomniacslk/irc-slack/issues .}
Currently WHOIS shows only basic information, e.g.:
00:10 -!- insomniac [UAND64XSM@localhost]
00:10 -!- ircname : Andrea
00:10 -!- server : localhost []
00:10 -!- channels :
Slack supports additional information, e.g. Title, Email, Phone. It'd be nice to show them too.
Wherever it makes sense, handle slack.RateLimitedError
.
Hi thanks for the work,
just wanted to let you know i created a quick puppet module for this project
When a link is posted, also show its title
Every good application should have it's depenencies vendored :)
Found an odd bug:
When sending messages to yourself on the Slack web client, it results in the words you sent created as users. To be more specific -- if you send the words Hello World
to yourself on slack, a "user" Hello World
sends an empty message.
Here's what I pulled from my logs.
localhost 400 :Exactly two users expected in direct message, got 1 (conversation ID: <removed>)
:<slack username>!<slack user id>@localhost PRIVMSG :Hello World
After setting this up I noticed that when I tried to join a "private" channel on slack that it reported in the server log (and not to the client):
Cannot join channel #secret-channel-here: name_taken
I assume this is because secret/private channels on slack are treated in a completely different way. Is there a workaround for this?
Today I was trying to connect to a slack where a channel that I was forced to belong to had 450+ users in it. The problem is that my ZNC bouncer was disconnecting because a command was being sent to the client that exceeded its limits. Here is an example of the messages that are being sent:
Sending numeric reply: :irc-slack-name-here 353 myUsername = #general :(list of users that is 450+ characters)
According to this bug report that the server shouldn't send over 512 total bytes per message in total (according to the RFC). I believe that ZNC (further on in that bug) allows up to 1024 total bytes per message.
I believe the solution would be to chunk the data (512 byte chunks) sent to the client so that they don't freak out in any manner. The method in question is here.
Sorry for the multiple bugs today.
Hello,
I get the following error when trying to install on Debian:
$ go get ./...
package github.com/nlopes/slack
imports context: unrecognized import path "context"
I'm running debian 8 with go installed from debian packages:
$ go version
go version go1.3.3 linux/amd64
$ dpkg --list | grep golang
ii golang 2:1.3.3-1 all Go programming language compiler - metapackage
ii golang-doc 2:1.3.3-1 all Go programming language compiler - documentation
ii golang-go 2:1.3.3-1 amd64 Go programming language compiler
ii golang-go-linux-amd64 2:1.3.3-1 amd64 Go standard library compiled for linux_amd64
ii golang-go.tools 0.0~hg20140703-4 amd64 supplementary Go tools
ii golang-src 2:1.3.3-1 amd64 Go programming language compiler - source files
Hi. First off thanks for the great app!
I use Quassel IRC and when I send a message a split second later the same message appears again. As if I sent it twice.
Others do not see doubled messages, even I don't see it in native slack client. So it is probably something between Quassel and irc-slack that makes Qassel show my own message 2 times.
Slack deletes the oldest attached files. Let's add a command line option to save them so they're not lost!
The nickname, or username of the person chatting on each slack channel is not working properly.
In most cases, it is just sending a "U#######" string for each person, altho it does occasionally send a person's username:
10:34 < U9X9H2KPG> post/notice/message
15:14 < U5WQ1RXLL> That's me in the middle
15:15 < moxuz> the octopus?
I assume this is a Slack internal ID being sent out.
This is the number one bug/issue for me, makes chatting in the Slack channels almost useless, if I cant hilite people back in response in IRSSI.
Thanks!!
-- Stefan S
Currently there is no TLS support, but it has to be added
currently join/part doesn't work:
21:42 < nickname> @nickname has left the channel
and the user remains in the chan list
Are there already any ideas of how threads could be supported in irc-slack? Eg: creating a new virtual irc channel per thread or something similar?
We should remove the sentence that says "The code quality is currently at the works-for-me level, but it's improving steadily." because that's not true anymore (irc-slack is pretty solid now), and replace it with a feature matrix so people know what works and what not, and we know what needs to be implemented next
When connected to a Slack team, joining channels/groups seems to be slower than necessary. This is done in two steps:
GetChannels
and GetGroups
on the slack API object)This can be slow on larger teams - look for what can be sped up.
Thanks for this project, makes slack much nicer to use than with their web UI :)
It seems that if someone responds to a thread while there is also a 1-on-1 chat open for that same user (for example from /QUERY), then the message they posted to the thread will appear in the 1-on-1 chat rather than under the thread. Note that the thread "channel" still opens, but the messages aren't posted to it.
Can provide debug logs or testing as needed.
Hey! Thanks for this tool. I'm just getting started, so I may be doing something wrong, but I seem to be running into an issue trying to setup a connection.
I've gone ahead, and grabbed a token/cookie value from my browser, and set them as my IRC Password, however I'm still getting a failure to conenct. Upon turning on debug logging I see:
Jul 10 19:47:30 znc ircslack[22422]: time="2020-07-10T19:47:30Z" level=info msg="Starting Slack client" prefix=main
Jul 10 19:47:30 znc ircslack[22422]: time="2020-07-10T19:47:30Z" level=info msg="Connecting to RTM" prefix=slack-api
Jul 10 19:47:31 znc ircslack[22422]: time="2020-07-10T19:47:31Z" level=info msg="Using URL:
Jul 10 19:47:31 znc ircslack[22422]: " prefix=slack-api
Jul 10 19:47:31 znc ircslack[22422]: time="2020-07-10T19:47:31Z" level=info msg="Failed to start or connect to RTM: invalid_auth" prefix=slack-api
Jul 10 19:47:31 znc ircslack[22422]: time="2020-07-10T19:47:31Z" level=info msg="invalid auth when connecting with RTM: invalid_auth" prefix=slack-api
Jul 10 19:47:31 znc ircslack[22422]: time="2020-07-10T19:47:31Z" level=info msg="Failed to connect with RTM on try 0: invalid_auth" prefix=slack-api
Jul 10 19:47:40 znc ircslack[22422]: time="2020-07-10T19:47:40Z" level=warning msg="Cannot connect to Slack: Connection to Slack timed out after 10s" prefix=main
Jul 10 19:47:40 znc ircslack[22422]: time="2020-07-10T19:47:40Z" level=warning msg="Error handling connection from 127.0.0.1:25416: read tcp 127.0.0.1:6666->127.0.0.1:25416: use of closed network connection" prefix=main
I'm pretty certain I've copied both the cookie, and token correctly, but am unsure of how to validate the rest of the setup/the token itself. Any help is appreciated,
thanks!
For example when the join failure reason is is_archived
it could be handled as BAN.
See other errors at https://api.slack.com/methods/channels.join
I don't really understand what "slack apps" can support.
Using these mentions in channels doesn't send notifications to other users
Use the Conversations API rather than the various channels/groups/IMs/multi-person APIs. This will simplify the code a lot, and make the missing types of conversation work
Direct messages (IMs in Slack / PRIVMSG to an user in IRC) are not working correctly if writing/reading from different sources (e.g. the web UI, the IRC gateway)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.