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

IRC log for #mojo, 2017-09-06

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

All times shown according to UTC.

Time Nick Message
00:12 rickbol joined #mojo
00:28 rickbol joined #mojo
00:46 rickbol joined #mojo
00:55 rickbol_ joined #mojo
01:25 rickbol joined #mojo
01:34 rickbol_ joined #mojo
02:13 rickbol joined #mojo
02:19 jberger well sure
02:19 jberger any db will do
02:20 noganex joined #mojo
02:44 rickbol_ joined #mojo
02:49 disputin joined #mojo
02:53 rickbol joined #mojo
03:00 rickbol_ joined #mojo
03:53 rickbol joined #mojo
04:04 dboehmer_ joined #mojo
04:13 mib_fegaen joined #mojo
04:14 mib_fegaen Hi I have a question
04:15 mib_fegaen how can I can reuse a block of html in different pages?
04:16 mib_fegaen one page would be <content> <%= header_a %> <%= footer> </content>
04:17 mib_fegaen other would be <content> <%= footer %> </content>
04:18 mohawk sounds like you want something like Template::Toolkit
04:18 mib_fegaen I've been reading the layout and content docs, but it doesn seems it does what i want
04:18 mib_fegaen Template::Toolkit?
04:20 mohawk there are others who know better than me how such a beast hooks into mojo
04:20 mib_fegaen This is not part of Mojolicious, right?
04:20 mib_fegaen ok ...
04:22 mib_fegaen What is layout for? I just don't get it
04:22 mib_fegaen https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Layouts
04:46 mohawk that looks like what you want
05:01 mib_fegaen sorry I didn't see it
05:02 mib_fegaen %= include does the trick :D
05:29 ilbot2 joined #mojo
05:29 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
05:52 dod joined #mojo
05:53 inokenty-w joined #mojo
05:58 dod joined #mojo
05:59 karjala_ joined #mojo
06:45 AndrewIsh joined #mojo
06:55 karjala_ joined #mojo
07:01 rshadow joined #mojo
07:12 Vandal joined #mojo
07:27 rickbol joined #mojo
07:34 trone joined #mojo
07:44 alilles joined #mojo
07:46 bianca joined #mojo
07:52 prg joined #mojo
08:41 rshadow joined #mojo
08:48 bianca joined #mojo
09:09 n16gel joined #mojo
09:09 mtj joined #mojo
09:26 mtj joined #mojo
10:06 foursixnine joined #mojo
10:57 bianca joined #mojo
11:06 tchaves joined #mojo
11:24 itaipu joined #mojo
11:29 kes joined #mojo
11:36 * ashimema just had his first experience of using minion job forgrounding... it's awesome!
11:44 Alex342 joined #mojo
12:05 gizmomathboy joined #mojo
12:09 Alex342 joined #mojo
12:18 stryx` joined #mojo
12:24 Alex342 I want to refresh a div every x seconds. I tried this https://pastebin.com/De0ZDvRc
12:25 Alex342 But it doesn't really works
12:27 haarg you are missing a quote
12:28 haarg but generally, check your browser console for errors
12:30 Alex342 oh. That's from copy-paster. sorry. I dont get errors. Console is full of "XHR finished loading: GET"
12:32 CHYC Alex342: Without the full code it's hard to say with certainty, but $now will always be 1 because state is not preserved across requests unless you're doing stuff with sessions.
12:35 CHYC my $now = time; # May be a better proof of concept.
12:35 Alex342 I do stuff with sessions. But i wanted to test if it works with $now
12:37 Alex342 CHYC: yes. Thanks. It works :))
12:37 CHYC NP
12:49 tcohen joined #mojo
12:50 perlpilot joined #mojo
13:01 marty joined #mojo
13:29 gryphon joined #mojo
13:41 mudler sri: with 7.44 https://github.com/kraih/mojo/commit/19502a0b0a63f8d28b1258caed3eb0248deb025e#diff-4ae7b7f1fbef554da39b1d125642c2c7L54 is triggering errors wrt IO::Socket::SSL
13:42 foursixnine Mojo::Reactor::Poll: I/O watcher failed: SSL_ca_file SCALAR(0x2490188) does not exist
13:50 mudler sri: for reference, https://github.com/kraih/mojo/pull/1129
13:56 sri that sucks
13:57 sri i think it's the IO::Socket::SSL version
14:00 mudler yup seems like it
14:00 sri yea, that changed in between those IO::Socket::SSL versions
14:01 sri https://metacpan.org/pod/release/SULLR/IO-Socket-SSL-1.962/lib/IO/Socket/SSL.pm#SSL_ca_file-|-SSL_ca_path
14:01 sri old one wanted ''
14:01 sri new one wants \undef
14:01 mudler :(
14:01 sri https://metacpan.org/pod/distribution/IO-Socket-SSL/lib/IO/Socket/SSL.pod#SSL_ca-|-SSL_ca_file-|-SSL_ca_path
14:01 sri mudler: what's the newest you can upgrade to?
14:03 mudler Latest upgrade brought perl-IO-Socket-SSL-1.962-5.2
14:03 sri :S
14:05 genio Can you setup a local::lib and install your own via cpan?
14:06 sri mudler and foursixnine also work at suse btw.
14:06 sri normally i'd just bump the version requirement for IO::Socket::SSL in the next mojo release
14:10 sri there is no value we can use that works in both versions
14:11 sri '' means default CA in the new one it seems, and no CA in the old
14:11 sri undef means default CA in the new one and has no meaning in the old
14:11 sri \undef breaks the old one and means no CA in the new
14:11 sri sullr has made quite the mess there
14:12 mudler :(
14:12 genio It's an annoying problem that looks like you'll only be able to fix it with a check of the version of IO::Socket::SSL. a few extra lines of code
14:13 foursixnine Hmmm so, '' works
14:14 mudler changed the pr accordingly if that can help somehow :p
14:14 mudler (even if CI tests can't spot that apparently)
14:15 sri very hard to test no CA vs default system CA
14:16 sri anyone know which version of IO::Socket::SSL borked it?
14:18 mudler mm i'll try to dig IO::Socket::SSL git repo
14:19 PopeFelix joined #mojo
14:19 Lee https://github.com/noxxi/p5-io-socket-ssl/commit/4936ba4488cf5e89068111253c27038bdcd17d3d ?
14:19 sri 1.965 seems to be it
14:20 genio my $default = ''; $default = \undef if eval {IO::Socket::SSL->VERSION(1.994)}; or some such?
14:20 sri judging by the docs
14:20 genio https://github.com/noxxi/p5-io-socket-ssl/commit/7c3108b00dc5e56b473ae4cbe1885f13bfbd568a
14:20 genio oh, you found it earier
14:20 genio earlier
14:21 sri not even a Changes entry?
14:21 mudler yeah looks like it
14:21 sri wtf
14:23 sri that really sucks, we can't just change it to undef or '', since that's a security issue
14:24 sri it's either check the IO::Socket::SSL version and use \undef and '' respectively, or bump the IO::Socket::SSL requirement
14:24 mudler runtime detect of version? or probably we are going to patch mojo to keep old behavior
14:24 mudler yeah
14:25 genio a runtime version detection doesn't sound like an absolutely horrible option. And once you can bump past that version in your prereqs, it can be ripped out
14:29 sri mudler: if you really need 1.962 support we'll do a runtime version check i guess
14:30 mudler well, problem is that, if mojo doesn't do runtime detection, and another upgrade of IO::Socket::SSL happens, and we patch mojo in our obs, would cause same problem later (or even unnoticed security issues)
14:31 mudler but we could inspect IO::Socket::SSL $VERSION as well, without being too horrible as a patch
14:33 bianca joined #mojo
14:33 mudler let me see if we can reproduce with runtime detection
14:34 sri if you update your pull request with version detection add a little description of the problem to your commit message
14:35 sri so we don't forget
14:35 mudler something like https://github.com/mudler/mojo/commit/2d822f1684e531101d1f6f09322bbf86452dd62b
14:35 mudler but needs to test that before
14:35 sri what't the correct idiom for comparing module version numbers?
14:36 genio the eval I showed above ^^
14:36 * genio went through this not too long ago with a problem introduced to lwp.
14:36 mudler but it won't compare versions, no? would just check if it's the specific version
14:37 genio at least that version
14:37 sri i guess we want "use constant TLS_DEFAULT => eval {IO::Socket::SSL->VERSION(1.995)} ? '' : \undef;"
14:38 genio 965, but yea
14:38 sri "&& -T $args->{tls_ca} ? $args->{tls_ca} : TLS_DEFAULT,"
14:39 mudler let me update the PR and see if foursixnine can test that (i can't on my machine)
14:39 foursixnine Sure
14:40 sri (i'm only accepting a workaround because suse pays the bills :p)
14:41 sri been a long long time since we bumped the IO::Socket::SSL version requirement though
14:42 mudler sri: something like this suits you? https://github.com/mudler/mojo/commit/408c7662f72b7247589c3779b372bec29663b70b
14:42 ilbot2 joined #mojo
14:42 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
14:42 genio mudler: 1.965 was the version y'all found right? not 1.995
14:43 sri genio is correct
14:43 sri 1.995 was my typo
14:44 mudler mmm now that you mention it,  perl-IO-Socket-SSL-1.962-5.2.noarch triggered this
14:44 mudler yeah it's confusing a bit :)
14:44 sri ->VERSION(1.965)
14:44 sri is what we need
14:44 Lee 1.968
14:44 Lee https://github.com/noxxi/p5-io-socket-ssl/commit/4936ba4488cf5e89068111253c27038bdcd17d3d
14:44 foursixnine the machine where i'm testing this has: 1.962
14:44 Lee it's documented in the Changes, commit message, and also can be seen in the code + perldoc
14:46 disputin joined #mojo
14:46 mudler foursixnine: might we have some odd patch backport in obs?
14:47 sri Lee: it is https://github.com/noxxi/p5-io-socket-ssl/commit/7c3108b00dc5e56b473ae4cbe1885f13bfbd568a
14:47 foursixnine mudler: you mean for Mojo? or IO::Socket::SSL?
14:47 * foursixnine is currently adding the patch for the Mojo package
14:47 mudler IO::Socket::SSL, it's still a pretty old version that we have
14:47 * foursixnine feels rusty with obs lol
14:48 foursixnine sri: mudler the last code from the pr works
14:48 mudler foursixnine: this one as well? https://github.com/mudler/mojo/commit/eb1eb1ab86b00671d9592a46d839855ceb252d50
14:48 ilbot2 joined #mojo
14:48 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
14:48 mudler (there was typo with version numbering, and like a noob i just copied sri code :P)
14:49 sri mudler: you forgot to perltidy
14:49 mudler argh missed that
14:49 sri don't rush it, i'll wait for your PR
14:50 sri and upload a new mojo release in the evening or tomorrow morning
14:51 Grinnz pass the version to ->VERSION as a string not number
14:51 Grinnz otherwise looks good to me
14:51 mudler oki will update commit and PR
14:51 sri that really wouldn't have been my first guess for a version check idiom
14:52 sri btw.
14:52 Grinnz perl versions are complicated, ->VERSION with a string is the easiest way to handle any complications :P
14:53 mudler aye, they can change module to module, but IO::Socket::SSL seems pretty steady and a > could have worked as well i guess
14:53 Grinnz never use numeric comparison
14:53 mudler perl support in Gentoo is even more problematic cause of that :D
14:53 Grinnz lots of modules use underscores in versions so numeric comparison will break unless they remove the underscore in $VERSION, better not to rely on that
14:53 Grinnz (also if they use v1.2.3 versions of course)
14:53 ChmEarl joined #mojo
14:54 mudler yeah, even letters :(
14:54 Grinnz well, letters are invalid so i'm not worried about those
14:58 mudler well, if you do numeric comparison, it's a problem
14:58 mudler even because it's hard to set defined rules
14:59 mudler on Gentoo we use a script to convert perl modules version to a gentoo version, and there are always border cases when it's borked
14:59 mudler anyway, https://github.com/mudler/mojo/commit/90b54a7e9553680fe416385691191971396eeebd
14:59 mudler if looks good, will move to the PR and update comments
15:10 mudler so, foursixnine can you confirm (hoping to be the last time :P) on the faulty machine that https://github.com/kraih/mojo/pull/1129 fixes it? (just updated)
15:10 Ptolemarch joined #mojo
15:11 foursixnine mudler: omw
15:11 foursixnine let's see if the user is still at his desk xD
15:11 * foursixnine crosses fingers
15:11 mudler :D
15:17 jberger Wow what a mess! Has anyone opened a bug upstream?
15:19 mudler jberger: not yet :p
15:21 trone joined #mojo
15:21 mudler the interested version of IO::Socket::SSL is pretty old actually - the problem as i see it is also *slows* upgrades in packaging area
15:29 maschine I love it when I'm stuck and somebody happens to post a link that details exactly what I was looking for:
15:29 maschine https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Optional-placeholders
15:29 maschine that will make my routes much simpler...
15:30 maschine still need to implement a DB for holding parameters across sessions, but my project is pretty much ready to be shown to management.. fingers crossed. :p
15:31 rshadow joined #mojo
15:35 * foursixnine could not find an user that upgraded Mojo recently
15:43 Ptolemarch joined #mojo
15:45 Ptolemarch joined #mojo
15:53 MojoNoobie joined #mojo
15:57 MojoNoobie Hi, is there a way to create an object that can be shared among all routes in an Mojo app? Not sure if this is the right terminology, want to create one instance of JSON::RPC::Client object and access if in different routes
15:58 jberger MojoNoobie: you can make an instance and store it in a helper with "state" or simply close over it
15:58 jberger but to be clear that only shares it with the clients that talk to that one server process
15:58 jberger is this about sharing state or saving memory?
15:59 MojoNoobie primarily about not creating a new JSON::RPC::Client object in each route
16:00 jberger then yeah, that's fine
16:00 jberger helper rpc_client => sub { state $rpc = JSON::RPC::Client->new };
16:02 MojoNoobie great, thanks, sorry , I was in another tab looking at the documentation. Thanks for the help
16:03 MojoNoobie is that $app->helper(rpc_client => sub { state $rpc = JSON::RPC::Client->new};
16:23 disputin joined #mojo
16:43 trone joined #mojo
16:43 bianca joined #mojo
16:44 good_news_everyon joined #mojo
16:44 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://git.io/v5VJk
16:44 good_news_everyon mojo/master 66c0c1b Ettore Di Giacinto: keep support for IO::Socket::SSL <= 1.965 in Mojo::IOLoop...
16:44 good_news_everyon mojo/master 2de10c5 Sebastian Riedel: Merge pull request #1129 from mudler/master...
16:44 good_news_everyon left #mojo
16:49 good_news_everyon joined #mojo
16:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v5VJ1
16:49 good_news_everyon mojo/master d9bb47b Sebastian Riedel: update Changes
16:49 good_news_everyon left #mojo
16:50 rshadow joined #mojo
16:51 sri will give it some time for testing and release later if there are no complaints
16:51 sri mudler++
16:51 sri foursixnine++
16:51 sri genio__
16:51 sri umm
16:51 sri genio++
16:51 jberger all++
16:52 mudler sri: \o glad to have contributed to mojo :) hope won't be last time and have other excuses to help :P
16:58 DerAlex joined #mojo
16:59 mohawk ++ ++
16:59 PopeFelix ++^++
17:02 mohawk ZOMG
17:29 bianca joined #mojo
17:49 genio \o/
18:13 zivester joined #mojo
18:28 gryphon joined #mojo
19:05 Zoffix joined #mojo
19:07 Zoffix \o  is morbo supposed to work on Windows7? When I try to run it I get "No Perl script found in input"   Running it with `morbo -w assets/sass -w assets/js -w templates -w lib bin/h2h.pl`   if I run `perl bin/h2h.pl daemon` the app starts, but I want it morbo'ed (restarted on changes)
19:07 Zoffix It's Strawberry Perl 5.26
19:09 Zoffix Mojolicious 7.44
19:10 rshadow joined #mojo
19:18 Zoffix Figured it out. I had "morbo" bash script in the repo. And I guess it messes with Windows system. Renaming that script made morbo work normally
19:18 Zoffix Thanks \o
19:20 coolo no problem
19:39 PopeFelix joined #mojo
20:30 disputin joined #mojo
20:30 disputin1 joined #mojo
20:44 PopeFelix joined #mojo
20:45 gryphon joined #mojo
21:00 tchaves joined #mojo
21:27 PopeFelix If I make a request with Mojo::UserAgent and the connection times out, will the response message say "Connect timeout" ?
21:59 sri is this a thing? https://github.com/kraih/mojo/issues/1130
21:59 sri if that's correct we've got a very big problem
22:08 disputin joined #mojo
22:08 marty joined #mojo
22:22 jberger I'm asking around
22:22 jberger I don't know anything about systemd other than I tend to think that it is badly reimplementing lots of things it shouldn't and it makes amaturish mistasking in doing so
22:24 jberger my devops coworkers tend to think that that bug report is valid
22:24 * batman likes systemd
22:25 jberger would running it as hypnotoad -f and then setting ExecReload to send USR2 work?
22:25 batman Not sure if it's a thing, but it could explain some weird 502's at work. I can have a look tomorrow.
22:25 jberger one of them might try to tinker with it too
22:26 batman how would -f help..?
22:26 * batman is off to bed
22:26 jberger I'm mostly relaying what my coworker is saying, and he is just reading it for the first time
22:29 jberger I'll let him comment for himself if he comes up with anything, relaying from slack to here isn't working out for me :-P
22:36 Grinnz i thought we already fixed hypnotoad reload to be synchronous?
22:36 Grinnz back when the systemd configs were added to the guides
22:37 Grinnz it needs to wait to return until the pidfile is updated, i remember sri specifically making that work
22:39 Grinnz ah, that's why. outdated version of mojolicious
23:05 jberger Bah! How did we not see that?!
23:06 * jberger goes to stop his co-workers
23:21 rickbol joined #mojo

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