Camelia, the Perl 6 bug

IRC log for #mojo, 2010-09-23

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 jawnsy left #mojo
00:00 tempire left #mojo
00:00 tempire joined #mojo
00:00 tempire left #mojo
00:01 alnewkirk|com polvo, huh?
00:01 tempire joined #mojo
00:02 tempire left #mojo
00:02 tempire joined #mojo
00:03 polvo alnewkirk|com, never mind
00:03 mvuets tempire: emm, ->text is not what i need.
00:05 tempire You have: <div id="a">A</div><div id="b">B</div>, and you want to extract A & B, right?
00:05 mvuets tempire: no
00:06 mvuets I have <div> ...whatever... </div>
00:07 mvuets There are may be tags, texts... i don't care. I need it as is.
00:07 tempire ah
00:08 tempire just print out the node, it will stringify.
00:08 tempire $dom->find('div')->each( sub { print shift } );
00:08 mvuets ->to_xml is what i need, but surrounding <div>...</div> is also included.
00:09 tempire or "print $dom", if you need everything that was parsed
00:09 jawnsy joined #mojo
00:09 mvuets As i understood "" is overloaded to to_xml, so it does not work (:
00:13 mvuets mojo$ perl -Ilib -MMojo::DOM -E 'say Mojo::DOM->new->parse("<a>xxx<x>​x</x>xxx</a>")->at("a")->to_xml'
00:13 mvuets I wanna get xxx<x>x</x>xxx
00:17 polvo hm. why doesn't render_text('') create a response?
00:26 tempire left #mojo
00:27 tempire joined #mojo
00:28 tempire left #mojo
00:28 tempire joined #mojo
00:33 tempire left #mojo
00:34 tempire joined #mojo
00:36 tempire left #mojo
00:44 mvuets left #mojo
00:49 tempire joined #mojo
00:56 tempire left #mojo
00:57 tempire joined #mojo
00:58 tempire left #mojo
01:00 tempire joined #mojo
01:04 Kulag left #mojo
01:17 Kulag joined #mojo
02:35 janus left #mojo
02:48 memowe left #mojo
03:07 ash_ left #mojo
03:18 ash_ joined #mojo
03:20 ash__ joined #mojo
03:22 ash_ left #mojo
03:22 ash__ is now known as ash_
03:28 Kulag left #mojo
03:29 Kulag joined #mojo
03:36 arthas left #mojo
03:39 arthas joined #mojo
03:51 janus joined #mojo
03:52 Kulag left #mojo
03:54 Kulag joined #mojo
04:03 tl joined #mojo
04:05 tholen42 left #mojo
04:18 Kulag left #mojo
04:19 Kulag joined #mojo
04:27 Kulag left #mojo
04:33 Kulag joined #mojo
04:39 Kulag left #mojo
04:39 Kulag joined #mojo
04:51 Kulag left #mojo
04:52 ash_ left #mojo
04:52 Kulag joined #mojo
04:54 MojoGuest600 joined #mojo
04:54 MojoGuest600 From: http://www.google.com/search?client=safari&amp;rls​=en&amp;q=websocket+demo&amp;ie=UTF-8&amp;oe=UTF-8 (1 hits)
04:54 MojoGuest600 left #mojo
04:59 Kulag left #mojo
05:04 Kulag joined #mojo
05:06 perlrocks joined #mojo
05:06 perlrocks left #mojo
05:10 Kulag left #mojo
05:11 sri moin
05:15 sri polvo: render_text does generate a response
05:16 sri not sure about older versions, but in the latest it works
05:18 alnewkirk|com left #mojo
05:21 koban joined #mojo
05:22 a|newkirk[assoc] joined #mojo
05:36 a|newkirk[assoc] left #mojo
05:42 a|newkirk[assoc] joined #mojo
05:51 GitHub6 joined #mojo
05:51 GitHub6 mojo: master Sebastian Riedel * 84f7596 (3 files in 3 dirs): added inner_xml method to Mojo::DOM - http://bit.ly/bdD7ag
05:51 GitHub6 left #mojo
05:51 sri that will take care of mvuets problem (once he returns)
05:53 sri originally wanted to call it to_inner_xml but that just doesn't sound so nice
05:56 GitHub124 joined #mojo
05:56 GitHub124 mojo: master Sebastian Riedel * a0922b4 (1 files in 1 dirs): ipv6 cleanup - http://bit.ly/b3tuld
05:56 GitHub124 left #mojo
06:01 esskar moin
06:05 * sri puts a fresh can of coffee into the channel
06:05 a|newkirk[assoc] left #mojo
06:06 a|newkirk[assoc] joined #mojo
06:16 kvorg left #mojo
06:16 und3f[A] is now known as und3f
06:40 und3f is now known as und3f[A]
06:55 kvorg joined #mojo
06:57 mvuets joined #mojo
06:59 * mvuets waves
06:59 mvuets sri rocks! Hurray!
07:00 yakudza joined #mojo
07:01 marcus_ sri: morning
07:01 marcus_ sri: now that we've fixed the keepalive issue, it looks like we have a problem with leaking file handles
07:01 yakudza left #mojo
07:02 marcus_ sri: number of open files in our fastcgi client grows steadily until they are unable to serve static files and start 500ing
07:02 marcus_ in our fastcgi children even
07:03 mvuets Yes, inner_xml did the job. Thanks (:
07:03 * marcus_ greedily drinks sri's coffee
07:08 sri marcus_: find_cycle and fix
07:09 sri i've profiled recently though and didn't find anything
07:09 marcus_ the really strange thing is that we're releasing the whole client for each request
07:09 marcus_ sri: it's not leaking memory, only open fhs
07:10 sri those usually come in pairs
07:10 marcus_ trying to reproduce in my dev env atm
07:11 marcus_ I take it back
07:11 marcus_ looked at the graphs now, looks like we are leaking memory too.
07:11 sri i could only imagine that happen if you were using the ioloop singleton
07:12 sri and each client would not clean up their keep alive connections
07:14 sri well, as usual, if you can reproduce it i can fix it :)
07:14 marcus_ http://nordaaker.com/docs/skitch/Muni​n____startsiden.no____websap1.startsi​den.no____memory-20100923-091439.png
07:14 marcus_ sure. will track it down :)
07:16 ysyrota joined #mojo
07:17 sri and it started with the bugfix?
07:18 sri my first guess was that handles were left in the test IO::Poll instance, but i don't see how that could happen
07:19 marcus_ no, I'm not saying it started with the bugfix
07:19 marcus_ before the bug fix, it crashed before it could get this far
07:20 sri ah ok :)
07:24 koban left #mojo
07:25 tab joined #mojo
07:26 tab hi
07:26 * sri waves
07:26 tab is there a simple way to change the X-Mailer when sending mail through MojoX::Renderer::Mail?
07:28 mvuets How to serve a static file whithin M::Lite?
07:28 marcus_ sigh, not leaking on my dev env.
07:28 marcus_ maybe it's debian related
07:28 sri that would be strange
07:29 sri but actually wouldn't surprise me
07:29 sri who knows what they do to their perl
07:29 marcus_ filthy animals
07:29 sri *waves fist in anger at linux distributions*
07:30 sri shakes fist actually i guess
07:30 sri mvuets: mkdir public
07:30 mvuets I want to serve myself (:
07:31 sri tab: not sure mail should be sent with a renderer
07:31 mvuets Like vti did in his pastelious via /source
07:31 sri look at the source :)
07:32 tab sri: more exactly: i "use MojoX::Renderer::Mail;" and then register a handler in my startup
07:32 ltriant left #mojo
07:32 mvuets Thet does not work, that's why i'm asking.
07:32 sri tab: i'm afraid i know nothing about the mail renderer
07:32 tab okay
07:32 tab then i´ll have to go on searching
07:32 tab thanks
07:32 sri tab: or ask the author
07:33 sri should be easy if he's on github
07:35 sri mvuets: actually it should work
07:35 sri the root is simply the public directory
07:35 sri it's a relative path
07:36 mvuets Should such statement work? $self->render_static('/etc/passwd');
07:36 sri nope
07:36 mvuets Aha.
07:36 sri always relative
07:36 omega can you relative yourself out of the root?
07:36 sri otherwise we get poirtability problems
07:36 mvuets Security considerations?
07:36 sri you can
07:36 mvuets Ow, you're right.
07:37 sri serve_static is not idiot proof
07:37 sri only the normal static dispatcher forbids ../
07:37 omega ok
07:37 sri i'll update the pod
07:38 polvo sri, it's doesn't work for me. and it generates 404 error (!)
07:41 polvo sri, never mind, looks like the problem is my ISP using cache or something.
07:41 marcus_ wave your fist like you just don't care\ o/'
07:41 mvuets sri: still does not work ):
07:42 sri i'll add a test
07:42 sri but breakfast first ;p
07:44 esskar breakfast is for looooooooosers
07:44 mvuets http://paste.debian.net/91195/
07:58 marcus_ hmm
07:58 marcus_ our app is not leaking tcp connections
07:58 marcus_ it's leaking sockets
08:00 polvo sri, so, here is the problem. render_text('') doesn't return Content-Length:0 in a response, so the connection keeps open until a timeout.
08:01 marcus_ perl      28195     root  188u     sock                0,5                716061 can't identify protocol
08:04 marcus_ it leaks one of those for each mojo client request we do, it seems.
08:07 omega strace?
08:18 marcus_ http://pastie.textmate.org/p​rivate/bxbgdsc2q94kkeh4tc6a <- strace
08:23 omega I don't think thats complete?
08:29 sri polvo: broken client
08:29 polvo sri, curl, firefox, what else is broken? :)
08:29 sri it is spec compliant
08:30 crab what is?
08:30 omega marcus_: the only I can gather from that one, is that fd 38 is never closed, and that seems to be connection to WS?
08:30 sri no Content-Length if there's no body
08:30 tab left #mojo
08:31 sri Content-Length: 0 is not required by rfc2616
08:32 marcus_ omega: we will try to turn off keep-alive and see what happens
08:32 crab yes, it is.
08:32 omega marcus_: does it leak under the devserver? if so, could you strace from startup via request?
08:32 crab If no response body is included, the
08:32 crab response MUST include a Content-Length field with a field-value of
08:32 crab "0".
08:32 marcus_ omega: no, it didnt leak for me under the dev server
08:33 sri crab: section?
08:33 omega marcus_: but the devserver running on the debian machine?
08:33 omega like _server.pl?
08:33 crab er, wait. wrong section. moment.
08:33 sri :)
08:33 omega on the same physical server as prod
08:33 marcus_ omega: will try
08:35 marcus_ omega: without keepalive it's not leaking.
08:36 marcus_ guess we are using the singleton, and it keeps allocating new connections
08:37 polvo $c->render_text('Hello World', layout => 'green'); <- what is the 'layout'?
08:37 crab sri: section 4.3, "message body"
08:37 crab All 1xx
08:37 crab (informational), 204 (no content), and 304 (not modified) responses
08:37 crab MUST NOT include a message-body. All other responses do include a
08:37 crab message-body, although it MAY be of zero length.
08:38 crab may be of zero length => must be announced via content-length
08:38 omega marcus_: but withoug keepalive performance sucks and varnish fscks up?
08:38 crab sorry, i was just looking in the wrong place
08:38 marcus_ omega: have to disable varnish on the ws to disable keepalive
08:38 sri crab: that says nothing about Content-Length
08:38 omega marcus_: ahh
08:39 polvo sri, but it would be convenient to have this header ;)
08:40 marcus_ we'll try to disable keepalive in the mojo client instead
08:40 DaTa but what the rfc says, that we SHOULD provide a content-length if it's known :)
08:40 sri DaTa: still no requirement ;p
08:41 sri but yea, it might be convenient
08:42 sri changing all the tests won't be fun though
08:42 vti sri: but wasn't this stuff fixed long time ago?
08:42 sri we once supported Content-Length: 0...i still remember how annoying it was to remove
08:43 sri vti: "fixed"?
08:43 sri vti: where's the bug?
08:43 crab hmm
08:43 vti sri: real world bug, you know
08:43 sri not a bug
08:43 sri it could be a feature
08:43 sri but not a bug fix
08:43 omega In HTTP, it SHOULD be sent whenever the message's length can be determined prior to being transferred, unless this is prohibited by the rules in section 4.4.
08:44 sri SHOULD
08:44 sri thats no requirement
08:44 sri the real reason some user agents require Content-Length: 0 is broken servers
08:45 DaTa well: SHOULD   This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
08:45 vti burn him!
08:45 DaTa so, he full implications have to be understood first :)
08:45 sri you know how much bullshit is RECOMMENDED? :)
08:46 polvo it's different )
08:46 sri why?
08:46 sri just because some user agents are broken doesn't mean it's a bug
08:47 sri only that we could support it as a convenience feature
08:47 polvo sri, at least two UA-s are broken
08:47 sri i know
08:48 sri i'm not arguing against adding it
08:48 sri just about it being a bug
08:48 polvo wget is "broken" two, lol
08:49 polvo sri, btw, $c->render_text('Hello World', layout => 'green'); <- what is the 'layout'?
08:49 sri see guides
08:52 polvo sri, are you saying that i can use templates with render_text() ?
08:53 sri yes
08:53 sri the renderer doesn't care what to wrap in a layout
08:58 spleenjack joined #mojo
09:02 GitHub12 joined #mojo
09:02 GitHub12 mojo: master Sebastian Riedel * f629ebf (2 files in 2 dirs): added render_static test - http://bit.ly/dBZUOB
09:02 GitHub12 left #mojo
09:03 sri works flawless
09:03 marcus_ sri: looks like shit goes down if you start a keepalive connection and let the client go out of scope.
09:03 marcus_ sri: we're resolving it for now by setting Connection: close
09:03 sri marcus_: DESTROY doesn't get called?
09:04 marcus_ possibly.
09:04 marcus_ I'll try to write a small test.
09:04 sri that would be fatal indeed
09:07 jest joined #mojo
09:12 marcus_ seems destroy is being called.
09:12 marcus_ from my test script
09:12 sri i'll need a test case
09:12 sri that was my only guess
09:13 marcus_ yupp, I'll keep digging.
09:15 mvuets Weird!
09:16 mvuets shift->render_static('file') works if i put it to public, but '../file' does not
09:16 mvuets Any DEBUG envvar to examine it?
09:16 GitHub83 joined #mojo
09:16 GitHub83 mojo: master Sebastian Riedel * f7e099e (2 files in 2 dirs): readded Content-Length: 0 support - http://bit.ly/befV1A
09:16 GitHub83 left #mojo
09:17 sri mvuets: i just added test case for that, works flawless
09:17 mvuets Same here. But try real app.
09:17 sri Content-Length: 0 was much less painful than expected :)
09:17 mvuets Maybe it depends on how liteapp is envoked?
09:18 mvuets I run as ./app.pl daemon
09:18 sri that wouldn't make sense
09:18 koban joined #mojo
09:18 sri it always generates a path based on public
09:20 mvuets Ah, i got the reason.
09:20 perlrocks joined #mojo
09:20 mvuets As path is composed like this ".../public/../file", thus public must exist. Damn.
09:21 mvuets It's pity there is no warning kinda 'path not found' in mojo logs ):
09:24 crab left #mojo
09:28 GitHub62 joined #mojo
09:28 GitHub62 mojo: master Sebastian Riedel * 51d60e7 (1 files in 1 dirs): fixed small portability bug - http://bit.ly/b8CsBx
09:28 GitHub62 left #mojo
09:31 sri mvuets: that would trigger on every single request, due to static dispatching
09:56 mvuets sri: you mean logging?
09:56 sri ye
09:56 mvuets Aha, i found it too. No way to distinguish calls?
09:57 sri no
09:57 mvuets Maybe return "error string" instead of 1?
09:58 koban left #mojo
09:58 koban joined #mojo
09:59 sri oh wait
10:00 sri the true value is enough to throw an error in render_static
10:00 mvuets ...actually it won't help much as i must handle errors manually then.
10:01 mvuets (I confused 1 and undef ret. vals.)
10:01 mvuets What do you mean?
10:02 MojoGuest826 joined #mojo
10:02 MojoGuest826 From: http://news.ycombinator.com/item?id=1277067 (6 hits)
10:03 mvuets And i found one another problem with Mojo::DOM this night.
10:03 mvuets What charset is intended for?
10:03 sri ?
10:05 mvuets Charset attribute.
10:05 sri it's the charset
10:05 mvuets (: i'll give an example
10:06 mvuets I grabbed a page via Mojo::Client, parsed it via Mojo::DOM and composed another XML based on a fetched data.
10:07 sri you always have to normalize encodings yourself
10:07 mvuets All ->text and ->attrs{name} values were ok.
10:07 sri thats your responsibility
10:07 sri *all* actual xml is encoded
10:07 mvuets But ->to_xml (and new ->inner_xml) give double encoded strings.
10:07 sri no
10:08 sri they give xml
10:08 sri bytes
10:08 sri raw xml is encoded
10:09 mvuets Really?
10:09 sri text and attributes are parsed and extracted values in characters
10:09 mvuets If to_xml returns raw bytes, so why there is an encode call?
10:09 sri umm
10:09 mvuets Looks vice versa.
10:10 sri you might want to read up on perl unicode
10:10 sri i think you are misunderstanding something
10:10 mvuets encode is chars->bytes?
10:10 sri bytes are encoded
10:11 sri chars are decoded
10:11 mvuets Mojo::Client returns its body as bytes?
10:11 sri yes
10:12 sri thats why dom needs to know the charset to be able to parse
10:13 mvuets OK. DOM decodes it to chars and them in its tree.
10:13 mvuets ...and keep them...
10:14 sri until it is asked to generate xml again
10:14 sri then if a charset is still defined it will output bytes again
10:16 sri if you want chars you just set charset to undef
10:16 mvuets That's what i did (:
10:16 sri but you should really read up on perl unicode, it's very well worth understanding
10:17 sri i recently linked some very good slides
10:17 mvuets I do it each half of year (:
10:17 mvuets I guess i'm missing some point in Mojo, not in perl unicode.
10:18 sri http://www.slideshare.net/Penfold/perl-and-unicode
10:23 GitHub69 joined #mojo
10:23 GitHub69 mojo: master Sebastian Riedel * 4d4dcab (2 files in 2 dirs): log missing static files - http://bit.ly/97hD89
10:23 GitHub69 left #mojo
10:26 mvuets Nice fix (:
10:26 sri i like those little questions at the end of a debug message
10:27 mvuets They really help.
10:29 mvuets Seems i understood that problem.
10:29 sri http://zfsonlinux.org # oh cool
10:31 mvuets Templater expects chars, but i give him a bytes.
10:31 sri exactly
10:32 mvuets I missed a templater (: Good.
10:32 mvuets So a correct way is to set dom charset to undef?
10:33 sri if you want perl chars yes
10:33 mvuets Template wants them, so me too (:
10:34 perlrocks Twitter: "after having passed by the restructuring of catalyst in the middle of a project, revisiting, with eight feet behind the http://mojolicious.org ..." (pt) --pirolla http://twitter.com/pirolla/status/25295309912
10:35 mvuets How do you track twitter?
10:35 koban left #mojo
10:35 sri streaming api
10:35 sri i need to update the bot though, it crashes a lot :/
10:36 arpadszasz joined #mojo
10:36 mvuets May keynote export its slides to pdf?
10:37 omega keynote as in Keynote, the Apple product? if so, yes
10:38 mvuets omega: yep
10:38 mvuets Could anyone convert http://www.slideshare.net/Penfold/perl-and-unicode for me, please? [:
10:38 omega you don't have flash, or?
10:39 omega it requires me to login to download
10:39 mvuets I have, but wanna have it offline.
10:39 mvuets Just a moment.
10:40 omega if you put the keynote file somewhere I can put a pdf-version somewhere :)
10:40 mvuets In progress (:
10:40 mvuets http://ompldr.org/vNW1kNQ/perland​unicode-091106071846-phpapp02.key
10:44 omega missing some fonts, but you can prolly live with that? :)
10:46 omega mvuets: http://home.palle.net/~omega/perlandunicode.pdf in ETA 30sec
10:47 koban joined #mojo
10:53 omega mvuets: got it?
11:09 zakame hmm app->helper isn't in the cpan stable mojo yet, right?
11:10 sri right
11:10 zakame thanks
11:11 mvuets omega: got it! Thanks a lot!
11:12 zakame I wrote a render_xls helper for my plugin... though is there a way for me to make it so it looks like render( xls => $data_structure ); ?
11:13 sri nope, thats reserved for built in stuff
11:14 zakame ah, ok
11:14 zakame figured as much since text and json are in MojoX:Renderer :)
11:14 sri render(handler => 'xls') would work though
11:15 zakame yeah
11:16 forwardever joined #mojo
11:17 mvuets Is there some documention which describes application deploymetn?
11:32 arpadszasz left #mojo
11:37 vti mvuets: http://github.com/kraih/mojo/blob/mast​er/lib/Mojolicious/Guides/Cookbook.pod
11:41 mvuets vti: that's it.
11:53 doubi joined #mojo
11:55 esskar left #mojo
11:55 esskar joined #mojo
12:06 doubi Hello all. Can anyone point me to a worked example of designing an ACL-based auth system for a web app? Googling turns up a lot of stuff on filesystems, a lot of references to using CakePHP's ACLs, and generally not much of anything useful
12:06 mvuets --daemonize was removed?
12:06 mvuets Ou, it's on daemon_prefork only.
12:51 tempire esskar: Why MojoX::Authen instead of Mojolicious::Plugin::Authen ?
12:51 koban left #mojo
12:51 koban joined #mojo
12:52 esskar tempire: i do not want to call basic_auth everywhere; besides i want to also integrate authentication for the client (not only Basic (think about kerberos, oauth, ...)
12:58 esskar tempire: are cou ok with that?
12:59 Kulag joined #mojo
12:59 tempire fu'sho
12:59 tempire I only wanted to do basicauth
12:59 kvorg left #mojo
13:00 tempire I looked into doing digest, but it looked annoying, and I'd never use it anyway
13:00 esskar i actually ont see how you add in a large user-db behind it
13:00 esskar i actually dont see how you add in a large user-db behind it
13:00 tempire behind what?
13:01 esskar your basic_auth plugin
13:01 tempire the advanced usage
13:01 esskar ah
13:01 esskar ok :)
13:02 tempire I should probably put that at the top of the pod
13:05 tempire or just remove the simple usage like sri said in the first place :)
13:06 * tempire rebels
13:16 doubi left #mojo
13:17 memowe joined #mojo
13:17 sri digest is annoying as hell
13:18 sri maybe i should stop saying that...
13:18 sri or nobody will ever implement it -.-
13:25 su-bzero_ joined #mojo
13:26 su-bzero left #mojo
13:38 MojoGuest826 left #mojo
13:40 esskar tempire: http://github.com/esskar/mojox-authen/blo​b/master/lib/Mojolicious/Plugin/Authen.pm
13:40 esskar sri, done :)
13:40 esskar http://github.com/esskar/mojox-authen/blob​/master/lib/MojoX/Authen/Handler/Digest.pm
13:40 sri :O
13:41 sri there's a mistake though
13:41 sri $authorized needs to be store in the stash
13:41 sri there might be parallel requests
13:41 esskar ok
13:41 esskar i just added it
13:41 esskar and wasn sure
13:41 esskar ok, i change it
13:42 * mvuets ♥ Mojolicious
13:42 sri quite clean code
13:42 * sri likes
13:43 sri lol goto
13:43 esskar i know ;)
13:44 perlrocks Twitter: "It looks like this: i.imgur.com written in Perl-e and Mojolicious-e." (ru) --wdcyyzxpattyx http://twitter.com/wdcyyzx​pattyx/status/25308018419
13:44 sri i want to use just one goto somewhere in mojolicious too, just for the "WTF?" factor
13:44 esskar ;)
13:45 esskar i already implemented digest for catalyst (back in the days)
13:46 esskar pretty same code
13:46 sri ah
13:46 esskar just had to remove some flaws and added stale
13:46 esskar not sure if it is right implemented
13:46 esskar RFC is thin on that
13:47 sri you should add real lite_app tests
13:47 sri can't get a feel for the api yet
13:48 esskar ok
13:50 DaTa left #mojo
13:51 sri dunno about the approach
13:51 DaTa joined #mojo
13:51 sri i think rails has the best authentication system i've seen so far
13:53 DaTa left #mojo
13:53 sri an adaption of it for mojolicious would kinda look like $self->digest_auth(sub { my ($user, $pass) = @_; });
13:55 DaTa joined #mojo
13:56 sri usage could be something like return unless $self->digest_auth(sub { return $users->{$_[0]} eq $_[1] ? 1 : 0 });
13:56 sri and it would automatically render a authentication required response or redirect to a login form on false
13:59 sri esskar: in your approach the developer would manually send an authentication required right?
14:00 sri hmm, i'm unsure, maybe the automatic login approach is better
14:00 sri just checking authenticated_as has its advantages too
14:00 esskar sri: nope
14:00 esskar it is set in the handler
14:01 esskar authen->handle sets 401
14:01 esskar and all the headers
14:01 sri how would you deal with a mixed app?
14:01 esskar so far
14:01 esskar :)
14:01 sri half authentication required and half open
14:01 esskar i want to add a forbidden list
14:01 esskar or allowed
14:01 esskar depends
14:01 esskar in teh conf
14:01 esskar or
14:01 sri would that require typing the path?
14:02 esskar try mssing around with conditions
14:02 esskar authen => 1
14:02 sri right
14:02 sri that would be good
14:02 sri get '/foo' => (authen => 1) => sub {...};
14:02 esskar but i do nt really unserstand conditions yet
14:02 sri it's that simple in lite :)
14:03 esskar i know
14:03 esskar but i do not yet know how to use it here
14:03 sri the stash key thing takes a little getting used to
14:03 sri but it is perfect for this
14:03 esskar i tried before adding the hook
14:04 sri it runs at routes time before anything could happen
14:04 sri there is a recipe
14:04 sri in the routing guide
14:04 esskar i know, i know
14:04 esskar alreyd read it
14:04 esskar i think i had a rendered problem
14:04 sri let me know if i can help
14:04 esskar will give it a try soon
14:04 sri maybe a fixed bug
14:05 esskar i will (you should know that ;) )
14:05 sri rendering should work before routes now
14:05 esskar since?
14:05 sri few weeks
14:05 esskar ok
14:06 sri you simply don't have the routes captures in the stash
14:06 sri so no defaults
14:06 sri no names
14:06 sri if it doesn't work perfect just send me a failing test and i'll make it work :)
14:07 sri rendering before routes is an important feature for plugins
14:09 mvuets I wrote a lite app which converts one specific html to rss. I adore Mojo::DOM, Mojo::Client and Mojolicious::Lite! (:
14:09 sri \o/
14:09 mvuets Here it is if any: http://lab.maxim.vuets.name/juickhome2rss/src
14:10 esskar does anyone knows any matlab irc channels by any chance?
14:11 mvuets I wonder how @wdcyyzxpattyx found my post http://juick.com/mvuets/947652 /:
14:11 sri mvuets: neat example, put it on github (at least as a gist) :)
14:12 sri mvuets: but you should really indent those perl line in the template ;p
14:13 sri (you can with the github version)
14:13 sri whitespace before % just works
14:16 sri esskar: how come you tab indent?
14:16 esskar sri, what do you mean?
14:17 esskar ah; well, i like tabs
14:17 esskar but i use normally 4 spaces as a tab
14:17 DaTa left #mojo
14:17 esskar at least for displaying
14:18 sri http://github.com/esskar/mojox-authen/blo​b/master/lib/Mojolicious/Plugin/Authen.pm
14:18 sri the synopsis
14:18 esskar yes, my editor does it :(
14:18 esskar i admit
14:18 sri ah
14:19 sri as long as it's not on purpose :)
14:20 * vti writing cgi in c
14:20 sri oh my
14:21 vti bash was easier
14:22 esskar vti: http://www.cs.tut.fi/~jkorpela/forms/cgic.html
14:22 esskar :D
14:22 MojoGuest621 joined #mojo
14:22 MojoGuest621 From: http://www.google.com.uy/search?hl=es&amp;​client=firefox-a&amp;rls=org.mozilla%3Aen-​US%3Aofficial&amp;q=websocket+demo&amp;aq=​f&amp;aqi=g1&amp;aql=&amp;oq=&amp;gs_rfai= (1 hits)
14:22 MojoGuest621 hola
14:23 * sri waves
14:23 esskar MojoGuest621: back
14:23 MojoGuest621 left #mojo
14:26 vti there is nothing worse than a bad c code
14:27 sri bad assembler?
14:27 vti oh, forgot about that shit
14:49 mvuets sri: didn't get you about indention.
14:49 mvuets Add spaces before '% foreach (@$posts) {'?
14:58 sri mvuets: yes
14:58 sri "    % lalala"
14:58 sri "                 % yada"
15:06 koban left #mojo
15:11 spleenjack1 joined #mojo
15:11 forwardever left #mojo
15:15 spleenjack left #mojo
15:27 jeff joined #mojo
15:28 jeff I have $self->plugin(tt_renderer => { }); and Mojo is looking for .ep files... has anything changed recently, as it was looking for .tt templates up to this point
15:29 sri it always tries to detect templates
15:29 sri no matter what extension
15:31 sri you can mix and match ep, tt, epl, mason...whatever
15:31 jeff so that line $self->plugin(tt_renderer => {}); should work?
15:31 jeff and does it use the extension to determine which renderer to use?
15:31 sri if the documentation for that plugin says so
15:32 sri vti wrote most of it
15:32 sri and i am sure it has tests
15:33 sri that empty hash is useless i would imagine though
15:35 sri http://cpansearch.perl.org/src/ABH/​MojoX-Renderer-TT-0.40/t/lite_app.t # tests look really good
15:35 esskar http://www.heise.de/newsticker/meldung/Einmillion​ster-Commit-fuer-das-Apache-Projekt-1095321.html
15:35 esskar howmany commits does mojo have? ;)
15:37 sri 2216
15:37 esskar getting there
15:38 esskar only 500 years more
15:38 DaTa joined #mojo
15:38 esskar leaving home
15:38 esskar c u in a bit
16:04 ysyrota left #mojo
16:10 Foxcool joined #mojo
16:10 Foxcool left #mojo
16:11 GabrielVieira joined #mojo
16:19 crab joined #mojo
16:20 und3f[A] is now known as und3f
16:26 yakudza joined #mojo
16:26 jeff left #mojo
16:26 alnewkirk|com joined #mojo
16:28 a|newkirk[assoc] left #mojo
16:28 alnewkirk|com is now known as a|newkirk[assoc]
16:39 yakudza left #mojo
16:50 spleenjack1 left #mojo
16:58 GabrielVieira left #mojo
16:59 MojoGuest849 joined #mojo
16:59 MojoGuest849 From: http://www.google.com/search?​hl=en&amp;q=websockets%20demo (1 hits)
16:59 MojoGuest849 kk
16:59 MojoGuest849 left #mojo
16:59 MojoGuest226 joined #mojo
16:59 MojoGuest226 From: http://www.google.com/search?​hl=en&amp;q=websockets%20demo (2 hits)
16:59 MojoGuest226 left #mojo
17:07 GabrielVieira joined #mojo
17:19 snearch joined #mojo
17:45 yakudza joined #mojo
17:51 snearch left #mojo
17:54 esskar_ joined #mojo
17:54 ash_ joined #mojo
17:55 brunov joined #mojo
17:55 esskar_ re
17:58 esskar_ sri, in add_condition, what exactly are $captures
17:58 esskar_ i never got that
17:59 sri i thought the routing guide intro made that pretty clear
17:59 esskar_ wait
17:59 spleenjack joined #mojo
18:00 sri /user/show/23 -> /user/:action/:id -> {action => 'show', id => 23}
18:00 sri the hash are the captures
18:03 esskar_ and in my case, i only return that, if the guy is authorized or authen is set to 0 for example?
18:03 sri exactly
18:04 fod joined #mojo
18:04 sri hmm, actually i can change that to a true value i guess
18:05 esskar_ its fine
18:05 sri i'll change it ;p
18:05 sri simpler
18:06 esskar_ but i cant set that stash inside the condition, can i?
18:06 sri ?
18:07 sri "that stash"?
18:07 esskar_ the stash
18:07 sri you have $c, of course you can
18:07 sri but captures go to the stash too
18:07 esskar_ my ($route, $tx, $captures, $arg) = @_;
18:07 sri just in stages
18:07 sri $tx is $c in the github version
18:08 esskar_ ;)
18:08 esskar_ thats why
18:08 esskar_ now everything makes sense
18:16 GitHub97 joined #mojo
18:16 GitHub97 mojo: master Sebastian Riedel * 221fc7e (6 files in 5 dirs): simplify route conditions - http://bit.ly/anVgcP
18:16 GitHub97 left #mojo
18:17 sri done :)
18:27 arpadszasz joined #mojo
18:34 esskar_ left #mojo
18:37 MojoGuest200 joined #mojo
18:37 MojoGuest200 hi there
18:38 MojoGuest200 left #mojo
18:38 MojoGuest457 joined #mojo
18:39 MojoGuest457 left #mojo
18:40 arpadszasz left #mojo
19:02 esskar_ joined #mojo
19:10 yakudza left #mojo
19:13 marcus_ -/win 3
19:17 mvuets left #mojo
19:21 esskar_ sri: Mojo::Test->header_* not possible to use, i the header value one tests occurs more than once
19:21 esskar_ wait
19:27 sri what?
19:31 esskar_ $t->get_ok('/secret_garden')->status_i​s(401)->header_like('www-authenticate' => qr/Basic/)->header_like('www-authenticate' => qr/Digest/);
19:31 esskar_ 'ARRAY(0x338738c)' doesn't look much like a regex to me.
19:31 esskar_ dont get it
19:33 esskar_ do you have header_like in your tests somewhere?
19:34 sri lots
19:35 jest left #mojo
19:35 esskar_ it says
19:35 esskar_ not ok 5 - (?-xism:Basic)
19:36 esskar_ it gets the regex as the wrong parameter
19:36 esskar_ wtf
19:36 sri makes sense
19:36 esskar_ do you see it?
19:39 esskar_ you used it like ->header_like(Location => qr/\/foo\/bar\?foo=bar$/)
19:39 esskar_ i do not spot the difference
19:41 GitHub164 joined #mojo
19:41 GitHub164 mojo: master Sebastian Riedel * e4eb438 (3 files in 3 dirs): fixed a small Test::Mojo bug - http://bit.ly/bFf3mm
19:41 GitHub164 left #mojo
19:41 Rhaen_ joined #mojo
19:42 GitHub10 joined #mojo
19:42 GitHub10 mojo: master Sebastian Riedel * bdfc82d (1 files in 1 dirs): added test - http://bit.ly/bsj9fa
19:42 GitHub10 left #mojo
19:42 sri esskar_: fixed
19:45 esskar_ sri: bingo!
19:45 esskar_ thanks
19:46 Rhaen left #mojo
19:46 Rhaen_ is now known as Rhaen
19:52 MojoGuest580 joined #mojo
19:52 MojoGuest580 hey
19:52 MojoGuest580 test
19:53 und3f MojoGuest580, yo
20:08 esskar_ sri, another prob
20:09 esskar_ i have to routes
20:09 esskar_ get '/secret_garden' => (authen => 1) => 'secret_garden'; get '/not_secret_anymore' => (authen => 0) => 'everybody_welcome';
20:09 esskar_ s/to/2/
20:09 esskar_ accessing /not_secret_anymore
20:10 esskar_ still gives me an enabled parameter
20:10 esskar_ (authen => 0) does not get overwritten
20:11 esskar_ äh, (authen => 0) does not overwrite (authen => 1) from the prev route
20:11 esskar_ i changed the 1 to a 2
20:11 esskar_ and the 0 to 1
20:11 esskar_ not trace a bit
20:11 esskar_ 1 overwrites the 2
20:12 esskar_ probably just have to test with defined
20:16 arthas left #mojo
20:24 esskar_ sri: http://github.com/esskar/mojox-authen/commi​t/c0cea9f3a8a068a1466dfe6332e240774b9cbe39
20:25 esskar_ will add digest test later; i need to implement the client mechanism first
20:29 crab what does this thing do?
20:31 esskar_ crab: what thing?
20:31 esskar_ MojoX::Authen
20:31 crab your module, i meant (empty README). now reading pod.
20:32 esskar_ i'm lazy, i  know :)
20:32 crab this is meant for http auth?
20:32 esskar_ yes, basic and digest so far
20:32 esskar_ want to add other stuff to
20:32 esskar_ like openid, oauth and so on
20:33 esskar_ both for server and client side
20:33 crab hmm, so if i wanted i could define an authen scheme that uses a cookie and such?
20:34 esskar_ sure
20:34 esskar_ but the API is not stable i think
20:34 esskar_ do not know yet ;)
20:35 esskar_ just was bored at work today
20:53 a|newkirk[assoc] left #mojo
20:59 janus now lets see if ordering pizza as a foreigner in an apartment works out... :)
21:00 janus not anything in a walking distance, not even a bar or something
21:01 janus not speaking dutch yet isn't exactly helping either :P
21:14 tempire_ joined #mojo
21:14 tempire_ readme first!
21:15 tempire_ left #mojo
21:15 vti readme driven development
21:21 esskar_ pfffffffff
21:36 Alias_ joined #mojo
21:40 Alias__ left #mojo
21:58 kvorg joined #mojo
22:09 ltriant joined #mojo
22:20 marcus_ janus: where in the netherlands are you?
22:22 janus marcus_: amstelveen currently
22:22 janus more or less directly under amsterdam on the map
22:23 MojoGuest178 joined #mojo
22:23 MojoGuest178 left #mojo
22:27 spleenjack1 joined #mojo
22:29 MojoGuest580 left #mojo
22:30 spleenjack left #mojo
22:33 marcus_ fun?
22:37 janus i love amsterdam, so it has to be ;)
22:41 esskar_ any thoughts about $authen->authenticate interface: http://github.com/esskar/mojox-authen/commi​t/5bf854a875b166c359f43efa41b714768df7a799
22:44 spleenjack1 left #mojo
22:57 kvorg left #mojo
23:39 und3f is now known as und3f[A]

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary