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

IRC log for #mojo, 2016-11-08

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

All times shown according to UTC.

Time Nick Message
00:05 stryx` joined #mojo
00:46 aborazmeh joined #mojo
00:56 marty_ joined #mojo
01:29 Paddi joined #mojo
03:50 noganex joined #mojo
04:27 zivester joined #mojo
05:07 parv joined #mojo
05:52 dotan_convos joined #mojo
06:02 polettix joined #mojo
06:06 Paddi joined #mojo
06:14 inokenty-w joined #mojo
06:39 dod joined #mojo
06:53 kaare joined #mojo
07:00 dod joined #mojo
07:18 jamesaxl joined #mojo
07:20 janl joined #mojo
07:20 Vandal15263 joined #mojo
07:30 jamesaxl hi
08:14 dod joined #mojo
08:35 rshadow joined #mojo
08:36 trone joined #mojo
08:38 stryx` joined #mojo
08:40 AndrewIsh joined #mojo
08:49 hydrauligsepp joined #mojo
08:59 Atog joined #mojo
09:04 skaji joined #mojo
09:42 osfabibisi joined #mojo
09:43 bc547 joined #mojo
09:48 dod joined #mojo
10:28 hydrauligsepp left #mojo
10:47 dotan_convos joined #mojo
10:59 gbhat joined #mojo
11:46 dod joined #mojo
11:58 itaipu joined #mojo
12:06 jberger jamesaxl hi
12:14 dantti_laptop joined #mojo
12:31 zivester joined #mojo
12:40 batman joined #mojo
13:06 batman joined #mojo
13:12 * sri is amazed at how much more user friendly convos has become, the installation process is great!!!
13:15 sri the install script just does a git checkout of convos, installs its deps in a local lib and everything is ready to go in under a minute
13:16 sri when you start the server it gives you a secret token, which you can use to create your account on the web ui
13:16 sri it's perfect
13:17 sri also love the new ui
13:25 aborazmeh joined #mojo
13:36 gizmomathboy joined #mojo
13:42 dod joined #mojo
13:44 vicash sri: does it take up less RAM than slack ;-)
13:45 suede sri: that's some really smooth deployment
13:45 jamesaxl joined #mojo
13:45 suede neat
13:52 jberger batman++
13:54 jamesaxl joined #mojo
13:55 batman sri: wanna mention @convosby in a tweet? :)
13:56 batman thanks a lot for the feedback! helps the development forward by knowing we have more active users.
13:57 marty joined #mojo
13:57 itaipu joined #mojo
14:00 sri batman: yes, i do
14:01 jamesaxl joined #mojo
14:03 ramortegui joined #mojo
14:16 jamesaxl_ joined #mojo
14:17 jamesaxl_ joined #mojo
14:33 dod joined #mojo
14:43 PryMar56 joined #mojo
14:48 Pyritic joined #mojo
14:54 batman thanks!
14:58 marty joined #mojo
15:01 kwa If I wanted to do some custom deserialisation of a request (based on an Accept header) and have it available to all controllers. Is my best bet to write a plugin that uses something like before_dispatch?
15:04 jberger I'm also finding the new codebase much easier to hack on
15:04 jberger (Convos codebase)
15:05 jberger I've already submitted a few bug fixes and features (not trying to toot my horn, saying it didn't take much to do it)
15:11 rshadow joined #mojo
15:16 kwa Hmm, or maybe monkey_patch Mojo::Message. :|
15:20 jberger kwa: that's basically content negotiaion
15:21 marty joined #mojo
15:21 sri literally
15:21 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Content-negotiation
15:37 kwa jberger: That's serialization? I want to deserialize the request in a different format to x-www-form-urlencoded or json.
15:39 blonewolfs joined #mojo
15:39 kwa At $work they're using a custom binary request format. I'm looking at the possibility of rewriting it in Mojo, and deserializing the request to be used in controllers in a similar way to $c->req->json, but as $c->req->customfmt->param('...').
15:41 sri you said Accept
15:41 sri that implies serialization, not deserialization on the server side
15:43 sri just make a helper
15:43 kwa Ah, sorry.
15:45 kwa Right. I suppose it doesn't even need to be a hook. It just accesses Mojo::Request directly. Ta.
15:49 mcsnolte joined #mojo
15:54 blonewolfs i'm getting autoload warnings for a plugin i created.  when i initially created the plugin and used anonymous subs ($app->helper(access_db => sub {...}) i didn't get the warnings.  but, when i register my subs with references ($app->helper(access_db => \&access_db_cb);) i get the warnings.  what is the correct way to do this so i don't fill my logs with noise?
16:47 PopeFelix joined #mojo
17:03 rshadow joined #mojo
17:05 PopeFelix joined #mojo
17:37 dantti_laptop joined #mojo
17:39 pink_mist https://pbs.twimg.com/media/Cvy5AzUW8AE-0p_.jpg
17:40 jberger au revoir escape key
17:50 disputin joined #mojo
17:56 dod joined #mojo
18:12 rshadow joined #mojo
18:17 * tempire remapped vim escape functionality to "jj" half a decade ago
18:21 Jonis I've taken a shine to VS code
18:26 genio I've been using Atom for so long, VS code doesn't seem useful to me
18:27 genio I mean, it doesn't do anything better than Atom as it's simply an Atom clone. It doesn't behave as an IDE for .NET code, so Xamarin is needed anyway.
18:28 trone joined #mojo
18:28 genio If they're looking to have a Notepad replacement, then yea, it's nice for that.  Otherwise, I'm not quite sure what market they're trying to capture
18:29 Grinnz i so rarely have to edit code in windows that i still just have notepad++ sitting around for that
18:29 genio I use Atom everywhere.  Sometimes I use Notepad++ (when opening a file straight from WinSCP or something)
18:31 Grinnz i probably would be using atom, if fedora ever got around to packaging it
18:31 Grinnz but so far gedit hasn't pissed me off enough :P
18:32 Grinnz i actually quite like gedit once you enable all the code editing style options, i just hate the new gnome 3 window layout
18:33 genio I don't mind having multiple editors to use, don't get me wrong.  I just don't quite understand the point of modifying Atom a bit and calling it VS Code.
18:48 jberger anyone have a javascript url library like Mojo::URL that they like?
19:03 genio None that I like.  Then again, Mojo::URL has spoiled me.  I have a hard time going back to URI
19:04 genio https://www.npmjs.com/package/jsuri might come the closest
19:04 Pyritic joined #mojo
19:05 stephan48 yea
19:30 mishanti1 Emacs is pretty neat. I like that I can make things for my editor just as I want.
20:02 dave yay Emacs! :D
20:04 jberger both emacs and vim are essentially near infinitely malleable as long as you can program in one of a few arcane languages
20:04 * jberger uses vim and a more and more tricked out vimrc
20:04 * jberger hugs VAM
20:04 * Grinnz uses nano because it mostly does what i want already
20:05 pink_mist nobody wants to program in vimscript, surely
20:05 sri i want a vim in an atom shell
20:05 sri sadly vim mode for atom is just not good enough yet
20:12 gryphon joined #mojo
20:13 rshadow joined #mojo
20:16 mishanti1 I was super-sceptical when I was recommended Emacs. It was when I realized that it is a very "unassumptious" (guess that's not a word) editor, that sort of expect you to know how you want thing.
20:17 mishanti1 .. that I was sold.
20:17 mishanti1 With my brain I can clearly not eat a pear and type at the same time.
20:37 janl darnit
20:42 janl need to set the inactivity timeout in a mojo app
20:43 batman janl: https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#inactivity_timeout
20:51 suede batman janl I'm curious as to what for- Can't you call $c->render_later and the inactivity timeout doesn't matter?
20:51 suede (i'm maybe not as familiar with the internals of mojolicious as I should be)
20:51 janl I am totaly unfamilliar
20:52 janl I figured that my app class can do $ENV{MOJO_INACTIVITYTIMEOUT} = 120;
20:52 Grinnz suede: no, inactivity timeout will still apply
20:52 janl curiously MOJO_INACTIVITYTIMEOUT does not seem to occur in the mojo source code
20:52 janl but it still works
20:53 Grinnz MOJO_INACTIVITY_TIMEOUT
20:53 batman suede: "inactive timeout" means how long you can be inactive
20:53 Grinnz it definitely should not work without that underscore
20:53 janl yeah sorry
20:54 janl ./lib/R2D2.pm:$ENV{MOJO_INACTIVITY_TIMEOUT} = 120;
20:54 batman so it doesn't matter what if you render later or not. it depends on how long it goes between not transmitting data over the socket
20:54 jberger render_later prevents automatic rendering for non-blocking responses
20:54 janl my app needs to map out some network things
20:56 suede ahhh
20:56 janl takes a while
20:56 suede jberger: that makes more sense
20:57 Grinnz render_later tells the renderer "oy, I'm not done yet!"
21:01 suede Grinnz batman jberger: thank you for enlightening me
21:02 jberger np
21:05 Gedge joined #mojo
21:11 tyldisc joined #mojo
21:55 tyldisc joined #mojo
22:01 polettix joined #mojo
22:06 sri oh, i forgot to tweet about convos
22:09 tyldisc Testing it out. Takes a while to migrate my mind from irssi
22:10 sri i like to take a look at irc from my phone every now and then
22:11 tyldisc My use case as well
22:25 sri ok, i tweeted :)
22:35 * genio can't get the demo to work :/
22:39 sri works for me
22:40 sri so, clinton is gonna win with a huge lead according to my twitter stream
22:41 sri guess half of the trump voters were just trolls
22:41 Grinnz sri: http://projects.fivethirtyeight.com/2016-election-forecast/ has a good overview of the probabilities
22:42 Grinnz http://projects.fivethirtyeight.com/2016-election-forecast/#scenarios
22:43 Grinnz we'll start seeing in a few hours what's possible...
22:45 sri muhahahahahaha
22:45 sri https://www.donaldjtrump.com/press-releases/archive/We%20are%20a%20literal%20trashcan%20dumpster%20fire
22:46 sri wow, they fixed it the moment i linkted it
22:46 sri should have linked the tweet with screenshot https://twitter.com/mathowie/status/796119622542102529
22:47 sri running that site has to be a total nightmare today
22:58 jberger the browser websocket api can't set headers ...
22:58 jberger ...
22:58 jberger ...
22:58 jberger sigh
22:59 suede jberger: It's okay, I wrote a websocket implementation that can't set headers either
22:59 suede And you just informed me that wait, maybe i should
22:59 jberger we are doing header auth to the api
23:00 suede jberger: i wasn't even aware that you /could/ do that
23:00 jberger well, at least in the browser, you can't :-P
23:00 jberger query parameters work though
23:00 jberger you can do nice things with that
23:00 suede jberger: My WebSocket API kind of allows you to do stuff like that
23:01 suede It's a transactional system that lets your WebSocket resource accept a query parameter that it takes and routes you to a given transaction
23:02 suede the transaction can hold N amount of users, and can be either stateful or stateless, i leave it up to the developers
23:02 suede it's capable of returning results of long-running operations or doing high-traffic stateful stuff like games
23:03 jberger but what good does it do you if the browser can't handshake with a header for auth (if that's how you do auth)
23:03 suede jberger: the transaction key CAN be the auth though
23:03 suede For instance, I store transaction keys sometimes in the users session, or in a database associated with a user
23:03 jberger sure, if you make auth part of your protocol
23:03 suede no, hear me out
23:03 suede it uses query parameters for authentication (if you design it that way)
23:04 suede The query parameter is the transaction key
23:04 suede Sorry, I'm doing really poorly at explaining this
23:04 suede I suppose I'll just show you an exaple
23:04 suede example*
23:04 suede It makes more sense when you see it in code
23:04 Grinnz sri: hahahaha
23:04 purl LOLCON 4 reached.
23:06 suede jberger: When a user makes a request to a route in my application, I can generate a transaction key unique to them, associate it with their session, add a Transaction object to my TransactionManager, which is used by the actual websocket resource to find the correct transaction to route a websocket connection to
23:06 suede and I pass the transaction key to my templates or whatever code
23:06 suede and it generates
23:06 suede ws://site.com/ws/resource/here?key=<transaction key>
23:06 suede And I can preload the transaction with whatever data it needs to uniquely identify the user
23:06 suede Does that make sense?
23:07 suede The transaction is essentially a container for whatever data you want to store on it, and the protocol objects that actually handle a users connection
23:07 suede https://github.com/systocrat/orbit
23:08 suede jberger: classes to look at to see what I mean are the transaction manager here: https://github.com/systocrat/orbit/blob/master/orbit/transaction.py#L75
23:09 suede and this class here https://github.com/systocrat/orbit/blob/master/orbit/resource.py#L22
23:09 suede You provide a lookup function (which can be anything, not just the TransactionManager) which routes the users WSProtocol instance that gets created, and associates it with the transaction you want to associate it with
23:09 jberger I mean, I don't think we are talking about the same things here at all
23:10 suede jberger: I feel like I'm explaining it badly, but I do understand your needs
23:10 jberger I can use a query parameter to pass handshake arguments
23:10 suede You want implicit authentication over HTTP instead of having to do it on the websocket protocol level
23:10 suede Right?
23:10 jberger I don't know if implicit is the word I'd use
23:10 jberger I want to use the handshake
23:11 jberger that's rather explicit in my mind
23:11 jberger I don't want to upgrade unless the client is authorized
23:11 suede Ahhhhh, okay
23:11 suede I understand
23:11 jberger I already have a multiplexing layer
23:12 jberger and it has all kinds of hooks for other things
23:12 suede jberger: I could probably change my WebSocketResource to have an authentication layer similar to the one you want, but you're right, I didn't quite get what you meant
23:12 jberger but before I get there, and before the client has access to it, I want a rough cut to prevent totally unauthorized users to get there
23:12 suede Right.
23:12 jberger no worries
23:12 suede I think I'm actually going to add something like that
23:12 suede soon(tm)
23:12 jberger hehe
23:12 jberger did I show you my multiplexer?
23:13 suede no, but I'd sure like to see it :)
23:13 jberger I can't remember who i've talked about it with
23:13 jberger https://metacpan.org/pod/Mojolicious::Plugin::Multiplex
23:14 suede oh, that's cool
23:14 jberger I extend a protocol proposed here: https://www.rabbitmq.com/blog/2012/02/23/how-to-compose-apps-using-websockets/
23:14 suede I've written some of my own libraries specifically for binary TLV protocols, both on the server and client side
23:15 suede I don't really like the way multiplexers like yours and socket.io work, but it's just a personal preference, and I recognize why others like them
23:15 suede Yours is probably the cleanest API i've seen
23:15 suede Especially on the perl side
23:16 suede If I end up needing WebSockets in a Mojolicious app I'll probably use it
23:18 jberger I had several ideas before someone, I think sr i (not highlighting him unnecessarily), pointed out that sockjs proposal
23:18 jberger implementing it was easy enough but it had holes, so I extended it
23:19 suede jberger: an extensible authentication layer would probably be a welcome addition to it
23:27 jberger why? use the handshake
23:28 suede jberger: I meant for the handshake :>

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