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

IRC log for #mojo, 2017-04-18

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

All times shown according to UTC.

Time Nick Message
00:48 Lee joined #mojo
01:48 tchaves joined #mojo
02:16 noganex joined #mojo
04:04 dboehmer_ joined #mojo
04:17 bc547 joined #mojo
06:27 karjala_ joined #mojo
06:32 inokenty-w joined #mojo
06:32 Vandal joined #mojo
06:34 ashimema joined #mojo
06:51 AndrewIsh joined #mojo
06:57 ribasushi jberger: I am a tad confused...
06:57 ribasushi my understanding was you want to trap and react to the warning
06:58 ribasushi because if you just want it silenced - setting client_min_messages on the connection is the correct thing to do, as it will prevent the server from emitting anything for your session in the first place
06:58 ribasushi what am I missing?
07:16 trone joined #mojo
07:50 osfabibisi joined #mojo
07:51 dod joined #mojo
07:56 dod joined #mojo
08:01 stryx` joined #mojo
08:42 prg joined #mojo
08:44 rshadow joined #mojo
08:53 Mike_PM joined #mojo
10:00 dod joined #mojo
10:00 gregf_ joined #mojo
10:19 dotan_convos joined #mojo
10:22 nwani joined #mojo
10:24 nwani The formatting for this is weird: https://github.com/kraih/mojo/wiki/Projects-and-Companies-using-Mojolicious
10:53 dotan_convos joined #mojo
10:53 stryx` joined #mojo
11:06 sri it's a wiki, feel free to fix it ;)
11:08 new_student sri: I have this silly query, maybe it is ducumented somewhere, but what's your stance on a deployment of mojo v/s mojo behind nginx
11:20 new_student For some weird reason github wasn't rendering Pod format. So I converted it to Markdown: https://github.com/kraih/mojo/wiki/Projects-and-Companies-using-Mojolicious
11:21 tchaves joined #mojo
11:48 karjala_ new_student, how did you convert POD to MD?
11:51 new_student karjala_: perl -MPod::Markdown -e 'Pod::Markdown->new->filter(@ARGV)'
11:57 sri something very weird happened there
11:57 sri somehow the entire history got killed https://github.com/kraih/mojo/wiki/Projects-and-Companies-using-Mojolicious/_history
11:58 new_student Yes, that is pretty weird.
11:59 stephan48 ah
11:59 new_student In case you are looking for the old Pod file: https://paste.fedoraproject.org/paste/TQDVwzJBJ0unBFlJXkpVe15M1UNdIGYhyRLivL9gydE=/raw
12:00 stephan48 you can see it in the backing repo .. git clone https://github.com/kraih/mojo.wiki.git .. git diff 13f8e7e93b42a18ce69750fd8a649ad03e186379..c635f74ac60b1c0281fc2c506195d14e08f2f513
12:00 stephan48 basically the file previously existed as <pagename>.pod but that one got deleted and a new file <pagename>.md got created
12:00 new_student Ah
12:00 new_student Makes sense
12:01 sri pretty annoying though
12:01 stephan48 i am not sure if this is per design or a bug(and instead a rename should have been performed)
12:01 stephan48 yes
12:01 sri if someone decided to vandalize all the pages :S
12:01 new_student Are wiki pages open to all by default or did you explicitly mark it to be?
12:02 stephan48 you could get them in the backing repo but still quite annoying
12:02 new_student GUI to view the diff https://github.com/kraih/mojo/wiki/_compare/3122a41fd8830bc7d27236cd7d27577bf49dffbe...c635f74ac60b1c0281fc2c506195d14e08f2f513
12:03 stephan48 thank you, i did search for such a thing but failed to find it
12:09 new_student In terms of deployment, is mojo v/s mojo behind nginx documented somewhere? I mean, what's the best practice and why?
12:15 sri just the how, not the why
12:16 new_student I don't follow. 'how' as in?
12:16 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Nginx
12:17 new_student Oh, no, I know the 'how'. My question is more like why
12:18 ashimema So your question is more 'Why would you put Mojo behind nginx instead of just running it directly using hypnotoad/whatever?'
12:18 new_student Exactly
12:18 ashimema no docs for that, that I know of
12:19 new_student Well, in that case, what's your opinion?
12:19 ashimema personally, I currently run behind apache simply because I couldn't get shibboleth to work (without writing my own shibboleth service provider code in perl) and my customers required shibboleth for authentication
12:20 ashimema otherwise I would run it under hypnotoad only without any proxy games
12:20 ashimema I'm sure there are other similar use cases out there... but I don't know them
12:21 new_student Oh, so if there was no auth layer, you would have gone with hypnotoad directly
12:21 ashimema here's where someone with more experience steps in the answer more fully (or make me look silly and offer me an alternative for decoding shibboleth stuff in app)
12:21 new_student If the use case, say for example: low-latency websocket connections, which one would you prefer?
12:21 ashimema I would have yeah.. but simply to 'remove a layer of indirection'.. I'm sure there are reasons to keep nginx around.. but I can't name them
12:22 sri security is a good reason, nginx is much more battle tested
12:22 ashimema sorry.. that one steps outside my limited knowledge
12:22 sri or performance for tls termination
12:23 sri or to serve static files with nginx on the same domain, which is much faster
12:23 sri or to have nginx cache certain resources
12:23 new_student Is it the case that mojolicious may, in the future also provide this fancy stuff?
12:24 sri what fance stuff?
12:24 sri mojolicious can do it all, nginx is just better at it
12:24 ashimema what he said :)
12:24 new_student I see
12:25 ashimema though I didn't know about the tls termination one.. not something I've ever needed to worry about/dig into enough to understand
12:25 sri we will never be able to serve static files as efficiently as nginx
12:26 sri if the difference matters to you is a different question
12:30 bobkare For small internal tools (think /maybe/ 2 concurrent users) I just run hypnotoad or prefork directly, for public facing stuff most of my things are behind varnish. I don't bother much about static file serving since I have varnish cache them so mojo rarely see those requests. Letting varnish cache public resources (even if only for a couple of seconds) really helps with performance under load. Getting caching right for dynamic or semi-dynamic content is hard though
12:31 bwf joined #mojo
12:57 dod joined #mojo
13:12 gizmomathboy joined #mojo
13:16 Pyritic joined #mojo
13:48 maschine joined #mojo
13:52 PryMar56 joined #mojo
13:55 gryphon joined #mojo
14:08 dantti_laptop joined #mojo
14:24 claude joined #mojo
14:26 claude Hello
14:29 jberger ribasushi: I guess I was hoping to have something closer to the Error callback, it is possible that if that's not available then your solution is best
14:30 jberger overnight I was trying to decide if this is something I think Mojo::Pg should do or if I should just set it in a connection event handler in my application
14:32 jberger new_student: I use mojo behind nginx because it lets me handle lots of domains via "virtual hosts" with tls/sni on the fly
14:33 jberger yes you can do that with mojo via a wrapper application and configuration, but that assumes everything you serve is mojo
14:33 jberger on my server I have several mojo apps but I also have a php app (nextcloud) and a static site (statocles)
14:34 jberger with nginx it is easy to divert each of those to the proper internal port and handle sni
14:39 maschine it's also probably simpler to set up all the security stuff.  Getting HTTPS to work on nginx was pretty simple (once i worked through all the CA BS)
14:40 maschine ditto serving static files - very easy.  it's so refreshing compared to setting up Apache.
14:48 jberger oh, I just noticed:
14:48 jberger claude: hi
14:54 stryx` joined #mojo
15:02 maschine speaking of HTTPS, my site is using AJAX to load content from a database - HTTPS has a performance penalty of some sort, would it be better to use websockets instead?
15:12 perlpilot joined #mojo
15:18 gryphon joined #mojo
15:23 gryphon left #mojo
15:34 jberger SSL has overhead but not much different than the overhead of making a new connection
15:34 jberger websockets help that too of course
15:34 jberger I've taken a new approach to ajax vs websockets lately
15:35 jberger use websockets when the server has to push data without a request, use ajax when you are doing request/response
15:35 jberger ie, use the right tool for the job
15:49 disputin joined #mojo
16:09 Grinnz yes i generally serve hypnotoad via nginx for the reason that nginx is better suited to serve multiple domains
16:09 Grinnz and i have more than one app/domain running
16:22 gryphon joined #mojo
16:22 gryphon left #mojo
16:29 sh14 joined #mojo
16:33 sirhalos joined #mojo
16:42 sirhalos I think this should be a fairly easy question to answer. This is a lite_app I have get '/Sheepdog/bovid-info?env:environment&bovid:bovid' => sub {    but I realize it doesn't like the ? in the get command. How should I properly write that.
16:45 jberger ? is not a valid part of a url
16:45 jberger sorry, "url path"
16:46 jberger it looks like what you want is the query portion
16:46 sirhalos yea I get that, but I don't know what I'm supposed to write. All the tutorials are all using the full url directly/path part as the param but I don't want to do that
16:46 Grinnz mojolicious can't natively route using the query; you'd have to dispatch that yourself
16:46 sirhalos like they may have it   /Sheepdog/bovid-info/parm1/parm2/
16:47 jberger sirhalos: are you saying that you want to handle the "query" portion as part of the routing?
16:48 sirhalos Sorry I'm going to need to you to dumb it down for me. Perl guy with almost no web experience here.
16:48 sirhalos I have made some simple CGI scripts before so this is the web URL format I'm used to
16:48 jberger you want say /Sheepdog/bovid-info?env:env1&bovid:bovid1 to route to some different controller than /Sheepdog/bovid-info?env:env2&bovid:bovid2
16:48 jberger ok, lets back up
16:48 sirhalos I want the url to be like that and go to template '/Sheepdog/bovid-info'
16:48 jberger I think what you want, and what is much more normal, is to route  /Sheepdog/bovid-info
16:48 jberger ok, good we are on the same page
16:49 jberger so all you want to do then is check $c->param('env') and $c->param('bovid') in your controller
16:49 sirhalos right
16:49 sirhalos which that part is working for me
16:49 jberger the form of query arguments is ?env=env1&bovid=bovid1 though
16:50 jberger equal separated not colon
16:50 sirhalos I thought the : in the get mean =
16:51 jberger no, : is not special in query parameters
16:51 sirhalos Here is the full get command it's short
16:51 jberger post it to a paste site
16:51 jberger gist.github.com
16:51 purl gist.github.com is nice to inline pastes WHEN GITHUB WORKS
16:51 Grinnz lol
16:52 rshadow joined #mojo
16:52 sirhalos https://gist.github.com/anonymous/57a9640cb142fac6354ca1f75a31f1ed
16:52 sirhalos Thanks for the site didn't know about it
16:53 jberger ok, so just don't include the query in the route
16:53 jberger get '/Sheepdog/bovid-info'
16:54 jberger in REST lingo, the route/path is the "resource", you are getting bovid-info about stuff
16:54 sirhalos Oh thank you that got it to work
16:54 jberger then the stuff after the ? is the query, that is limiting the responses the you get to a few or even one
16:56 jberger oh and now I get what you meant about :
16:56 sirhalos Thank you for the help. I'm still learning but thank you this makes much better sense now on how this is supposed to work.
16:56 jberger yeah, route placeholders are something that mojolicious uses to figure out which controller to use to render the content
16:56 jberger but the query parameters aren't part of the routing, and so they don't use :
16:57 sirhalos Yea I get the : isn't what I thought, more like a special reference keyword you can use
16:57 jberger there are ways to validate the query
16:57 jberger but it is a different thing
16:57 jberger probably best to get comfortable at this level first, then when you need query validation then start looking at that
16:58 jberger for the time being, if a user doesn't pass a correct query, just render a 400 response to them, that says that it is a malformed request
16:58 sirhalos It was really nice to just take a perl script I had and for the most part dump it into my template and it just worked
16:58 jberger sweet
17:02 tchaves joined #mojo
17:28 PopeF joined #mojo
17:36 dod joined #mojo
17:40 dod joined #mojo
17:41 dod joined #mojo
17:42 Pyritic joined #mojo
17:51 rshadow joined #mojo
17:52 maschine another way would be to use something like "get '/Sheepdog/bovid-info/:foo/:bar'
17:52 maschine and then you can use $self->param('foo') etc.
17:53 maschine it's so much better than the nonsense I had to do 20 years ago lol.  I can't even remember the name of the module I used for CGI queries but it used all sorts of "magic" code that was impossible to read
17:54 Grinnz cgi-lib.pl?
17:54 purl i think cgi-lib.pl is ancient and dangerous and lame and non-standard.  Use the standard CGI.pm instead, even in stupid cgi-lib.pl mode
17:54 Grinnz lol
17:57 maschine yeah I think that was probably it actually
17:57 maschine it was ages ago though, I haven't used it on anything in years
19:17 sirhalos How do I test a put command without writing some script to try it out?
19:20 romel joined #mojo
19:21 romel hello. are there any mojo::useragent based solutions for downloading entire web page along with images included in styles and such
19:27 sirhalos nevermind I was able to get a chrome extension to do it.
19:30 Grinnz ./yourapp get -M PUT ...
19:32 rshadow joined #mojo
19:35 sirhalos thanks I'll write that down
19:39 maschine getting an error with minion -
19:40 maschine [fatal] Worker error: Can't fork: Cannot allocate memory at /usr/local/share/perl/5.22.1/Minion/Job.pm line 54
19:40 maschine I'm guessing it's a server issue - I haven't changed anything code-wise related to minion
19:41 maschine I have memory available so not sure what's wrong
20:45 tchaves joined #mojo
21:18 kiwiroy joined #mojo
21:20 Janos joined #mojo
21:21 bpmedley maschine : ulimit, maybe?
21:26 stryx` joined #mojo
21:29 Sebbe joined #mojo
21:33 Pyritic joined #mojo
21:41 dikim joined #mojo
22:04 stryx` joined #mojo
22:11 jberger I can never remember when to use the app's ua and when to make a new one :s
22:18 sri there is no rule for that
22:30 nic What's a good way to do the following when searching through a dom...
22:31 nic [re-wording question...]
22:31 nic Can I do 'last' inside a $dom->find->each(sub {...}) ?
22:33 nic cool.  it works
22:34 nic if $_->at('X')->text eq $value then grab $_->at('Y')->text and last
22:35 nic happy days
22:35 purl It's true, it's true/You love me so
22:44 Grinnz nic: not sure i'd want to rely on that...
22:44 Grinnz nic: why not ->first
22:45 Grinnz $dom->find->first(sub { $_->at('X')->text eq $value })->at('Y')->text
22:45 Grinnz with intermediaries in case it doesn't exist
23:30 itaipu joined #mojo
23:48 Gedge_ joined #mojo

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