sbp / saxo

Quick and flexible irc bot, extensible in any language
http://inamidst.com/saxo/
Apache License 2.0
52 stars 22 forks source link

Allow joining password protected channels #64

Open rretzbach opened 9 years ago

rretzbach commented 9 years ago

I have looked at the documentation and I don't see a way to configure a password for a password protected irc channel. So I'd like to see this enhancement in saxo.

According to RFC1459, 4.2.3.1 Channel modes you can set a password protected channel like:

/mode #mychannel +k mypassword

To solve this issue three things must be done imho: I. configure password protected channels, for example

[client]
    nick = saxo67301
    channels = ##saxo #test #mychannel|mypassword
    prefix = .

II. let saxo join a channel by passing the password, see Wiki IRC_Commands for the irc command. I think irc.py needs to be changed

III. update the documentation to show how the configuration is done, probably in config.md

Tell me what you think about this.

sbp commented 9 years ago

This is a great RFE, but I'm not sure about the config syntax. Do you have any other suggestions? Will have to think about this.

rretzbach commented 9 years ago

Are you unsure about the password being parsed correctly? Or do you not like the proposed delimiter characters?

I can also imagine the following simple config syntaxes:

[client]
nick = saxo67301
channels = ##saxo, #test, #mychannel mypassword
prefix = .

or

[client]
nick = saxo67301
channels = ##saxo #test #mychannel<mypassword>
prefix = .

If you choose different delimiters you get more variations.

Another solution would be to use a different file format like json which supports tree like struktures. Similar to an irssi config file.

sbp commented 9 years ago

One problem with using |, <, or > as delimiters is that they are valid channel characters:

   Channels names are strings (beginning with a '&', '#', '+' or '!'
   character) of length up to fifty (50) characters.  Apart from the
   requirement that the first character is either '&', '#', '+' or '!',
   the only restriction on a channel name is that it SHALL NOT contain
   any spaces (' '), a control G (^G or ASCII 7), a comma (',').

RFC 2812, § 1.3

So only #mychannel,mypassword would work. Another possibility is:

[client]
nick = saxo67301
channels = ##saxo #test #mychannel
passwords = #mychannel mypassword
prefix = .

Using another parameter, passwords, and something a bit like an alist.

jeff-bollinger commented 8 years ago

Curious if anyone has made an update to support this feature? Still appears to be no way to allow a saxo bot so join a key/password protected IRC channel. Even with the 'join' command.

jfdive commented 8 years ago

Here is a patch that implement the channel,passwd.

I had to change the behavior within irc.py to use ":" quickly going trough the RFC, i think this is not needed, not intended for client irc code (not double checked). passwd channel access didn't worked with "JOIN: #channel password" but does with "JOIN #channel password". All seems to work happily with this patch for us.

saxo.channel.passwd.diff.txt