The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-09-04

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

All times shown according to UTC.

Time Nick Message
00:03 pete I am going to a Python meetup tonight
00:03 pete feel so dirty
00:04 sri ewww
00:05 pete Sadly Bangkok.pm has few members, and they're bad at organizing meetupds
00:05 pete Where PyThailand has a gazillion members and a meetup gorup
00:17 GabrielVieira hey there.. there is a way my Plugin set the templates location to its templates? I'm trying to avoid names duplication with app templates and Plugin templates.
00:27 Averna joined #mojo
00:38 ElShaun Hey everyone! I'm trying to sort out SSL configuration.  According to Mojolicious::Guides::Cookbook I can "enable" SSL this way: $ ./script/myapp daemon -l https://[::]:3000
00:38 ElShaun Server available at https://[::]:3000. This seems to work... but how do I configure SSL to use my own certificate, cipher list, etc.  Can you point me in the right direction??
00:41 pete Isn't that something you want to set at the webserver level, rather than the app level?
00:43 * pete should stop giving advice before he knows what he's talkingabout
00:43 pete Still, though, presumably own certificate and so on are deployment-time problems, rather than for servers you're running with ./
00:45 pete I wonder if you can pass through 'https://*:443?cert=/etc/server.crt&key=/etc/server.key'
00:45 pete to -l
00:45 pete ElShaun: Worth trying
00:46 pete ElShaun: http://mojolicio.us/perldoc/Mojo/Server/Daemon#listen
00:46 pete ElShaun: allows a cipher list too
00:46 ElShaun Giving it a shot...
00:51 ElShaun It worked!  I had previously tried passing through 'https://*:3000?cert=/etc/server.crt&key=/etc/server.key' to -l but *without* the quotes and that was failing so thought i was on the wrong track.  Adding the quotes made all the difference -- thanks!
00:53 bodgix left #mojo
00:56 ElShaun As for http://mojolicio.us/perldoc/Mojo/Server/Daemon#listen -- not quite sure how to use this...
00:57 ElShaun I tried adding the line: my $daemon = Mojo::Server::Daemon->new(listen => ['https://*:3001']); near the beginning of my lite-app script but
00:57 ElShaun when I launched it using $./myscript daemon it still said listening on port 3000 and would not accept https connections on 3001.
00:58 GabrielV_ joined #mojo
01:02 ElShaun looks like i need $daemon->run; as well
01:04 ElShaun spoke too soon... *sigh*
01:04 good_news_everyon joined #mojo
01:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/32Yg-Q
01:04 good_news_everyon mojo/master bc6bae5 Sebastian Riedel: listen value needs to be quoted
01:04 good_news_everyon left #mojo
01:09 GabrielVieira joined #mojo
01:11 meshl joined #mojo
01:13 good_news_everyon joined #mojo
01:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/tzmlig
01:13 good_news_everyon mojo/master 0133e71 Sebastian Riedel: a few more server examples
01:13 good_news_everyon left #mojo
01:22 klapperl_ joined #mojo
01:30 woz joined #mojo
01:54 r0b3rt joined #mojo
02:00 woz joined #mojo
02:02 noganex joined #mojo
02:17 voegelas joined #mojo
02:26 Eke- joined #mojo
02:40 woz joined #mojo
02:45 zivester joined #mojo
03:50 sri fun fact, for a very short time the stash in catalyst was called trunk
03:50 sri no idea why i just remembered that :)
03:58 pete Fuckin' Catalyst. The `flash` almost killed me
03:58 pete I ended up writing plugins to fix it on two separate projects
04:01 r0b3rt left #mojo
04:04 sri i've just been taking a look at the code... after years of ignoring it... the quality is not great https://github.com/perl-catalyst/catalyst-runtime/blob/master/lib/Catalyst.pm#L1380
04:07 pete UTF8 was the other part I ended up writing a fair amount of custom code for
04:12 woz joined #mojo
05:04 jamesaxl joined #mojo
05:16 woz joined #mojo
05:20 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.06 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.06
05:28 davido_ joined #mojo
05:35 sivoais joined #mojo
05:46 preaction joined #mojo
05:52 dod joined #mojo
06:05 Vandal joined #mojo
06:06 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.07 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.07
06:07 Eke- joined #mojo
06:12 woz joined #mojo
06:19 Martin90 joined #mojo
06:24 tardisx joined #mojo
06:24 mr-foobar joined #mojo
06:24 tardisx joined #mojo
06:38 cpan_mojo Mojolicious-Plugin-ReverseProxy 0.2 by Tobias Oetiker - http://metacpan.org/release/OETIKER/Mojolicious-Plugin-ReverseProxy-0.2
06:38 mr-fooba_ joined #mojo
06:42 KCL_ joined #mojo
06:54 rawler joined #mojo
07:29 arthas joined #mojo
07:39 basiliscos joined #mojo
07:43 trone joined #mojo
07:51 batman oetiker: i made a pull request. as i said in the pr: "Please ignore or cherry-pick any of them." :)
07:52 dod joined #mojo
07:58 batman oetiker: maybe you could have a look at http://nginx.com/resources/admin-guide/reverse-proxy/ and http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers
07:58 arthas joined #mojo
07:58 zz_Foxcool joined #mojo
07:59 oetiker batman thanks!
07:59 batman your welcome. i'm interested in the module, but i haven't had time to actually look at how a reverse proxy is supposed to work :/
08:00 batman i think i might just start nginx one day and investigate which headers are changed with default config
08:00 batman unless you beat me to it :)
08:00 oetiker I have an actual application for it
08:00 oetiker I just pulled out the proxy functionality
08:00 oetiker so I do know it works like this ...
08:00 oetiker :)
08:01 batman my first impression is that you don't rewrite/set enough headers
08:01 batman but i could be wrong of course.
08:02 oetiker well
08:02 oetiker I don't do anything for security
08:02 batman exactly ;)
08:03 oetiker the 'interesting' bits are the two events
08:03 oetiker there the user is able to do all the security or other nasty stuff that is necessary
08:04 oetiker sri mentioned two headers that are problematic
08:04 irq joined #mojo
08:05 oetiker I thought that maybe there could be a default behavior regarding the headers which could be overwritten if the user so desires
08:06 oetiker it is going to be used as a frontend proxy to a zimbra server
08:07 oetiker the customer has an sso system where the current user is shown in a special X- header
08:07 oetiker and can change at any time
08:07 dod joined #mojo
08:07 oetiker since most modern webservices use cookies for auth, this is not ideal
08:07 batman you fail here: "the user is able to" the user is always an idiot.
08:07 batman you need to have good defaults or the user will screw up :(
08:08 oetiker hihi ... my world view on other peoples ability differs from yours, BUT I agree, good defaults re security would be great ...  patches highly appreciated
08:09 batman oetiker: i used to think like you do. i still screw up all the time, but at least i strive to have good defaults
08:09 batman marcus++ # he has taught me a lot about that. (the hard way)
08:09 oetiker batman: re your patch
08:09 batman oetiker: i will send you a new PR if/when i have time to investigate the headers
08:10 fhelmber_ joined #mojo
08:10 oetiker can't I load the the plugin multiple times ?
08:10 batman sure
08:10 batman (i don't follow though)
08:10 oetiker then the hooks would have to be namespaced
08:10 oetiker with the $helper_name or something
08:10 batman yeah, i was thinking about s/everse_proxy/$helper_name/
08:11 batman in the hook names ^
08:11 batman +1
08:11 purl 1
08:11 batman hehe
08:11 oetiker that would be good
08:12 batman i'm not going to do it though... i was not expecting the PR to me merged, i was just trying to give you some inspiration in the form of actual code :)
08:13 batman i'm also not sure if it's a good idea to use the $app events in a plugin.
08:13 batman sri: what do you think about my abuse of $app hooks here: https://github.com/jhthorsen/mojolicious-plugin-reverseproxy/commit/0b294584a927f34dc8868a9a3aeae4ed1978d383
08:14 batman oh crap! i lost track of time...
08:14 * batman have to run
08:24 oetiker batman ok
08:25 oetiker batman: lets see what sri sais
08:35 john joined #mojo
08:43 edestler joined #mojo
08:45 geira joined #mojo
09:01 john Morning all
09:01 purl morning, john
09:01 john Given that requests: /allcustomers, /somecustomers, /allcustomers/23, /somecustomers/45 all end up in my action method: customer
09:01 john and from that page they can then go to a detail page, how might I build the link to take them back?
09:04 john Also, it might not be back one step, ie the detail page could go to another and have a bread crumb trail on each page
09:18 mtths joined #mojo
09:21 zz_Foxcool joined #mojo
09:28 punter joined #mojo
09:44 dp_ joined #mojo
09:46 john The answer being I need to pass the current route as part of the request
09:46 denis_boyun joined #mojo
09:48 john then use url_for(route)
09:49 D4RK-PH0ENiX joined #mojo
09:49 dod joined #mojo
09:52 woz joined #mojo
10:07 laouji joined #mojo
10:22 Martin90 joined #mojo
10:23 Martin90 Can you explain two last lines of this http://scsys.co.uk:8002/421258
10:23 Martin90 what is "=>index" after sub and when it is call
10:24 Martin90 I bet it call template but this sction isn't documented
10:24 Martin90 action*
10:32 moritz Martin90: it's the name of the route
10:32 moritz Martin90: and it can be used in link_to (for example)
10:33 Martin90 so => 'index' call another route ?
10:34 Martin90 like get '/index' ?
10:36 Martin90 what about line above " $c->redirect_to('protected');" it look like =>index never happen because of this redirect ?
10:37 moritz what do you mean by "never happen"?
10:37 moritz the code will be executed.
10:38 john How can I get the name of a route for a given URL?
10:38 john ie the opposite of url_for
10:39 john what I want is the name of the route for the referrer
10:40 * moritz has no idea
10:40 Martin90 Do I understand it correctly: When request comes in to get '/' first sub is executed end then => action in code like this :
10:40 Martin90 get '/' => sub {stuff here} =>action;
10:40 Martin90 right ?
10:41 Martin90 and action is call with returned value from sub ?
10:41 moritz well, not "first sub", but actually sub whose route spec matches the request URL
10:42 moritz and I don't know what you mean by "then => action"
10:42 Martin90 like order in : get '/' => sub {stuff here} =>action;
10:42 moritz no
10:42 moritz => action is not executed
10:42 moritz it's just a name
10:43 Martin90 name of method ?
10:48 Martin90 In case of templates if I have $c->render('index',title => 'Ajax test page ;)'); How in template access title ? Neither <% title or $tile  %> work ?
10:48 Martin90 $title*
10:51 woz joined #mojo
10:57 d4rkie joined #mojo
11:00 meshl joined #mojo
11:03 woz joined #mojo
11:04 meshl joined #mojo
11:10 Martin90 solved
11:15 neilhwatson joined #mojo
11:20 Guest joined #mojo
11:29 noganex are there any more blogs on mojo like blog.kraih.com and blogs.perl.org?
11:34 woz joined #mojo
11:38 dod joined #mojo
11:58 jberger A trailing string argument to a route definition is the route's name
11:59 jberger If at the end of the controller action (or lite callback) nothing has been rendered, then it will try to render a template of the same name
12:00 jberger So get( '/' => 'index' ) will attempt to render index.html.ep
12:00 jberger Since nothing else has been rendered
12:05 cpan_mojo Mojolicious-Plugin-BootstrapHelpers 0.011 by CSSON - http://metacpan.org/release/CSSON/Mojolicious-Plugin-BootstrapHelpers-0.011
12:07 Dandre joined #mojo
12:14 lipizzan joined #mojo
12:17 cpan_mojo Mojolicious-Plugin-NYTProf 0.08 by Lee Johnson - http://metacpan.org/release/LEEJO/Mojolicious-Plugin-NYTProf-0.08
12:29 cpan_mojo Test-Mojo-Most 0.02 by Lee Johnson - http://metacpan.org/release/LEEJO/Test-Mojo-Most-0.02
12:33 cpan_mojo Test-Mojo-Most 0.03 by Lee Johnson - http://metacpan.org/release/LEEJO/Test-Mojo-Most-0.03
12:34 Lee ahem...
12:35 woz joined #mojo
12:45 cpan_mojo Test-Mojo-Most 0.04 by Lee Johnson - http://metacpan.org/release/LEEJO/Test-Mojo-Most-0.04
12:47 rwf noganex perlr.com
12:47 noganex thanks rwf
12:53 ryozi joined #mojo
12:55 Tiger joined #mojo
13:17 zivester joined #mojo
13:19 nnac joined #mojo
13:36 woz joined #mojo
14:08 genio joined #mojo
14:08 dod joined #mojo
14:17 sh4 joined #mojo
14:23 oetiker https://github.com/oetiker/qx-mojo-app an web-app generator for mojo
14:39 woz joined #mojo
14:47 cpan_mojo Test-Mojo-Trim 0.04 by CSSON - http://metacpan.org/release/CSSON/Test-Mojo-Trim-0.04
15:05 mgrimes Is it possible to have a Minion worker app, add a job to the job queue every x minutes?
15:05 mgrimes I tried adding a Mojo::IOLoop->recurring event, but it never runs.
15:07 mr-foobar joined #mojo
15:10 noganex well... it seems $r->get('/foo/:name/on')->to('foo#on') doesn't work because of the name 'on'. a warning would have been nice... ;)
15:26 jamesaxl joined #mojo
15:32 meshl joined #mojo
15:35 bd i use my $config = $self->plugin('Config' ... in my $app to slurp in config options. however when testing i want to pass the plugin another file. how do i do that.
15:36 jamesaxl joined #mojo
15:42 woz joined #mojo
15:57 meshl joined #mojo
15:59 denis_boyun joined #mojo
16:22 davido_ joined #mojo
16:38 dod joined #mojo
16:42 denis_boyun_ joined #mojo
16:43 woz joined #mojo
16:43 preaction joined #mojo
16:46 denis_boyun joined #mojo
16:49 denis_boyun__ joined #mojo
17:01 sri noganex: yea, if only this was explained in the documentation... http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Optional-placeholders
17:02 irq joined #mojo
17:13 Akron joined #mojo
17:19 Ptolemarch joined #mojo
17:44 woz joined #mojo
17:45 disputin joined #mojo
17:52 berov joined #mojo
18:14 ua joined #mojo
18:18 sri mgrimes: just make a job that adds itself again
18:18 basiliscos joined #mojo
18:20 mgrimes thanks sri. is there a way to delay without blocking other jobs?
18:32 axlrose joined #mojo
18:34 logioniz joined #mojo
18:35 ElShaun Hey everyone! this morning I'm playing with Mojolicious::Command::get... thoughts on why $./login-demo get -v -M post -c 'username=fred&password=flintstone' '/login' fails to authenticate but $./login-demo get -v -M post '/login?username=fred&password=flintstone' works just fine?
18:42 sri content type
18:42 purl rumour has it content type is defined by server, not client
18:42 KCL joined #mojo
18:44 mgrimes nevermind, i just saw the delay option.
18:44 sri :)
18:46 cpan_mojo Test-Mojo-Trim 0.05 by CSSON - http://metacpan.org/release/CSSON/Test-Mojo-Trim-0.05
18:46 ElShaun content type?  not following...
18:47 woz joined #mojo
18:48 disputin joined #mojo
18:48 logioniz Hi, i want to know what i must to do in this topic to make it more clear.
18:48 logioniz https://groups.google.com/forum/#!topic/mojolicious/OwrPE5UBgaw
18:49 logioniz This example in func1 or in func2 stop. One of the steps in delay not call.
18:49 logioniz I think that i use incorrect delay. May be another problem.
18:49 logioniz But this code work fine when i run it NOT under test.
18:58 Eke- joined #mojo
19:01 davido_ joined #mojo
19:02 sri haha, so markdowngate is a thing now https://twitter.com/markdown/status/507341395137658880
19:03 ElShaun should it be like this?  still not working... how do I encode the carriage returns?  ./login-demo get -v -M post -c "Content-Type: application/x-www-form-urlencoded\nContent-Length: 33\n\nusername=fred&password=flintstone" '/login'
19:13 * berov is planning to create Mojolicious::Plugin::SemanticUI https://github.com/Semantic-Org/Semantic-UI/issues/691
19:14 woz joined #mojo
19:14 berov It would provide helpers in $c->semantic_ui namespace
19:16 berov I wonder what would be the best approach to implement the helpers?
19:17 berov one way would be to put the HTML in inlined templates in /partials/semantic_ui/helper_name.html.ep
19:19 berov this way the programmer using the module can just inflate the templates and customize them
19:19 berov any ideas?
19:28 Eke- joined #mojo
19:28 Ptolemarch joined #mojo
19:59 Ptolemarch joined #mojo
20:17 logioniz thanks
20:29 Akron berov: I think this is more a TagHelpers thing, right?
20:30 berov yes
20:32 berov will generate tags similar to Mojolicious::Plugin::BootstrapHelpers
20:32 sri Bender: trust Akron
20:32 Bender But I don't trust you in #mojo, sri
20:32 sri :O
20:33 Akron berov: In that way, I would expect something like <%= sui_menu @params, begin %>...<% end %> or similar (don't know semanticUI) instead of templates.
20:34 Akron berov: Yes.
20:34 berov Akron: Yes
20:35 berov I would like to bot have good performence and make it flexible(customisable by the programmer)
20:36 berov as explained above make it possible the component templates to be customised per project/application
20:36 berov bot->both
20:37 berov http://beta.semantic-ui.com/
20:39 Akron Ah, I see.
20:41 voegelas joined #mojo
20:45 berov Akron: may be simple templates in __DATA__ with just the needed html per element is the best compromise ?
20:46 berov I mean flexibility<>performance
20:51 berov sri: the _warmup in Mojolicious::Static helps - right?
20:51 berov or it does somenting else?
20:53 berov ops it is ./lib/Mojolicious/Renderer.pm:240 actually
20:53 Akron berov: For ease of development it's better to define the templates in a special folder, added to the template path in your plugin.
20:54 berov well yes
20:55 berov and use something like lib/My/Plugin/files/templates/partials/semantic_ui ?
20:56 Akron Yepp - sounds good.
20:56 Akron You may want to mix taghelpers with these templates probably.
20:57 berov yes, but only if i really have to
20:58 Akron Sure.
21:00 cpan_mojo Mojolicious-Plugin-BootstrapHelpers 0.012 by CSSON - http://metacpan.org/release/CSSON/Mojolicious-Plugin-BootstrapHelpers-0.012
21:00 berov Really having template files is easier wile developing than using __DATA__ , thanks for the advice
21:01 Akron :)
21:03 berov BootstrapHelpers just uses concatenated strings - this may be faster
21:04 berov but does not allows me to change per app the output of the helper
21:10 trone joined #mojo
21:14 lipizzan joined #mojo
21:17 woz joined #mojo
21:18 disputin joined #mojo
21:23 Ptolemarch joined #mojo
21:23 Ptolemarch joined #mojo
21:24 disputin joined #mojo
21:27 * berov created channel #ado for discussing https://metacpan.org/release/Ado
21:48 woz joined #mojo
22:00 jamesaxl joined #mojo
22:10 bodgix joined #mojo
22:13 jamesaxl joined #mojo
22:24 disputin joined #mojo
22:27 woz joined #mojo
22:31 Ptolemarch joined #mojo
22:44 sri \(._.\)
22:44 sri ƪ(‘-’ ƪ)
22:44 sri (ʃ ‘-’)ʃ
22:44 sri (/._.)/
22:45 disputin joined #mojo
22:48 disputin joined #mojo
22:55 meshl joined #mojo
22:59 woz joined #mojo
23:05 GabrielV_ joined #mojo
23:25 Ptolemarch joined #mojo
23:32 abhishekisnot joined #mojo
23:40 * jberger calls the Ghost Busters
23:43 jberger I'm getting a fair number of retweets of this one lately: https://twitter.com/joelaberger/status/487994943592357888
23:43 jberger Anyone know why?
23:59 woz joined #mojo

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