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

IRC log for #mojo, 2016-07-25

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

All times shown according to UTC.

Time Nick Message
00:08 itaipu joined #mojo
02:14 Newbee joined #mojo
02:42 noganex_ joined #mojo
02:56 kaare_ joined #mojo
04:20 ivi joined #mojo
04:25 ivi joined #mojo
05:12 ningu joined #mojo
05:21 ashimema joined #mojo
05:33 inokenty-w joined #mojo
05:42 cpan_mojo Mojolicious-Plugin-RoutesAuthDBI-0.783 by MCHE https://metacpan.org/release/MCHE/Mojolicious-Plugin-RoutesAuthDBI-0.783
05:42 Bender DAHUUT!!
05:43 cpan_mojo Mojolicious-Plugin-OAuth2-Che-1.539 by MCHE https://metacpan.org/release/MCHE/Mojolicious-Plugin-OAuth2-Che-1.539
05:50 che-quest joined #mojo
06:32 dod joined #mojo
06:53 dod joined #mojo
06:58 dod joined #mojo
07:01 mbudde joined #mojo
07:16 Vandal joined #mojo
07:17 AndrewIsh joined #mojo
07:26 trone joined #mojo
07:27 Grinnz https://www.youtube.com/watch?v=bqm9HSYbf0o&feature=youtu.be
07:31 ksmadsen joined #mojo
07:35 pink_mist Grinnz: "This video is not available" =(
07:37 trone joined #mojo
07:38 Grinnz wat? its the trailer for the new star trek series
07:39 pink_mist weird
07:40 pink_mist they don't want swedes to see it =(
07:40 Jonis :/
07:40 Jonis Not available in Norway either
07:41 pink_mist I bet it's because they think we're all dirty pirates and will ... uh ... make the trailer freely available given half a chance?
07:42 * pink_mist thinks his logic circuit may need a bit of work
07:42 pink_mist this calls for coffee
07:57 irctc506 joined #mojo
08:06 dod joined #mojo
08:32 elrey joined #mojo
08:32 osfabibisi joined #mojo
08:35 ivi joined #mojo
09:15 elrey hey, i'm having a problem, maybe you guys could give me a hint.. im using mojolicious as an rest api, what should i do, when i need to use code parts like controllers, from server to server.. without going out to the web. I found this - http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Application-embedding, but cant figure out how to actually use it
09:27 cpan_mojo Mojolicious-Plugin-OpenAPI-0.03 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-0.03
09:56 elrey i mean, get data from the api from other code base, on the same serverv
09:59 nic doesn't sound like you even need app embedding for that
10:00 nic elrey: You haven't given any hints as to what's stopping you calling the api
10:08 cuechan joined #mojo
10:10 elrey nic: nothing actually is stopping me, i can send regular HTTP request to get my responses, but the other code base is on the same server, i want to be able to use the code of the API.. if that makes sense
10:12 dod joined #mojo
10:12 nic sounds like the plan is even worse than those people who want to call other actions from within the same app
10:16 elrey thank you
10:21 elrey anyway, i dont see how reusing code is wrong. if someone understood what i meant and can give me a hint that would be great :)
10:31 diegok elrey: if you need to share code on several apps, being on the same box or not, the best way is to put that code on a library and use that library on both apps...
10:32 diegok elrey: if that shared functionality needs to use mojo-things, then that library will probably be a mojo plugin
10:32 diegok elrey: I can't be more specific without real examples of your needs o/
10:51 ningu joined #mojo
11:14 tchaves joined #mojo
11:15 cuechan_ joined #mojo
11:21 Atog joined #mojo
11:27 Kripton joined #mojo
11:32 pink_mist diegok++ # couldn't have said it better even if I tried
11:32 tchaves joined #mojo
11:34 elrey diegok: got it, thanks
11:41 tchaves joined #mojo
11:48 dotan joined #mojo
12:00 kid51 joined #mojo
12:04 Kripton joined #mojo
12:15 blonewolfs joined #mojo
12:34 ribasushi joined #mojo
12:35 ptolemarch joined #mojo
12:38 tinita hi, i would like to store mojolicious sessions in a database; i saw Mojolicious::Plugin::Session, but it says: "Embedded Mojo sessions are recommended for using instead of this module."
12:39 tinita is Mojolicious::Plugin::Session still supposed to work?
12:39 tinita i haven't tried it out yet, thought i better ask
12:40 tinita last upload was march 2015
12:49 marty joined #mojo
12:49 neilhwatson joined #mojo
12:54 nic tinita: Just a suggestion from the sidelines...  The most common way to do that is to copy the pk from the db into the user's Mojolicious (cookie-based) session
12:55 nic That way is very lightweight and versatile.  For example, there is then abs no restriction on how you access the db, what the db structure looks like, or what the db eve is (eg redis, mongo, mysql, postgres, oracle, ...)
12:55 nic s/eve/even/
12:56 tinita nic: hm, i also thought about sth. like that
12:56 Kripton joined #mojo
12:57 tinita so i would do all the db handling myself, and mojolicious will take care of the session stuff like always
12:57 sri that's how it's done most commonly
12:59 tinita thanks
12:59 sri often also allows you to avoid storing serialized blobs in databases
12:59 nic Let's say you're using Mojolicious::Plugin::Authentication.  Then you pass it a ref to a routine that loads the user (from your db)
12:59 gizmomathboy joined #mojo
13:00 tinita authentication is a bit more complex, so i'm not using that plugin
13:01 nic May I ask why not?  (just curious)
13:01 tinita well, i would have to take a closer look at the plugin, i guess
13:02 nic it's very versatile.  My only criticism is it's more versatile (with more indirection) than I need.  Something simpler would be easier to understand (and validate) and I'm guessing would satisfy 95% of the use cases out there
13:03 tinita one thing is, a user can login with something other than their username
13:04 nic The main app I use it for authenticates users against a centralised LDAP server(s).  If that call fails it authenticates against the app's local db.  Loading user data follows a similar logic
13:04 tinita and also the password depends on that
13:04 nic It can handle that
13:05 sri Grinnz: not available in germany
13:05 nic you give it a ref to a routine that says whether the user passes your authentication tests or not
13:05 tinita hm
13:06 nic tinita: that plugin is essentially a skeleton that you add your app-specific flesh to
13:06 tinita but the username that ends up in the session will not be what the user typed in to authenticate
13:06 nic that's ok
13:07 nic For 'does this user pass your login tests' you'll get what came from your login form
13:07 nic For 'is this user still logged in' you'll get what came from their cookie
13:08 tinita i see now that i return the uid in validate_user
13:08 nic yeah
13:08 cpan_mojo Mojolicious-Plugin-OpenAPI-0.04 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-0.04
13:08 nic so you could receive user_name and passphrase and you return user_id (from your db)
13:09 nic The plugin also supports a third input field (which can help in some single sign-on situations) but I haven't needed to use that so far
13:10 zivester joined #mojo
13:10 tinita at the moment I wonder when using that plugin, what kind of code do I not need anymore
13:11 nic I agree.  Figuring out how to make most efficient use of it is the biggest hurdle to adopting it into a project
13:11 * sri thinks Mojolicious::Plugin::Authentication makes things more complicated
13:12 nic just what I was saying above :)
13:12 tinita =)
13:13 nic My top tip, regardless of whether you use that plugin or not....  Clearly separate controller logic (the actions handling your gets & posts) from utility logic (the methods that flag authentication and load users)
13:14 ssm http://no-one-uses-email-anymore.com/the-trinity-of-email-protection-lessons-learned-using-dmarc-dkim-and-spf-in-office-365/
13:14 tinita nic: yes, it's already seperated
13:14 nic cool
13:15 Lee M::P::Authentication just adds a couple of helpers, it's debatable how much value it brings IMO
13:15 Lee TBH this is no different from quite a few plugins
13:57 Janos joined #mojo
14:07 mcsnolte joined #mojo
14:10 elrey diegok: how can a non-mojo app communicate with a mojo plugin?
14:14 cuechan joined #mojo
14:21 PopeF joined #mojo
14:26 tinita nic: actually, i have to add the string with which the user logged in, to the session also, so i guess i'll go without the plugin
14:41 ningu joined #mojo
14:42 AirDisa joined #mojo
14:44 nic elrey: Sometimes you can give it a dummy app: Mojolicious->new(moniker => 'something')
14:44 nic but things like 'log' won't be set up, so often that's not what you want
14:45 nic tinita: Thanks for sharing; was an interesting discussion
14:50 sri don't forget to get your windows 10 upgrade in the next few days
14:51 Grinnz http://memesvault.com/wp-content/uploads/How-About-No-Meme-Dr-Evil-01.png
14:54 nic One of the things I miss from the old morbo was it showing its invocation (commandline) as its 'command' in the (linux) process list
14:54 nic I'm guessing there's no way to getting that back?
14:55 nic One of our dev boxes has lots of (independent) morbo processes
14:55 sri was there a change?
14:55 nic It used to be trivial to see their invocations, for example what port each was listening on
14:56 nic I think the change may have happened around the time there was the latest big improvement for Windows users
14:56 nic or was morbo brought into line with the other daemons, eliminating some morbo-specific code?
14:57 nic I need to leave the office in 2 mins, but maybe I can have a proper dig tomorrow
14:58 nic For example, the processlist commandline would include the string 'morbo' along with the options passed
14:58 nic But now it is just 'script/myapp'
14:59 nic btw, this isn't new to v7
14:59 zivester joined #mojo
14:59 Grinnz Yeah I saw the same change
15:00 Grinnz don't remember when it happened
15:07 ningu is there no way for me to give access to www-data to a single file (so it can write hypnotoad.pid) without giving it access to the whole app directory? I suppose I can make a subdir owned by www-data
15:12 ningu apparently not. also, pid_file can't be relative, so 'run/hypnotoad.pid' doesn't seem to work
15:17 cuechan joined #mojo
15:31 PopeF0 joined #mojo
15:54 cpan_mojo Mojolicious-Plugin-AssetPack-1.18 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.18
16:02 dvinciguerra_ joined #mojo
16:09 asarch joined #mojo
16:27 gizmomathboy joined #mojo
16:36 PryMar56 joined #mojo
16:39 sri oh, chrome 52 is finally out
16:39 sri so much faster on os x
16:45 sri btw. it's really great to see how many more remote jobs there are in the perl world these days
16:47 sri germany is way behind on that
16:48 sri suppose non-san francisco companies in the us have to offer it to be competitive
16:50 ningu joined #mojo
16:51 bjakubski "sorry, us-only" is what I got :)
16:51 sri yea, there's some of those too
16:51 sri craigslist is like that
16:52 sri and i think maxmind too
16:52 bjakubski ziprecruiter
16:52 sri ah, i wanted to look at them too
17:00 peoplecanfly joined #mojo
17:00 peoplecanfly Ola
17:01 sri people can't fly
17:02 ningu they can if aided by machines
17:02 tinita i can fly
17:02 peoplecanfly Of course can fly.
17:02 tinita bit there's a problem with landing
17:02 sri witch!
17:02 ningu flies can people
17:02 Vandal people can kill a fly
17:02 tinita s/bit/but/
17:03 ningu tinita: aim and the ground and miss
17:03 ningu at*
17:03 tinita ningu: =)
17:04 Grinnz_ not flying, but falling with style
17:08 zivester joined #mojo
17:11 PopeF joined #mojo
17:20 diegok elrey: well, if you need to share functionality between mojo apps and non mojo apps you probably want to move that code into plain perl libs (use mojo::base, Moo, Moose or just export a bunch of funcs, whatever fits your solution) and then you can use that from non mojo apps and from mojo apps. If that code need a lot of mojo-app glue code and/or will be used by many mojo apps, you probably want to create a mojo plugin that uses that librar
17:20 diegok y.
17:24 diegok elrey: ^ if plugins doesn't fit well in your solution you can also use controllers base classes or whatever other composition schema you can think in perl...
17:41 jberger Almost all code reuse problems in mojo land seem to fall into two categories
17:42 jberger (1) wanting to reuse "global" objects like db (especially connection logic) logging or configuration
17:42 jberger (2) wanting to reuse things that really should be business logic/model layer
17:46 jberger For (1) application embedding had always worked well enough for me
17:47 jberger For (2) you want to factor out your model and attach it back into your app via helpers
17:48 jberger Then you can as easily include them elsewhere too
17:56 dvinciguerra joined #mojo
18:18 lluad joined #mojo
18:30 lluad joined #mojo
18:42 Psiman joined #mojo
18:56 dod joined #mojo
18:56 PsimanX2 joined #mojo
19:19 punter joined #mojo
19:36 nic That's probably good advice, jberger, but you're just too late -- we all went to bed about half an hour ago
19:36 nic :D
19:37 nic Are you getting ready to head to a more advanced timezone or are you already there?
19:37 nic Watched Live Die Repeat yesterday.  Liked it
19:40 Kripton joined #mojo
19:51 cuechan joined #mojo
19:53 Janos hey there guys, wanted to thank you for all the help specially from sri and jberger and to let you know that a new OSS was born out of that help, https://github.com/albatrostech/asr
19:53 * Janos cheers
19:53 Janos AngularJS + Mojolicious
19:54 sri \o/
20:07 cpan_mojo Mojolicious-Plugin-WebFinger-0.07 by AKRON https://metacpan.org/release/AKRON/Mojolicious-Plugin-WebFinger-0.07
20:08 ptolemarch joined #mojo
20:10 punter I also do AngularJS + Mojolicious
20:22 zivester joined #mojo
20:26 ningu joined #mojo
20:50 punter joined #mojo
21:02 romel batman: hi. does Swagger2 support splitting api spec into separate files? i'm having difficulties with referencing in my case
21:40 stryx` joined #mojo
21:51 batman romel: yes. by using "$ref":"...". please ask in #swagger for more details
22:00 PopeF How does one do Basic authentication in Mojo::UserAgent 7.0?
22:03 Kundun https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Cookbook.pod#Basic-authentication doesn't work?
22:03 PopeF Kundun, thanks
22:04 PopeF I had been using Mojo::URL->userinfo('foo:bar')
22:04 PopeF Which no longer works.
22:06 Grinnz_ the userinfo method hasnt changed, but userinfo won't be rendered in the resulting URL, so it probably never gets to the part that generates an authorization header
22:07 PopeF Grinnz_, that's my suspicion as well.
22:07 Grinnz_ personally, I would just add the authorization header, it's just b64_encode('foo:bar', '')
22:08 Grinnz_ er, "Basic " followed by that
22:08 PopeF Grinnz_, can't do that. It's in a test for Mojo::UserAgent::Mockable and i'm showing that changing the userinfo will throw an "unrecognized request" error.
22:12 Grinnz_ maybe that "extract userinfo for authorization header" handling needs to be updated to check if it's a Mojo::URL, and if so, extract the userinfo by attribute?
22:13 PopeF That would be good.
22:13 Grinnz_ without stringifying
22:17 sri Grinnz_: where?
22:18 Grinnz_ referenced in that cookbook example
22:18 Grinnz_ don't know where it happens in the code
22:18 sri Grinnz_: umm, that still works flawlessly
22:18 sri that url is never stringified
22:19 Grinnz_ PopeF: maybe you're stringifying it somewhere by accident?
22:22 dotan joined #mojo
22:26 good_news_everyon joined #mojo
22:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vKQTS
22:26 good_news_everyon mojo/master d87c59f Sebastian Riedel: no need to check the URL so early
22:26 good_news_everyon left #mojo
22:30 lluad joined #mojo
22:34 sri allright, now i hate bernie sanders too
22:37 mishanti1 sri: Yeah, perhaps the only candidate that seemed to have at least a smidgeon of integrity broke as well.
22:39 sri YOU WERE THE CHOSEN ONE!
22:41 mishanti1 So much for that...
22:41 sri darth bernie
22:44 mishanti1 related: http://imgur.com/gallery/OxfDJ
22:44 sri :)
22:45 sri i think he just got trump elected
22:45 mishanti1 Possibly.
22:46 mishanti1 I do not agree with Trumps views, but Hillary is one _scary_ prospect for president. I would not wish to live in a world where she was President.
22:47 sri both are terrible choices
22:47 mishanti1 Indeed.
22:48 sri plutocracy or fascism
22:49 mishanti1 The good thing is that with more and more bonds and other trades moving away from being US$-bound the world will be less affected by whatever crazyness happens in the US.
22:52 ribasushi joined #mojo
22:57 _dave_ presidents and countries are obsolete. It's a googlocracy. ;)
23:05 disputin joined #mojo
23:10 dvinciguerra joined #mojo
23:12 zivester joined #mojo
23:35 marty joined #mojo

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