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

IRC log for #mojo, 2017-06-01

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

All times shown according to UTC.

Time Nick Message
00:22 sri so much for the opera vpn, netflix just blocked me in the middle of an episode of house of cards
00:26 good_news_everyon joined #mojo
00:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vHRPy
00:26 good_news_everyon mojo/master 947894a Sebastian Riedel: Perl 5.26 has been released
00:26 good_news_everyon left #mojo
00:41 * arcanez wonders if Opera is operating their own VPN or simply offering someone elses for free
00:54 marty joined #mojo
02:15 schelcj joined #mojo
02:43 karjala_ joined #mojo
02:50 noganex_ joined #mojo
02:58 zivester joined #mojo
04:04 dboehmer_ joined #mojo
05:09 Petru_ joined #mojo
05:12 inokenty-w joined #mojo
05:31 dod joined #mojo
05:37 dod joined #mojo
06:01 dod joined #mojo
06:12 klapperl_ joined #mojo
07:03 Lee joined #mojo
07:07 trone joined #mojo
07:08 AndrewIsh joined #mojo
07:08 prg joined #mojo
07:16 Vandal joined #mojo
07:21 salva joined #mojo
07:56 aborazmeh joined #mojo
08:28 nic arcanez: a bit of both.  It's run by a subsidiary
08:35 dod joined #mojo
08:48 rshadow joined #mojo
10:22 stryx` joined #mojo
10:24 Petru_ joined #mojo
10:59 tchaves joined #mojo
12:03 dod joined #mojo
12:19 gryphon joined #mojo
12:21 marty joined #mojo
12:25 gizmomathboy joined #mojo
12:58 sri so, any suggestions for improving this example test? https://github.com/kraih/mojo-pg/blob/master/examples/blog/t/blog.t
12:58 sri or is that what we want to teach from now on?
13:05 sri still wish we had better abstraction for this pattern https://github.com/kraih/mojo-pg/blob/master/examples/blog/t/blog.t#L15-L20
13:05 karjala_ joined #mojo
13:08 sri jberger: also, didn't you work on some Mojo::Pg feature for silencing warnings?
13:24 VVelox joined #mojo
13:28 PryMar56 joined #mojo
13:35 foursixnine joined #mojo
13:41 dmanto joined #mojo
13:49 mib_84c2t3 joined #mojo
13:49 maschine joined #mojo
13:49 dmanto hi there. In your template when you construct your websocket route (for instance in the mojo chat example), you can have:
13:49 dmanto var ws  = new WebSocket('<%= url_for('channel')->to_abs %>');
13:50 dmanto but if your site is 100% https you should add:   ->scheme('wss')
13:50 pink_mist dmanto: no, you should make sure Mojo knows it's served through https
13:51 dmanto ahhh
13:51 dmanto that is probably the problem
13:51 pink_mist dmanto: you do that by either making mojo itself the endpoint, or if you're using mod_proxy or something, you set the MOJO_REVERSE_PROXY=1 env var, and make sure the X-Forwarded-Proto header is sent correctly
13:51 dmanto mmm I have to review the proxy configuration to be sure mojo knows
13:51 pink_mist (I may be misremembering the exact name of that header)
13:52 sri it's in the cookbook
13:52 dmanto yes is a nginx proxy, and I was sure I copied the conf file from the cookbook...
13:53 dmanto I'll check and come back
13:53 pink_mist you also need to run the mojo server using that env var
13:53 Pyritic joined #mojo
13:55 pink_mist sri: the cookbook only mentions that env var in relation to PSGI/Plack ... perhaps mention it in the nginx and apache mod_proxy sections too?
14:02 dmanto mmm probably copied pasted from somewhere, X-Forwarded-Proto header is not https  :(
14:02 dmanto proxy_set_header X-Forwarded-Proto "http";
14:03 pink_mist dmanto: that should be proxy_set_header X-Forwarded-Proto $scheme;
14:04 Grinnz unfortunately the apache version has no such variable, so you have to manually make sure you set the right one
14:04 pink_mist yeah
14:25 mcsnolte joined #mojo
14:44 dmanto after adding this line to my template
14:44 dmanto % app->log->info(dumper {headers => $c->req->headers, env => $ENV{MOJO_REVERSE_PROXY}, url => url_for('channel')->to_abs->to_string});
14:44 dmanto I worked after I stopped hypnotoad
14:45 dmanto I mean, hypnotoad doesn't seem to take care of the %ENV on hot-restarts
14:45 dmanto kind of make sense though
14:46 dmanto sorry I meant the line added to my template was to see what was going on
14:47 dmanto the problem was for hypnotoad to take the ENV variable needed to stop and start back
14:48 dmanto and that was after implementing pink_mist & sri suggestions for the X-Forwarded-Proto, restarting nginx, and hypnotoad with the ENV variable
14:49 dmanto so thanks very much, working now :)
14:55 Pyritic joined #mojo
15:00 stryx` joined #mojo
15:13 zivester joined #mojo
15:23 jberger sri: I did, but IIRC it came to "I don't think you can easily"
15:24 * jberger look back through logs
15:24 sri jberger: i thought after that we figured out it was pretty easy
15:24 jberger hmmmm
15:26 jberger haha, yeah, I have this local change in my mojo-pg checkout
15:26 jberger http://paste.debian.net/958542/
15:26 jberger works for my test case
15:27 jberger perl -Ilib -MMojo::Pg -E 'Mojo::Pg->new("postgres://test:test@/test")->db->query(q[SELECT to_tsquery(?)], "")'
15:27 * jberger is embarassed about the inconsistent casing in that query
15:27 jberger please ignore
15:27 purl I'd like to, but I supposed to answer something stupid
15:28 * jberger throws purl down a well
15:28 purl seven days
15:29 Pyritic joined #mojo
15:31 sri jberger: what about PrintWarn?
15:32 sri so, what are we losing by setting $dbh->{PrintWarn} = 0;?
15:33 jberger both Warn and PrintWarn seem to work
15:33 sri i mean, i don't really care about warnings like "schema "mojo_crud_test" does not exist, skipping" at all
15:34 sri as far as i can see it might even be a sensible default
15:34 jberger I wonder if I can figure out what their difference is
15:34 sri one is warnings from the driver, the other warnings in general i think
15:36 jberger yeah, that's how I read it too I suppose
15:36 jberger though I wish it was a little more clear
15:37 jberger the DBD::Pg doc is a little more telling (if not informative)
15:37 jberger https://metacpan.org/pod/DBD::Pg#Warn-(boolean,-inherited)
15:37 jberger WARN: Enables warnings. This is on by default, and should only be turned off in a local block for a short a time only when absolutely needed.
15:38 jberger vs PRINTWARN: Implemented by DBI, no driver-specific impact.
15:38 jberger sounds like if turning off PrintWarn is sufficient, that is what we should do
15:38 jberger (assuming we want to do anything)
15:40 sri this seems sensible https://github.com/kraih/mojo-pg/commit/88d6d7164a9a87a7af01024f636727a3e94268fb
15:41 sri you can activate it right from the connection string with ?PrintWarn=1
15:41 sri consistent with PrintError
15:44 sri are there important warnings we'd be missing out on?
15:45 * sri thinks all the really important stuff will just be raised as errors, but isn't entirely sure
15:47 jberger I tend to agree with you
15:48 jberger but also am not sure
15:48 sh14 joined #mojo
15:49 sri i mean, it's not like it's a huge committment
15:49 sri if it turns out to be bad for some reason we can just change it back
15:49 jberger yeah
15:50 jberger plus as the name implies, it is printing this warning, not logging it in some useful way
15:50 jberger so mostly it is an annoyance in development and no help in production
15:51 jberger I suppose you could counter-argue that warnings are more useful in development, but I haven't seen one yet that has been
15:51 sri i guess Mojo::SQLite and Mojo::mysql will have to decide for themselves if it is a good idea
15:52 jberger sri++, I think this is good
16:36 sri looks like performance didn't change much between perl 5.24 and 5.26
16:37 sri for mojolicious
16:38 sri signatures got fast though i guess
16:38 dod joined #mojo
16:42 sri oh, i didn't know github had license summaries https://github.com/kraih/mojo/blob/master/LICENSE
16:43 disputin joined #mojo
16:43 mib_7xn7mr joined #mojo
16:48 jberger I didn't either, I suspect that's newish
16:49 pink_mist I also recently noticed the 'verified' button on commits if you've signed them with your gpg key (and github knows about your gpg key)
16:49 pink_mist don't think I'd seen that before this week
16:52 pink_mist like the commits by willysr here https://github.com/pink-mist/slackbuilds.org/commits/master (I don't have a gpg key myself, so my own commits don't have it)
16:56 VVelox joined #mojo
17:10 * sri wonders if he should start signing commits
17:11 sri actually already have everything set up
17:13 sri that said, my key could use a few more signatures http://keys.gnupg.net/pks/lookup?search=0x1D4827F5&amp;op=vindex
17:21 stryx` joined #mojo
17:34 pink_mist that link gives me 404
17:34 pink_mist (not that I could sign anything anyway though)
17:41 sri how odd, it still works for me
17:46 jberger funny, when if you search for me, you can find the day I discovered public key encryption
17:46 jberger http://keys.gnupg.net/pks/lookup?op=vindex&amp;search=joel+berger&amp;fingerprint=on
17:46 jberger those keys are LOOOOOONG gone
17:46 pink_mist ok, must be something wrong on my end - that one also gives me 404
17:47 jberger not that it matters but if I could get rid of them I would
17:52 Grinnz sri: I've never seen either DBD::mysql or DBD::SQLite print out warnings from queries by default in any case
17:52 rshadow joined #mojo
17:52 VVelox joined #mojo
17:53 Grinnz nor have i had the desire to enable that
17:53 stryx` joined #mojo
17:56 good_news_everyon joined #mojo
17:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vHElX
17:56 good_news_everyon mojo/master 5ab8c76 Sebastian Riedel: include Perl 5.24
17:56 good_news_everyon left #mojo
18:05 gryphon joined #mojo
18:16 trone joined #mojo
19:15 karjala_ joined #mojo
19:35 stryx` joined #mojo
19:47 cheako joined #mojo
19:51 Petru_ joined #mojo
20:23 bwf joined #mojo
20:26 batman anyone care to have a look at this? https://github.com/jhthorsen/mojolicious-plugin-pager
20:27 batman any good alternatives to how to create paginations?
20:27 batman funny that i wrote the plugin, before asking.... hehe
20:29 cheako joined #mojo
20:38 pink_mist batman: I think I could have use for it in one of my apps =)
20:41 pink_mist https://github.com/jhthorsen/mojolicious-plugin-pager/search?l=turing lol, it thinks t/pager.t isn't perl :P
20:43 batman Haha!
20:43 batman cool :)
20:44 batman i don't like the pagination modules that tries to be too clever.
20:44 batman let me know if mine is "too clever" as well
20:44 batman Does the documentation make sense?
20:51 maschine Routes question - I want to render an array as a text output - so you could right click and save it as a file.
20:51 maschine i want to do something like   $self->render(text => @hexfile); - but it only prints the first line of the array.  Is there another way to do it aside from creating a template to print it from a stash value?
20:53 batman maschine: that will be converted to a list, like this: render(text => $hexfile[0], $hexfile[1] => $hexfile[2], ...);
20:54 batman you need join or something similar... maybe you want render(text => join("\n", @hexfile)); ?
20:54 Grinnz also, "render array as text" doesn't make sense. you need to serialize it somehow
20:54 batman or render(data => join("", @hexfile))
20:54 Grinnz joining it on some separator would be one way
20:55 maschine it's just text strings in an array - I'll try joining it
21:29 whosgonna joined #mojo
21:31 whosgonna left #mojo
22:22 karjala_ joined #mojo
22:40 kiwiroy joined #mojo
22:41 kiwiroy joined #mojo
22:45 kiwiroy joined #mojo
23:20 Pyritic joined #mojo
23:40 kiwiroy joined #mojo

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