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

IRC log for #mojo, 2016-08-27

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

All times shown according to UTC.

Time Nick Message
00:13 Pierre joined #mojo
00:37 sri yea, overwatch is definitely more fun in groups
00:37 sri the bonus xp is also neat
01:14 sri argh, irccloud is under attack :(
01:15 mib_lgmf0b joined #mojo
01:19 tchaves joined #mojo
01:22 tchaves joined #mojo
01:25 good_news_everyon joined #mojo
01:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pT2
01:25 good_news_everyon mojo/master a8815dc Sebastian Riedel: slightly better descriptions
01:25 good_news_everyon left #mojo
01:28 Pierre joined #mojo
01:28 pink_mist yeah, that's definitely a better description
01:41 good_news_everyon joined #mojo
01:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pTj
01:41 good_news_everyon mojo/master 86d410c Sebastian Riedel: slightly more consistent examples
01:41 good_news_everyon left #mojo
02:09 good_news_everyon joined #mojo
02:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pkA
02:09 good_news_everyon mojo/master 1baed1c Sebastian Riedel: clean up connections more carefully
02:09 good_news_everyon left #mojo
02:14 Pierre joined #mojo
02:26 Phil21 sri: what kind of attack?
02:26 Phil21 also overwatch time
02:28 good_news_everyon joined #mojo
02:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pI1
02:28 good_news_everyon mojo/master 1e0f1a3 Sebastian Riedel: let req and res die more gracefully if the connection has already been closed
02:28 good_news_everyon left #mojo
02:28 sri time to sleep for me
02:28 Phil21 I need to get you servers, just been a bogged down week
02:29 sri from their tweets it seems like a dos or ddos
02:29 Phil21 hmm
02:35 good_news_everyon joined #mojo
02:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pIx
02:35 good_news_everyon mojo/master 54f53cf Sebastian Riedel: test those new error messages too
02:35 good_news_everyon left #mojo
02:45 noganex joined #mojo
02:53 good_news_everyon joined #mojo
02:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pL4
02:53 good_news_everyon mojo/master 0dd2584 Sebastian Riedel: no need to emit the close event so often
02:53 good_news_everyon left #mojo
03:41 good_news_everyon joined #mojo
03:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6ptj
03:41 good_news_everyon mojo/master af00824 Sebastian Riedel: slightly more consistent error messages
03:41 good_news_everyon left #mojo
03:51 good_news_everyon joined #mojo
03:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pqn
03:51 good_news_everyon mojo/master 0391bb3 Sebastian Riedel: update Changes
03:51 good_news_everyon left #mojo
04:11 jberger sri++
04:29 Pierre joined #mojo
04:53 Vandal16455 joined #mojo
04:56 Phil21 sri: yeah, group bonus is just constant 20%
05:24 prajith joined #mojo
06:01 dod joined #mojo
06:07 dod joined #mojo
06:50 prajith joined #mojo
07:15 mpapec jberger: tnx for suggestion; updated https://gist.github.com/mpapec/edd39fe639bb6ecd862710260c78ca90
08:42 mvorg joined #mojo
09:26 meshl joined #mojo
09:50 lluad_ joined #mojo
10:00 prajith joined #mojo
10:29 batman joined #mojo
10:35 Pierre joined #mojo
10:47 Pierre joined #mojo
11:13 meshl joined #mojo
11:53 romel joined #mojo
12:20 good_news_everyon joined #mojo
12:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pMx
12:20 good_news_everyon mojo/master a78557c Sebastian Riedel: new FAQ answer for connection close during non-blocking operations
12:20 good_news_everyon left #mojo
12:24 good_news_everyon joined #mojo
12:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pDU
12:24 good_news_everyon mojo/master 667812e Sebastian Riedel: also mention the delay helper
12:24 good_news_everyon left #mojo
12:24 meshl joined #mojo
12:24 sri i wasn't sure if the error message is really worth it, but being able to locate the faq answer through it should be valuable
12:24 sri Phil21: still pretty good
12:25 * sri needs more overwatch friends
12:48 good_news_everyon joined #mojo
12:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6pyv
12:48 good_news_everyon mojo/master eddf9be Sebastian Riedel: $subprocess looks better in examples
12:48 good_news_everyon left #mojo
13:26 asarch joined #mojo
13:44 good_news_everyon joined #mojo
13:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6p9w
13:44 good_news_everyon mojo/master a89a2d0 Sebastian Riedel: a few more subprocess tests
13:44 good_news_everyon left #mojo
13:45 sri think having subprocess in core has already paid off
13:45 sri all the stuff i fixed yesterday for it i definitely wouldn't have noticed without running load tests on a subprocess using app
13:46 sri didn't realize how much of a problem destructors are when you're forking in the middle of a big app
13:46 sri think that might turn out to be the biggest problem when people start using subprocess with 3rd party modules
13:47 sri similar to the good old dbi problems around fork
13:47 sri people will be surprised by destructors running in the subprocess
13:48 jberger yeah, its tricky
13:48 jberger even as the author of ForkCall I try to use it sparingly
13:48 sri did also run into your $parent == $$ problem
13:48 jberger I noticed you committed that
13:49 sri removed it again and changed the stream destructor a little later :)
13:49 jberger ah, cool
13:49 * jberger reads the commits again
13:50 sri all the changes https://github.com/kraih/mojo/compare/997d21f75d976d77cec65a347b08092fb85b32ad...a89a2d0064ae385c6744e1625d5780f19cf8d02a
13:50 jberger so now a stream going out of scope doesn't get removed from the reactor?
13:52 sri right
13:52 sri of course streams are meant to be managed by Mojo::IOLoop anyway
13:53 jberger and it can do the cleanup instead?
13:53 sri yes
13:53 sri it triggers a ->close_gracefully
13:54 jberger ok, nice
13:54 * jberger is reading through things now
13:54 sri or the stream cleans itself up on receiving a connection close
13:54 sri or error on read
13:55 sri the whole stream going out of scope thing was weird, nothing in mojo used or tested it
13:56 sri random streams attached to the Mojo::IOLoop also do not affect the connection limit anymore, so there is really no incentive to keep them out
13:56 jberger the cleanup workflow in that corner of the loop was confusing to me too :P
13:56 jberger I'm not opposed to the new behavior
13:57 jberger I'm just reading through a few things to see if I relied on it
13:58 sri jberger: btw. i think this test case might cover one of your forkcall issues https://github.com/kraih/mojo/compare/997d21f75d976d77cec65a347b08092fb85b32ad...a89a2d0064ae385c6744e1625d5780f19cf8d02a#diff-ee4f69f3cc95e8d6bcfe9162b50d9ac3R95
13:58 jberger then again, I don't think I ever made an instance of ::Stream and the didn't immediately attach it to the ioloop so ... I should be fine
13:58 sri the one about signals and storable
13:58 jberger yeah, that's a good point, their code can exit
13:59 jberger kinda evil if you know what its trying to do, but it could certainly happen
14:00 sri i've got two things we still could add to subprocess
14:02 sri 1) send a signal to all subprocesses when Mojo::IOLoop shuts down gracefully, 2) capture thrown exceptions in the first closure and send them through the pipe for use in $err in the second closure
14:03 sri think Grinnz was interested in 2
14:03 sri and 1 too actually ;p
14:03 sri haha
14:37 vicash hi does anyone have experience using Mojolicious with Amazon S3 and its other "cloud" databases ?
14:38 vicash is there a Perl module that is used for that ?
14:38 jberger I'm pretty sure there's an s3 module
14:40 jberger sri: by 2 you are basically taking about serialization errors?
14:41 sri jberger: no, i mean running the first closure in an eval
14:41 jberger omg i didn't notice that wasn't there!
14:43 jberger I think that's a really nice feature in fc
14:44 jberger I should have, i noticed that your child code was smaller than mine
14:46 jberger I attributed the difference to the kill logic and i guess i didn't compare more deeply than that to notice
14:48 sri the code doesn't have to be much bigger
14:49 sri let me golf
14:50 sri it's 1 line of code right now
14:53 good_news_everyon joined #mojo
14:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6p7Z
14:53 good_news_everyon mojo/master 27bce90 Sebastian Riedel: catch exceptions in subprocesses
14:53 good_news_everyon left #mojo
14:54 kes joined #mojo
14:56 good_news_everyon joined #mojo
14:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6p7W
14:56 good_news_everyon mojo/master e43afba Sebastian Riedel: mention exceptions too
14:56 good_news_everyon left #mojo
14:56 Phil21 s3 isn't a database...
14:56 Phil21 but yeah, there are plenty of perl modules around to interact with it
14:57 sri i suppose these days you call anything a nosql database
14:58 sri +can
14:58 pink_mist technically a filesystem is also a kind of database
15:01 * sri prepares the /dev/null memes
15:02 pink_mist you could think of something like the slocate db as an index for it
15:03 Phil21 heh, technically the network is a data storage mechanism too :)
15:05 sri with better data integrity than mongodb
15:06 sri http://instantrimshot.com/index.php?sound=rimshot&play=true
15:11 vicash Phil21: yes i understand S3 is storage but i meant something like DynamoDB or RedShift. unfortunately i don't have any knowledge of them at the moment to ask a pointed question. hence was looking to see if someone else had done integration with Mojo... basically i am looking to see how difficult it is to develop a web app using just AWS for handling database storage and other forms of data storage rather than using say Postgres
15:12 sri aren't the aws databases pretty expensive?
15:14 * sri wonders of redshift works with Mojo::Pg
15:18 vicash sri: i haven't checked the price but most likely they are dependent on how much data is stored. i have to do more research...
15:27 thowe joined #mojo
15:50 Phil21 vicash: I don't have any experience directly using perl w/ the DBaaS stuff
15:51 Phil21 I'd imagine it's in less of a decent/mature state than S3
15:51 Phil21 but yeah, those DBs are extremely expensive usually - but then again so it all of EC2
15:51 Phil21 s/it/is/
16:02 dod joined #mojo
16:11 vicash Phil21: i agree with your assessment of expense... it might be just cheaper to run a hot-cold Postgres  setup on 2 VMs
16:15 cafe joined #mojo
16:21 dod joined #mojo
16:37 kaare joined #mojo
17:24 laidback_01 joined #mojo
17:37 Grinnz sri, \o/
17:38 Grinnz i figured catching subprocess exceptions would be easy
18:27 laidback_01 joined #mojo
18:46 jberger sri: it wouldn't save a line but couldn't it be @results rather than references?
18:47 Pierre joined #mojo
19:00 jberger sri: also, did you consider exiting with POSIX::_exit(0)?
19:06 sri jberger: why?
19:07 jberger sri: http://linux.die.net/man/2/_exit
19:07 jberger See Notes
19:08 jberger Doesn't call process exciting callbacks
19:09 jberger Exiting
19:10 jberger http://stackoverflow.com/a/2329834
19:10 jberger http://www.unixguide.net/unix/programming/1.1.3.shtml
19:14 sri jberger: yea, but why would we want that?
19:14 sri what functionality do we gain?
19:19 sri and if you want to use _exit() for subprocess, why not for prefork and minion?
19:25 jberger I guess i would say we probably do; i wish i had written down the reasoning
19:25 jberger I thought it was something more obvious with flushing file handles
19:26 jberger But that first link makes that less obvious
19:32 dod joined #mojo
19:34 romel joined #mojo
19:42 Grinnz it also (in terms of perl) skips destructors and END, right?
19:43 pink_mist yes
19:43 jberger ah, THATS what it was
19:43 jberger Grinnz++
20:08 * jberger goes to tinker with framework benchmarks
20:19 jberger hahahaha http://perlhacks.com/2016/08/damianware/
20:55 mvorg joined #mojo
21:17 sri jberger/Grinnz: so, you think that's what we want?
21:18 jberger I believe so
21:19 sri but only for subprocesses?
21:19 jberger the windows handling I had probably isn't needed since it was only for pseudothreads
21:19 sri right
21:19 jberger I guess I can imagine people setting up objects with strange destructors or END blocks in their startup and then being confused when the minion workers trigger them
21:20 jberger its a rare case
21:20 jberger but it probably wouldn't hurt to do it there too
21:20 jberger then again, minion works for windows too right?
21:21 jberger windows meaning non wsl
21:23 sri right, minion was kinda meant to work on windows
21:23 sri it predates wsl
21:24 good_news_everyon joined #mojo
21:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v6hTZ
21:24 good_news_everyon mojo/master 036f311 Sebastian Riedel: jberger says we want POSIX::_exit(0)
21:24 good_news_everyon left #mojo
21:25 sri i guess one might argue that prefork and minion are different, since they are not meant to be embedded in huge apps with countless random 3rd party modules doing weird shit
21:30 asarch joined #mojo
21:34 Grinnz true
21:58 Adura joined #mojo
22:15 [0xAF] joined #mojo
22:20 [0xAF] Hi guys. I'm building an api with ssl authenticated clients. I've managed to setup CA and built server and client certificates. I'm recognizing the clients by their commonName. Everything is working fine with one exception. I'm starting the mojo server with cert=...&key=... params to the --listen arg. It works, but it does not recognize the clients unless I add the &ca=... parameter. I understand the reason
22:20 [0xAF] for that. Unfortunately when I add the CA param, I cannot connect to the mojo server without client certificate, it allows connections with client certs only. If I start the mojo server w/o the CA param, then I can connect w/o client certificate, but the clients are unknown, since there is no CA to validate the client certs. So my question is: Can I setup mojo with CA param, so it can recognize the clients
22:20 [0xAF] and allow the no-client-cert connections too?
22:28 [0xAF] I realize could be a net:ssleay/io::socket::ssl related issue, but I still cannot fully inderstand it. So I decided to take my chances here.
22:38 * pink_mist has no idea
22:39 meshl joined #mojo
22:39 jberger almost all of mojo's ssl handling is done by IO::Socket::SSL
22:39 jberger I'd say figure out what settings you need there and then we can see how you should be passing them through
22:39 jberger some settings are better to use with ::SSL's global defaults munging
22:40 jberger others can be passed through
22:40 [0xAF] jberger: I thought so, but I was unable to find an answer in google for the last 2 hours... I guess I've been looking at the wrong place.
22:40 jberger well, I can't say I'm an expert in what you are asking so, I can't help beyond that
22:40 [0xAF] jberger: anyway, your suggestion on IO::Socket::SSL would be my best chance, I guess...
22:44 [0xAF] jberger: just one more question: where would be the best place to put the $...::SSL variables? Would it work in the 'sub startup', or should I put them somewhere else, like BEGIN block or something?
22:44 jberger startup would probably enough
22:44 jberger I would THINK
22:45 [0xAF] ok, should try it.
22:45 jberger I actually usually avoid lots of this by letting nginx do the ssl termination
22:45 [0xAF] thanks for the pointers.
22:46 [0xAF] jberger: i'm still new to the deeper ssl stuff... i only knew the basics. i haven't thought of nginx to do my job there.
22:46 pink_mist and I let apache do the ssl termination ... but same deal =)
22:47 [0xAF] would it be possible to do the ssl client certificate authentication via nginx and still allow mojo to know which client is that and is the client authenticated or not?
22:48 Pierre joined #mojo
22:49 [0xAF] or to put it another way... is there a point to make a nginx/apache proxy to mojo at all? wouldn't it be another resource eating part of the whole scenario?
22:50 [0xAF] so far mojo seems to be able to do everything I need.
22:52 jberger well first of all, nginx can do more, like serving multiple sites from the same port
22:52 jberger also nginx can cache static files etc (even if I rarely actually use that in my own stuff)
22:52 [0xAF] yeah, that's a point, but fortunately for me, not something I need ATM.
22:53 jberger all I'm really saying is I haven't needed to delve deeply into the ssl features of the mojo daemon
22:53 jberger so I can't help too deeply
22:54 [0xAF] i see. I should probably rething my concept of it. now when you mentioned the static files. i haven't thouht of that in the matter of caching.
22:54 [0xAF] s/rething/rethink/
22:55 [0xAF] so, then, back to my previous question. do you think it would be possible to send the client certificate to mojo via nginx/apache, or at least to send the commonName, so mojo can recognize the client?
22:56 [0xAF] yes or no would be enough, i'll do my research later.
22:59 jberger I suspect if you did ssl termination at nginx then the client cert wouldn't go to the mojo server
22:59 jberger I don't know what facilities they have for inspection
22:59 genio that ^^
22:59 stokachu joined #mojo
22:59 jberger if you can inspect it on nginx you might be able to add it to the forward request as a header
23:00 [0xAF] that would be expected, i should checkout how can i pass some cert information to mojo (via headers or environment or someting)
23:00 jberger can't be environment for per-client
23:00 [0xAF] yeah, didn't thought of it.
23:01 jberger so you DO want to allow client certs to be checked, but you DONT want the lack of a client cert to block a connection?
23:01 [0xAF] yup, that's correct.
23:02 [0xAF] so there would be public methods of the api and private methods available depending on the user.
23:04 jberger maybe you could roll your own? https://metacpan.org/pod/distribution/IO-Socket-SSL/lib/IO/Socket/SSL.pod#SSL_verify_callback
23:05 [0xAF] jberger: sounds interesting, i haven't thought of that.
23:05 stokachu joined #mojo
23:08 [0xAF] jberger: you gave me some pointers to think of. thanks man, your help is highly appriciated as aways.
23:08 jberger np
23:08 jberger good luck
23:08 purl You'll need it.
23:08 [0xAF] thanks. be well, all of you.
23:37 jberger actually, I'm guessing if [0xAF] just set &verify=0x00 in the listen url it would have done most of what they wanted
23:37 jberger http://mojolicious.org/perldoc/Mojo/Server/Daemon#listen
23:37 meshl joined #mojo
23:37 jberger purl: tell [0xAD] read 'verify' at http://mojolicious.org/perldoc/Mojo/Server/Daemon#listen
23:37 purl jberger: what?
23:38 * jberger scrabbles about for purl's documentation
23:40 jberger hmmm, that shoulda worked
23:41 jberger purl: tell genio to stop working
23:41 purl jberger: what?
23:41 jberger yeah, that's not what the docs say

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