dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.10
Cinchy__ is now known as Cinchy
<qb> dominikh: I've noticed that authname can be spoofed
<dominikh> qb: how so?
<qb> I'm using authname to check for admins
<dominikh> how can it be spoofed.
<qb> and someone changing their nick can sometimes pass
<qb> sometimes
kith has quit [Quit: kith]
<catepillar> what server?
<qb> rizon
<qb> hold on let me compile the apporpriate logs
kith has joined #cinch
<dominikh> hm, that shouldn't be possible unless I messed up a certain routine
<qb> essentially what happened is someone changed their nick to an admin and the command went through
<qb> after the admin had left the channel
<dominikh> that really shouldn't be possible
<dominikh> ooh, hmm.
<dominikh> qb: does he have to use the command directly after changing the nick, or can some time elapse?
<qb> actually looking at my code this might be my fault
<qb> I have
<qb> m.user.refresh unless m.user.authed?
<qb> if $DataBase['users'].find{ |h| h['nick'] == m.user.authname }
<dominikh> that there would definitely be a bug if accepting commands per PM from users who aren't in the same channel as the bot
Spami has quit [Quit: This computer has gone to sleep]
<dominikh> but if the guy renaming is in a channel with the bot, it shouldn't matter.
<Cinchy> [URL] mnn.im / 1dtp
<qb> the command `-give nick x` basically distributes virtual currency which requires authentication to go through
<qb> so here GEEGEEGEE does it, gets whoised and it goes through
<dominikh> I don't see the issue here. GEEGEEGEE is authenticated. he himself changes his nick to 'confuse' – does that make him not authenticated?
<qb> then he changes to someone elses nick and it goes through again
<dominikh> because if that's the case, how the fuck does authentication/identifying on Rizon work?
<qb> see I'm not sure
<qb> obviously he would have to reauthenticate since that's a different nick with a different password
<dominikh> so, from your normal client, WHOIS GEEGEEGEE, then WHOIS him again when he's confuse. and paste the whole WHOIS output for both cases
<dominikh> (and I swear to god Rizon is a terrible network.)
<dominikh> nick-based authentication being a great example for that
<qb> http://mnn.im/pzvri I just tried it and it didn't work
<Cinchy> [URL] mnn.im / zvri
<qb> the thing is this has been working perfectly for two months now
<qb> only today did it mess up
<qb> so it might be something on rizon's end, or a bug in my implementation I overlooked or in cinch
<dominikh> so I take it in that paste, dp NICKd to Porygon2?
<qb> yes
<dominikh> that's a bug in Cinch then alright
<dominikh> when dp changes his nick, his authname stays as "dp"
<qb> ah, that would do it
<dominikh> now how to fix that without making it less efficient for everyone on sane networks :)
<qb> also notice how it still shows dp's vhost
<dominikh> so Rizon secretly changes the host without ever sending anyone any message about the new host?
<dominikh> sometimes I just feel like checking if the network is Rizon and then calling exit :)
<qb> [2013/11/25 22:06:07.264] >> :Porygon2!cgiirc@q.b.p.d PRIVMSG #Designers :test
<qb> yep
<dominikh> according to that line, he did keep his host
<qb> the vhost is going to stick on forever it seems
<dominikh> as in, the server didn't change it
<dominikh> so that's not my problem :D
<qb> I think the user would have to reconnect to have it removed
<qb> yeah it's not
<dominikh> yeah give me five minutes…
<dominikh> qb: git clone, build from the fix/unsync_auth branch and see if that fixes it and works properly :)
<qb> looks like it fixed it
<dominikh> cool. now we'll fait and see if it breaks something else :P
<dominikh> wait, too
<qb> but like I said before it was working fine for a while so I can't be 100% sure it was something with cinch
<qb> but I'll report anything I notice
<dominikh> qb: I'm pretty sure you just never tested it. or you did have an unconditional User#refresh in your check, which would work around the issue
<dominikh> either case it's a bug in Cinch that we fixed :)
leftylink has quit [Ping timeout: 272 seconds]
leftylink has joined #cinch
waxjar has quit [Ping timeout: 240 seconds]
DeepBlue has joined #cinch
DeepBlue is now known as lalala_oops
kludge` has quit [Ping timeout: 264 seconds]
kludge` has joined #cinch
mpapis has joined #cinch
<mpapis> good morning!
<mpapis> does someone remember the online list with cinch plugins / applications?
lalala_oops has quit [Read error: Connection reset by peer]
DeepBlue has joined #cinch
kludge` has quit [Remote host closed the connection]
leftylink has quit [Ping timeout: 272 seconds]
leftylink has joined #cinch
kludge` has joined #cinch
postmodern has quit [Quit: Leaving]
<dominikh> mpapis: search rubygems for "cinch-". the website doesn't exist anymore
<mpapis> ah ok, maybe a wiki page then?
DeepBlue has quit [Quit: Konversation terminated!]
<dominikh> there's a wiki with bots that use Cinch. and if you want to maintain a page of plugins, go ahead ;)
DeepBlue has joined #cinch
DeepBlue has quit [Quit: Konversation terminated!]
xeviox|afk is now known as xeviox
DeepBlue has joined #cinch
DeepBlue is now known as lalala_oops
waxjar has joined #cinch
lalala_oops has quit [Ping timeout: 245 seconds]
mpapis has quit [Ping timeout: 264 seconds]
mpapis has joined #cinch
<mpapis> dominikh, so can I use exception method directly in plugin or need to get logger first?
<dominikh> it's Helpers#exception, Helpers is included in plugins, so yeah, you can use exception directly
<mpapis> thanks
<dominikh> note that it's for logging actual Exception objects
<mpapis> yep I catched it to print message to user and was missing the exception in logs
<dominikh> your initialize must call super.
<Cinchy> [URL] Why is it bad style to `rescue Exception => e` in Ruby? - Stack Overflow
<dominikh> and apart from that the obvious race condition on lines 30/31 ;)
<mpapis> fixed Exception, as for the condition - I do not expect that many deploys ;) had situation travis reports two times the same build, wanted to avoid duplicate builds
<dominikh> yeah, but if it reports them two times at the same time, and you have a thread switch after the check and before setting the status, you'll end up running it twice
<mpapis> i tusually has offset of a 30 seconds
<dominikh> okay, fair enough then
<dominikh> if that still races you have other problems
<mpapis> yes fixing them ;) pushed two versions already, the biggest problem was missing LANG from Upstart
<dominikh> upstart, heh
<dominikh> anyway, nice plugin
<mpapis> yes will need to create list of my plugins, have already few
<awkisopen> is there a way to access the bot's default command prefix during plugin initialization time? I imagine it's at @bot.configuration.something but @bot is nil during that time
<dominikh> awkisopen: depends what you're actually trying to do
<awkisopen> I've written a command parser that runs at initalization time (like match) and I would like to assign it the prefix/suffix the actual commands will be using to make regexes more accurate
<awkisopen> if that makes sense. if not I'll try to rephrase
<dominikh> I'm not really much smarter now, no :) obviously there's no way to access the bot configuration in class methods (like match), because a plugin can be used in many different bot instances. match and prefix/suffix support lambdas, to generate regexps at runtime, based on the message/bot
<awkisopen> ahhh see I was under the impression that each Matcher got assigned the default prefix/suffix values for the bot somewhere during initialization and I was just blind as fuck
<dominikh> well, it happens when we instantiate the actual bot. at that point, Matchers get turned into actual handlers
<dominikh> for that specific plugin instance
<awkisopen> so to change my question, can a plugin get the default prefix/suffix values during runtime?
<awkisopen> I'm guessing by going into @bot's configuration
kludge` has quit [Quit: leaving]
<dominikh> @bot.config.plugins.prefix
<awkisopen> you da man
<dominikh> I'm a man
kludge` has joined #cinch
kludge` has quit [Client Quit]
kludge` has joined #cinch
<awkisopen> Peep Show <3
<dominikh> making peep show references is a bit dangerous, not many people get them.
<awkisopen> I'm actually mildly excited about this parser, I'm using ActiveModel for validations and error messages
<awkisopen> it's a lot easier than coding in every little way things could be parsed wrong, because the bot is for a channel that loves to break everything in every way possible
<dominikh> I have absolutely no idea what you could be doing that involves parsing, ActiveModel and plugin prefixes
<awkisopen> this is almost certainly where I find out I'm being an idiot, but it works like this
<awkisopen> instead of using #match in a plugin, I have a different method, #register_command, which takes a splatted hash of the name of each parameter the command will have, along with a few other options, such as a regex to match that parameter with /(/^#/ for channel names, for instance)
<awkisopen> at the end of that it takes a code block that uses ActiveModel's validation methods, so you can cpeciy what the expected input for any of those parameters is
<awkisopen> if any of those parameters fail validation, the first error message from ActiveModel::Errors is printed, and the command is not run
<awkisopen> if validation and parsing succeed, the values for each parameter are collected into a hash and unsplatted into a given method in the plugin, because I'm using ruby 2.0
<dominikh> okay, sounds sensible, to a degree. what I wonder is why it needs access to the plugin prefix. won't that just use #match under the hood?
<awkisopen> it does use #match under the hood, but the full message is passed to the parser, including the prefix
<dominikh> ah, right. fair enough
<awkisopen> but most importantly once I get the prefix/suffix properly stripped off, no one will whine about unhelpful error messages again
<awkisopen> anyway thanks for the help, hopefully that wasn't too dull
<dominikh> nah. interesting idea, actually
<awkisopen> I could throw you the WIP of the Command class in a gist, it's still messy but it has the general idea
<dominikh> sure, why not
<Cinchy> [gist] gist:7664403 (at gist.github.com, awkisopen on 2013-11-26 19:19)
<awkisopen> of course there'd be an IRC bot in here
<dominikh> hehe
<dominikh> it's customary for the creator of a bot framework
<awkisopen> so for reference this is pretty much what it looks like inside a plugin https://gist.github.com/awkisopen/7649792
<Cinchy> [gist] gist:7649792 (at gist.github.com, awkisopen on 2013-11-25 22:07)
<dominikh> I'll look at those gists when I get back in ~30 minutes
<awkisopen> no worries
<awkisopen> I need lunch
<dominikh> looks nifty
<awkisopen> thanks :)
<dominikh> of course I don't use anything that's named Active*, but still
<awkisopen> yeah I recognize that it's a bit bloaty
postmodern has joined #cinch
<awkisopen> and the way it works depends on ruby 2.0
<awkisopen> stuff I'd never do in anything but a personal project
<dominikh> hehe
<dominikh> to this day I'm still not on 2.0. and glad that Cinch seems to just work :P
<dominikh> it didn't for one person, but maybe they just fixed that bug
<awkisopen> honestly ruby 2.0 isn't that dramatic of a difference
<awkisopen> so there's few compatability issues for most libraries I found
<awkisopen> I made the jump to 2.0 and everything Just Worked(tm)
<awkisopen> I was impressed
<dominikh> I'd expect them to fuck it up somehow ;)
<awkisopen> samesies. it seems that they only added things and not really changed them
<waxjar> dominikh: i haven't (yet?) ran into any problems with your patch :)
<dominikh> waxjar: remind me, which patch was that?
<waxjar> an exception was raised when querying stuff about Users unknown to the server
<dominikh> ah, that
DeepBlue has joined #cinch
sacc91 has quit [Ping timeout: 252 seconds]
Spami has joined #cinch
swingha has quit [Quit: WeeChat 0.4.2]
DeepBlue is now known as lalala_oops
swingha has joined #cinch
xeviox is now known as xeviox|afk
swingha has quit [Quit: WeeChat 0.4.2]