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

IRC log for #mojo, 2016-08-05

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

All times shown according to UTC.

Time Nick Message
00:41 zivester joined #mojo
00:41 jberger I'm assuming that WSL has real pipes
00:42 jberger And yeah that optimization is probably not worth much
00:43 jberger It is mostly historical in that i had the non windows one at first and then the windows one bit someone
00:43 jberger So i added the other code as a crutch
00:43 jberger Probably meh
00:44 jberger Then again i wonder if that limitation affects WSL
01:10 itaipu joined #mojo
02:00 ningu joined #mojo
02:30 noganex joined #mojo
03:17 karjala Can systemd fully replace Ubic?
03:59 inokenty-w joined #mojo
05:05 sri jberger: it does, hypnotoad uses pipes after all and works ;)
05:28 che-quest joined #mojo
05:34 Kripton joined #mojo
05:53 Kripton joined #mojo
06:02 mbudde joined #mojo
06:10 Kripton joined #mojo
06:56 Vandal joined #mojo
07:20 trone joined #mojo
07:29 osfabibisi joined #mojo
08:04 Eichberg joined #mojo
08:05 Eichberg exit
08:05 Eichberg joined #mojo
08:11 abra joined #mojo
08:19 sugar joined #mojo
08:26 che-quest joined #mojo
08:33 marcus :'(
09:10 kid51 joined #mojo
09:26 kid511 joined #mojo
09:58 nic oh
09:58 nic my
09:58 nic goodness
09:58 nic what have i done now?
09:59 mishanti1 I have no idea.
09:59 nic if you're ready for a giggle...  in a template I have   "% c->app->log->debug(....)"
10:00 nic the humour is the error I've tripped....     Can't locate object method "app" via package "Mojo::Collection" at ...
10:00 mishanti1 O_o
10:02 nic I swear, there is no use of ojo.pm anywhere in this project :/
10:07 nic hm, it's not ojo [just disabled ojo.pm] so what else could define 'c'?
10:08 ksmadsen nic: It's one of the default helpers: http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#c
10:08 nic oh, didn't realise Mojo::Collection defines it
10:11 nic oh bizarre, has it always been Collection?  I thought I used this a few days ago (v6.66) to be controller, but it seems I must be mistaken
10:12 anparker for controller you can use $c in templates
10:13 meshl joined #mojo
10:14 nic yeah, just found the same thing
10:14 nic Was using a function when it was a variable I needed
10:52 kaare joined #mojo
10:57 tchaves joined #mojo
11:03 cuechan joined #mojo
12:03 kes joined #mojo
12:05 kes Hi. When I do $self->render( json => $data ); and $data is object I get 'Obj::Type=HASH{...}'. Why mojo does not travel object keys as it does for hash?
12:06 kes how turn $data into hash?
12:08 AirDisa joined #mojo
12:11 kes on this page: http://mojolicious.org/perldoc/JSON/PP broken link: http://mojolicious.org/perldoc/convert_blessed
12:13 pink_mist get your object to provide a TO_JSON method
12:13 anparker > will try to call the TO_JSON method on blessed references, or stringify them if it doesn't exist
12:14 pink_mist sub TO_JSON { +{ %( shift ) } }
12:14 pink_mist # untested
12:15 pink_mist possibly the inner () should be {}
12:16 pink_mist *probably
12:16 pink_mist and then shift would need to be shift()
12:18 anparker $self->render(json => { %$data }) should work too. if you can't add method to class
12:22 kes But may I set 'allow_blessed' globally for mojoapp?
12:22 kes If no TO_JSON method is found, the value of allow_blessed will decide what to do.
12:25 anparker https://metacpan.org/source/SRI/Mojolicious-7.01/lib/Mojo/JSON.pm#L242-245 - looks like you can't
12:26 kes How about this? https://metacpan.org/source/SRI/Mojolicious-7.01/lib/Mojo/JSON.pm#L233
12:28 kes strange it checks 'HASH' but subroutine called _encode_object
12:29 kes it is ambiguous ( Seems it should be renamed to _encode_hash
12:30 anparker I think it's because perl hashes encoded into js objects
12:31 kes suggest here https://metacpan.org/source/SRI/Mojolicious-7.01/lib/Mojo/JSON.pm#L230 should be Scalar::Util::reftype instead of 'ref'
12:33 jkline joined #mojo
12:34 kes thank you anparker. I will use { %$data }
12:34 gizmomathboy joined #mojo
12:36 gizmomathboy joined #mojo
12:43 neilhwatson joined #mojo
12:53 zivester joined #mojo
13:36 marty joined #mojo
13:37 marty_ joined #mojo
13:38 FROGGS joined #mojo
13:38 FROGGS hi, I've got a problem....
13:38 FROGGS I want to use client certificates but my mojolicious (non-lite) server does not request one
13:39 marty joined #mojo
13:39 FROGGS how do I tell mojolicious to do a client certificate request?
13:39 FROGGS there is this: http://search.cpan.org/~tempire/Mojolicious-Plugin-SslAuth-0.08/README.pod
13:40 FROGGS but still, the client does not know that the mojo server wants a client cert
13:41 cainetighe joined #mojo
13:43 FROGGS I guess I want to set SSL_verify_mode, but I dunno how
13:43 ptolemarch joined #mojo
13:43 cainetighe Hey! I have a big web app backend broken up into many microservices. Right now we're using start_server, startman, PSGI, and an process model. I'm interested in trying async, and Mojo seems pretty nice. I am going to convert one of the microservices, and am looking for advice.
13:44 cainetighe At the moment, the top question coming to mind is whether or not I should continue to use PSGI.
13:45 cainetighe Or I should embrace something else, in an effort to really give Mojo a try.
13:45 dantti_laptop|2 joined #mojo
13:51 pink_mist I'd suggest using hypnotoad and perhaps doing a reverse proxy to that from your frontend
13:51 pink_mist hypnotoad is the mojolicious production server
13:53 cainetighe Yeah, that's what I was thinking about using.
13:53 cainetighe We have nginx in front of everything. That's responsible for the routing as well.
13:53 cainetighe That's where things break down in my head a bit with Mojo.
13:53 cainetighe nginx points to unix sockets to pass FCGI
13:54 cainetighe That's really what I'm looking for: The best way to allow nginx to pass fcgi to the mojo perl backend.
13:54 sri FROGGS: http://mojolicious.org/perldoc/Mojo/Server/Daemon#listen
13:54 nic cainetighe: look at examples for nginx in the wiki
13:55 cainetighe nic: ah, derp. I didn't see that page.
13:55 cainetighe been looking at the tutorials / guides
13:55 FROGGS sri: yeah, just found it a minute ago...
13:55 nic you didn't do wrong, just turns out there's more :)
13:57 sri cainetighe: http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Nginx
13:57 pink_mist cainetighe: best imo is to use a reverse proxy than to fiddle with fcgi/psgi for mojo
13:57 cainetighe pink_mist: you mean instead of fastcgi pases, do a full http proxy
13:57 cainetighe to the mojo backend / server
13:58 pink_mist yes
13:58 cainetighe yup - makes sense
13:58 cainetighe alright, thanks everyoen!
13:59 cainetighe Curious to see how it works out.
14:01 FROGGS sri: \o/
14:01 FROGGS sri: morbo script/foo https://*:3000?verify=3 # does something!
14:02 FROGGS sri: though, the links you posted indicates that 3 is the default, which can't be true, right?
14:02 FROGGS link*
14:07 sugar joined #mojo
14:07 lluad joined #mojo
14:08 FROGGS uhh
14:08 FROGGS verify=5 seems to do the trick
14:08 FROGGS this would be SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE btw
14:08 good_news_everyon joined #mojo
14:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6YWa
14:08 good_news_everyon mojo/master 039a827 Sebastian Riedel: mention both verification modes
14:08 good_news_everyon left #mojo
14:09 sri yes, there was something missing
14:09 FROGGS awesome
15:03 itaipu joined #mojo
15:28 disputin joined #mojo
16:04 Kripton joined #mojo
16:05 cuechan joined #mojo
16:19 Janos joined #mojo
16:33 zivester joined #mojo
16:57 FROGGS joined #mojo
17:29 xdg joined #mojo
17:32 purl joined #mojo
17:34 purl joined #mojo
17:41 purl joined #mojo
17:59 bwf Is releasing an alternative to Minion::Command::minion::job ok?  Alternative module seems better than updating core module and could be useful for those that like the command line option instead of waiting for the web gui.
18:00 jberger bwf: what does your command do?
18:05 purl joined #mojo
18:11 purl joined #mojo
18:12 bwf joined #mojo
18:13 bwf https://gist.github.com/bfaist/b3c5dbb67d6af42e53372ab55936e0cc
18:14 bwf Would be same as current "job" command but change output slightly.
18:16 jberger you just are trying to get the last 5 jobs?
18:16 jberger pipe to head
18:18 bwf That's just an example.  The time stamps have been added to the list of jobs which are not normally there.
18:20 jberger so generally yes, I think the minion command namespace is generally open subject to the same guidelines that we've set about the Mojo(licious)? namespaces
18:20 jberger namely don't pick things we might need/want in core
18:21 jberger I could also propose someone create a "contrib" subcommand namespace
18:21 jberger which would be even safer
18:21 jberger gets a little verbose though
18:21 jberger ./myapp minion contrib jobx 12
18:23 purl joined #mojo
18:24 bwf I thought "jobx" since it would not conflict with any future core commands and it is short to type as well.
18:24 bwf Thanks
18:24 jberger let's wait to see if sri has an opinion on naming
18:24 jberger jobx is probably safe
18:25 jberger I'm more curious about the precedent
18:25 * sri shrugs
18:26 jberger bwf I kinda feel like that is a fairly minor change to be releasing as its own module
18:26 jberger can I offer a suggestion?
18:27 bwf sure
18:27 jberger a config value in your for that specifies the format of the output
18:27 jberger '%{id} %{created} %{finished}' etc
18:28 jberger errr s/for/app/
18:28 jberger (I'm even at my keyboard, that was just a pure brainfart)
18:28 jberger and of course the default format could be the format you want :P
18:28 jberger that's your prerogative as the author
18:28 bwf good idea.  I will try that.
18:29 jberger of course you could also pass in the format on the command line, but as I did for the ACME module, things that you are likely to always want for your own app it is easier to set them once and be done with it
18:29 jberger so use the config
18:30 sri i'm not even opposed to having other time formats in the core job command, but i just don't know how to add it
18:30 jberger I think bwf is saying that in the cli job list there aren't datetimes at all
18:31 sri they are in epoch format
18:32 bwf For job_info(), I display localtime($job_info->{started}), etc to get a readable timestamp.
18:32 sri it basically shows the raw return value of the job_info and worker_info methods passed through Data::Dumper
18:35 sri i like that it just works with all backends, even if they don't support certain features or add new ones
18:35 sri bwf's job command would be in trouble if a backend didn't support delayed timestamps for example
18:35 sri (i know, not a great example)
18:37 jberger we have another urgent problem to deal with, do we allow/invite purl back?
18:37 jberger not sure purl is quite in line with the Code of Conduct :s
18:38 cfedde who is running purl now?
18:38 sri that's a tough one
18:38 jberger cfedde: sungo et al I think
18:38 jberger basically MagNet
18:39 cfedde leave her over in #perl there
18:39 cfedde that's the slackers channel anyway.
18:39 jberger I've always avoided idling in there if only because it was too much to read
18:39 jberger but maybe its time
18:40 cfedde only you can decide that.
18:41 cfedde atleast it has become lest hostile.
18:41 * sri decides jberger has to join #perl
18:42 * cfedde decides to go rtFm
18:42 disputin joined #mojo
18:43 sri jberger: ironically i believe purl might also be breaking a few rules here http://www.irc.perl.org/rules.html
18:44 jberger probably
18:44 * jberger sets cfedde on fire
18:44 sri specifically the harassing behavior section
18:46 sri i suppose it could be argued that the person asking purl something becomes responsible for the response... then it would basically be a ban lottery ;p
18:49 sri btw. i'm still liking irccloud
18:49 sri funny thing, the android app even has a setting to change the blinking led color :)
18:50 cfedde what? a reasonable irc client on a phone?
18:51 * jberger notes that purl actually snuck in here
18:51 sri reasonable irc client (as a service) in general
18:51 jberger purl: o/
18:51 purl happy te see me? *blush*
18:51 jberger should we ask perigrin to remove her?
18:51 sri purl: i'll be watching you
18:51 purl sri: sorry...
18:51 * jberger has been using a fairly reasonable phone irc "app" for years now
18:52 * jberger hugs convos
19:30 purl joined #mojo
19:32 purl joined #mojo
19:43 bwf_ joined #mojo
19:57 cuechan_ joined #mojo
20:29 purl joined #mojo
20:37 cuechan_ joined #mojo
21:00 purl joined #mojo
21:01 * sri learned this week that recruiters really really love skype
21:07 jberger sri: really odd case
21:07 sri oh, a real analysis of the linux subsystem for windows https://github.com/ionescu007/lxss
21:08 jberger if we accidentally have a url like "http://1.2.3.4\n:3000/my/path"
21:08 * sri runs and hides
21:08 jberger the request actually gets through
21:08 jberger but the content length is wrong
21:08 jberger and so the end of the message is truncated
21:08 jberger clearly the url is wrong
21:08 jberger but it does make me wonder why it doesn't have the content length figured out correctly
21:11 sri jberger: Can't resolve: nodename nor servname provided, or not known
21:11 jberger see that's what I get when I tried to make a minimal test case
21:11 jberger and yet we have a full case that is working
21:12 sri lol
21:12 jberger the request gets all the way through
21:12 jberger but the end } is clipped off the json and so the json decode fails
21:13 jberger it really is a ridiculous problem to have
21:13 sri my first thought would be broken headers due to the newline
21:14 jberger I notice that the box that is making the request doesnt' have IO::Socket::SSL
21:15 jberger I wonder if IO::Socket::IP fixes up the connect enough to work
21:15 jberger while ::SSL doesn't
21:29 marty joined #mojo
21:30 marty_ joined #mojo
21:54 jberger sri: is whitespace valid in a hostname?
21:54 jberger specifically \n?
22:05 anparker nope. only characters from [a-z0-9-]
22:07 jberger so if the regex that parsed the url refused to accept a host with whitespace in it then it certainly couldn't have made this request
23:27 disputin joined #mojo
23:41 Phil21 sri: have most of the stuff done on the OSS cab here, networking components at least
23:41 Phil21 found a couple older dell R710s that should make decent machines
23:52 sri found between the couch cushions at servercentral? :D
23:58 preaction i mean, it's a room, but there is a couch in it

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