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

IRC log for #mojo, 2015-10-06

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

All times shown according to UTC.

Time Nick Message
00:01 KimmoNO__ left #mojo
00:03 good_news_everyon joined #mojo
00:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcQbw
00:03 good_news_everyon mojo/master cca80a6 Sebastian Riedel: update Changes
00:03 good_news_everyon left #mojo
00:04 sri Zzz
00:22 panshin joined #mojo
00:27 aborazmeh joined #mojo
00:50 Grinnz aha! pesky <DATA>
01:08 zivester joined #mojo
02:12 kaare joined #mojo
02:23 panshin joined #mojo
02:29 noganex_ joined #mojo
03:38 aborazmeh joined #mojo
04:25 panshin joined #mojo
04:27 inokenty-w joined #mojo
04:54 davido_ joined #mojo
04:56 melo joined #mojo
05:02 KindOne joined #mojo
05:04 btyler joined #mojo
05:55 dod joined #mojo
05:57 aborazmeh joined #mojo
06:00 Lee joined #mojo
06:01 dod joined #mojo
06:04 zivester joined #mojo
06:09 panshin joined #mojo
06:42 Vandal joined #mojo
06:55 Gedge joined #mojo
06:55 AndrewIsh joined #mojo
06:56 berov joined #mojo
07:08 jontaylor joined #mojo
07:37 trone joined #mojo
07:37 asm35 joined #mojo
07:37 berov joined #mojo
07:39 panshin joined #mojo
07:42 sue joined #mojo
07:44 panshin joined #mojo
07:45 jontaylor joined #mojo
07:49 CandyAngel Okay.. let's try migrating this script to use DBIC >.<
07:54 sugar joined #mojo
07:57 panshin joined #mojo
08:00 eseyman joined #mojo
08:40 berov joined #mojo
08:51 nic sri: "do not depend on the input record separator" -- does that change have a measurable performance impact?
08:52 eseyman c
08:52 eseyman sorry, my bad
08:53 nic KICK HIM!!!
08:53 nic oh, he did apologise
09:02 meshl joined #mojo
09:15 damaya joined #mojo
09:17 damaya I have a list of proxies, and I am doing something like this: while (<>) { $ua->proxy->http($_)->https($_); say $ua->get($url)->res->dom->at('div#ip'); }
09:17 damaya Now, div#ip contains the IP address detected by the site, but the IP never changes, even though each line of the file has a different proxy.
09:19 damaya If I create a Mojo::UA object in the while loop, the IP does change. So, I assume that proxy is immutable once set?
09:19 berov left #mojo
09:19 sugar joined #mojo
09:21 berov joined #mojo
09:27 melo joined #mojo
09:27 absolut_todd joined #mojo
09:29 Martin90 joined #mojo
09:32 gaunt joined #mojo
09:34 panshin joined #mojo
09:39 cpan_mojo Swagger2-0.58 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.58
09:40 sri nic: no
09:41 nic cool
09:42 gorfel joined #mojo
09:43 absolut_todd joined #mojo
09:48 jontaylor joined #mojo
09:54 sri that new doze feature in android 6 is pretty great, my nexus 5 now has 8 days of standby time \o/
09:55 sri only lost 3% over night
09:57 nic I'm looking forward to having more control over data->apps
09:57 sri that's nice too
09:57 nic recently a lot of apps are demanding irrelevant privileges (eg which numbers are calling me)
10:09 jontaylor joined #mojo
10:12 mattastrophe joined #mojo
10:19 CandyAngel DBIx::Class is slow. Wonder what I'm doing wrong..
10:19 * nic tries to guess
10:19 bd nic: can i now reject a privilege for an app?
10:19 CandyAngel I'm only getting like.. 3000 inserts/second
10:20 mishanti1 CandyAngel: Compared to expected qps that is?
10:20 sri that number means nothing without context ;p
10:20 CandyAngel At least 23000/s
10:20 CandyAngel http://stackoverflow.com/questions/1711631/improve-insert-per-second-performance-of-sqlite
10:21 CandyAngel I have it wrapped in a transaction (using the scopeguard thing)
10:21 mishanti1 CandyAngel: When doing inserts you might try to use populate() instead of inserts. MUCH faster.
10:21 mishanti1 populate() instead of insert() I mean.
10:24 ribasushi CandyAngel: do you have fsync turned off?
10:24 CandyAngel Yeah.. but that means holding all the imported data in memory first.. which makes the transition to using a database a bit pointless :P
10:24 CandyAngel (it already holds everything in memory)
10:24 CandyAngel Err.. in the current version
10:25 ribasushi CandyAngel: https://metacpan.org/pod/DBD::SQLite#Performance  /   on_connect_do => 'PRAGMA synchronous = OFF'
10:25 Shaeto joined #mojo
10:25 Snelius joined #mojo
10:26 CandyAngel Oh, wait a second
10:27 CandyAngel Duh, I'm timing the entire script running, that time might be setup time
10:28 rangelge joined #mojo
10:28 CandyAngel Okay, setup time is like.. 1.2 seconds
10:28 CandyAngel So with synchronous OFF, I get 4800/s
10:29 CandyAngel Or, if I could maths correctly, 7500/s >.<
10:29 CandyAngel (6000 in 0.8 seconds)
10:30 ribasushi CandyAngel: beyond that you are likely hitting slowness in the SQL generator, this is being worked on as we speak, but even then won't likely reach what you would do with plain DBI
10:31 CandyAngel Okie
10:31 ribasushi CandyAngel: NYTProf it with 'clock=2' to be sure
10:31 CandyAngel WIll do
10:32 cpan_mojo Mojo-Pg-2.12 by SRI https://metacpan.org/release/SRI/Mojo-Pg-2.12
10:32 CandyAngel This isn't speed-sensitive, it is just that it is a lot slower than the second-to-worst-case in those tests I linked
10:32 ribasushi CandyAngel: basically you are hitting a spot where the convenience tradeoff is biting you, it will slowly improve, but given the amount of use-cases it needs to cover it's tricky to get it on par with raw DBI
10:32 CandyAngel (and it's much closer to the worst than the second worst :/)
10:32 CandyAngel ribasushi: Mhm, I totally understand :)
10:33 CandyAngel This is literally just the first step to converting from objects held in memory into a database
10:33 CandyAngel So the tradeoff will improve as I migrate everything anyway
10:34 CandyAngel Especially in code readability.. it's errr.. messy :P
10:34 sri do mojo sessions not work on ios9? Oo
10:35 CandyAngel bpmedley: Also, I'm really sorry that I didn't test your UI thing last night. I had no motivation or desire to do anything at all once I got home >.<
10:35 sri this sounds odd https://groups.google.com/forum/#!topic/mojolicious/DuBio6BGlXc
10:36 Snelius joined #mojo
10:38 rangelge left #mojo
10:40 mishanti1 sri: We've seen the same behaviour, but on windows and using IE. Ran into the isse when the servers clock ("server" being a virtual dev-machine) was a little off what it was supposed to be. The client then silently drops cookies.
10:41 bd hm, die pi 1 doesn't habe a hardware clock
10:41 mishanti1 So for us the issue was not _mojo_ but rather just a systems thing.
10:41 bd have even
10:41 mishanti1 Might be the same thing that guy is experiencing. The raspberry is horrible at keeping time.
10:42 mishanti1 win 41
10:42 mishanti1 gah..
10:44 Martin90 what you mean by "was a liitle of.." ?
10:45 mishanti1 Martin90: We frequently saw one particular virtual machine slipping behind (as ntp wasn't running). Also sometimes it would be corrected when the virtual machine detected changes in what it thinks is the hw-clock.
10:47 mishanti1 But when the vm's time was corrected all sessions were nuked.
10:47 Martin90 mhm
10:48 Martin90 is thera an option to change time sorce to i.e internal timmer ?
10:48 Martin90 in Rosberry Pi
10:49 mishanti1 Martin90: I would be aggressive with ntp, or better yet get a RTC board.
10:50 mishanti1 Martin90: If you've got a GPS you can use that.
10:52 Martin90 I don't have too much experience with those "high level' uC rather prefere low level ones like AVR Atmega ;)
11:05 bpmedley CandyAngel: Totally fine!  Thanks for considering the app; perhaps motivation will realize itself soon.
11:07 dvinciguerra joined #mojo
11:13 CandyAngel I think I just need to do something new. All the projects I have right now are things I've tried before
11:14 CandyAngel So I'm learning DBIx::Class while I'm at work, as I haven't used that for a long time
11:14 Martin90 bpmedley, you should definitely add code sharing to liveperl, people can paste and share their code using your app...
11:14 CandyAngel ANd when I get home.. maybe some woodworking? Idunno
11:14 bpmedley Martin90: Thanks for the idea and support.
11:15 nic Martin90++  # want it now :)
11:18 Martin90 no problem, I see potential in it but really, code sharing is necessary next step ;)
11:42 panshin joined #mojo
11:44 jontaylor joined #mojo
12:03 trone joined #mojo
12:06 kaare joined #mojo
12:15 tcohen joined #mojo
12:20 CandyAngel Sometimes, I want to have my own company just so I can not be a jerk to my employees >.<
12:21 nic CandyAngel: Tell me truthfully, have you, at any point today, been a jerk to an employee of yours?
12:24 CandyAngel I have not
12:24 CandyAngel That I know of
12:24 nic there
12:24 nic much cheaper and much less trouble than having your own company :)
12:24 nic only works with Classical logic mind you
12:25 CandyAngel Yeah, but that's like telling your only friend that they are your best friend
12:25 CandyAngel They are also, be definition, your worst friend too
12:25 nic I don't tell them the second bit
12:25 CandyAngel I want someone to benefit for my lack of jerkiness
12:25 CandyAngel from my*
12:25 nic ah, you need a constructive logic for that
12:28 CandyAngel Company that my friend works for it going through (another, because holy nonpredictivepowers batman!) redundancy cycle
12:28 CandyAngel And they are basically int($yearsworked) to calculate how much redundancy pay
12:29 CandyAngel So if you have worked 3.9999999 years, you get 3 years redundancy pay, not 4
12:29 CandyAngel ANd it gets even better
12:29 CandyAngel It is possible to get 3 years pay, even if you have worked 4.0001 years
12:30 CandyAngel Because it is done from the start of the cycle, not when they actually stop working :|
12:30 CandyAngel Apparently anyway
12:33 ajr_ joined #mojo
12:35 CandyAngel Which wouldn't be so bad if they didn't announce record profits the next year :P
12:35 pink_mist clearly the laying off helped :P
12:35 pink_mist (err, if that's even what you're talking about? :P)
12:37 CandyAngel Yeah
12:39 CandyAngel That company seems to have no idea how to actually look at data and make even semi-sane targets
12:40 CandyAngel For example, they will set a target for a 5% ongoing reduction in errors (from the maximum ever) month-to-month
12:40 CandyAngel Completely ignoring that every year, it sine-waves (peaks in the summer)
12:41 CandyAngel So if you plot the target against the historical data, you just get further and further away from the target as the year progresses
12:41 nic I'm afraid this a lot of off-topic
12:42 CandyAngel Okay, let's just go back to silence
12:50 panshin joined #mojo
12:57 Martin90 is there an option to cheange config file in Mojolicious::Plugin::Config ?
12:57 Martin90 change and save*
12:57 nic I save via JSON and spurt
13:00 Martin90 mhm, thanks
13:01 CandyAngel DBIx::Class just did exactly what I wanted it to do. Yay \o/
13:03 jontaylor joined #mojo
13:08 jontaylor_ joined #mojo
13:10 hernan605 joined #mojo
13:14 aborazmeh joined #mojo
13:22 jberger As long as you don't want dynamic config
13:22 jberger The config file can use the app keyword
13:23 jberger But if you serialize over it, you'll lose it
13:24 * nic loses it
13:24 Martin90 jberger, simply change it from admin panel or so
13:26 Martin90 so it's dynamic isn't it ?
13:26 Martin90 you read conf entities and then change the accordingly
13:27 Martin90 them*
13:28 nic Martin90: I think the warning is the admin could blow both feet off if they are able to enter non-serialisable data, esp if it matches /\bapp\b/
13:31 Martin90 they ? Only one or two people will have access to such changes
13:32 Martin90 don't see the danger here
13:32 nic yes, if there are fewer than 42 admins, nothing can possibly go wrong
13:32 * nic loses it
13:34 Martin90 wow :P how did you get that 42 count ?
13:35 Martin90 maybe set some flag that file is open for changes
13:35 CandyAngel Martin90: Moltuae
13:35 CandyAngel Meaning of Life, the Universe and Everything
13:35 Martin90 what you mean ?
13:36 CandyAngel That's where 42 comes from
13:36 CandyAngel https://en.wikipedia.org/wiki/42_%28number%29#The_Hitchhiker.27s_Guide_to_the_Galaxy
13:36 Martin90 ahh :p
13:39 Martin90 is there a explicit way to pass request to another server
13:40 Martin90 let's say main server gets request that is beyond its capability and want to pass it to another one
13:41 nic peer-to-peer load balancing?
13:41 Martin90 something like that
13:42 Martin90 example: server gets request for a file that is located on another server
13:43 nic can nginx tell from the req which backend server can handle it?
13:43 Martin90 no
13:43 melo joined #mojo
13:43 Martin90 this info is in db
13:44 Martin90 so basicly mojo has to act on it
13:44 nic you design that yourself
13:44 mattastrophe joined #mojo
13:44 genio That's a complication.  A central storage for files makes more sense in that situation.  S3 buckets?
13:45 bpmedley Martin90, nic: http://liveperl.us/  <-- Perhaps you could try the new Pearls feature.
13:46 jberger what I meant was, if you are already using app->... then you don't want to save serialized data in its place
13:46 nic bpmedley: soon (maybe tomorrow) I'll have some pg code for you to try out (if you're feeling generous :) )
13:46 bpmedley nic: Pg code?
13:46 nic uh-huh
13:46 fvox joined #mojo
13:47 bpmedley nic: Sorry, I lack context.
13:47 nic I know, and it's not even near your birthday
13:47 jberger Config.pm loads a perl script which return a hashref, JSONConfig.pm uses mojo template with app, so no, not just any /\bapp\b/ is a problem
13:48 bpmedley nic: I await the surprise with baited breath.. :)
13:48 * nic throws a peppermint
13:49 gryphon joined #mojo
13:52 mattastrophe joined #mojo
13:52 Martin90 but you eventually end up with full disk so you have to pass request to another server,
13:52 basic6__ joined #mojo
13:52 Martin90 so the question is how to pass request from one mojo server to another
13:53 nic ahh, UserAgent is your friend
13:53 nic and it sounds like you want to use non-blocking with a callback and render_later
13:55 Martin90 yeah I consider UserAgent
13:55 Martin90 nic, nice analyze :p
13:55 sugar joined #mojo
13:56 Martin90 bpmedley, hmm did u add sharing ? Can't see it
13:56 bpmedley Martin90: Do you see the "Pearls" link up top right?
13:58 Martin90 I see, and I am using it now but don't see any sharing option
13:58 bpmedley Try the "Clam" button.
13:59 Martin90 ok it does something like ;)
14:00 Martin90 but to be honest I like jsfiddle.net way much
14:00 bpmedley Martin90: That makes sense.  They've had more hours expended on tweaking their product.
14:02 Martin90 If I can recommend you something, I would throw that Pearls away and implement sharing out of the box ;)
14:03 melo joined #mojo
14:03 bpmedley Sure, I'll msg you for more information.
14:06 asarch joined #mojo
14:11 hernan605 joined #mojo
14:21 PopeFelix joined #mojo
14:24 PopeF joined #mojo
14:58 ZoffixWork joined #mojo
15:10 tcohen joined #mojo
15:13 PryMar56 joined #mojo
15:17 mudler joined #mojo
15:22 melo1 joined #mojo
15:24 sh4 joined #mojo
15:25 Dada_is_crazy joined #mojo
15:28 jontaylor joined #mojo
15:35 hernan605 joined #mojo
15:48 cpan_mojo Mojolicious-Plugin-ProxyPassReverse-SubDir-0.01 by MURATA https://metacpan.org/release/MURATA/Mojolicious-Plugin-ProxyPassReverse-SubDir-0.01
15:49 mgrimes joined #mojo
15:51 jontaylor joined #mojo
15:51 Martin90 joined #mojo
16:04 jontaylor joined #mojo
16:19 sugar joined #mojo
16:25 jontaylor joined #mojo
16:33 meshl joined #mojo
16:41 mattastrophe joined #mojo
16:41 ZoffixWork joined #mojo
16:55 trone joined #mojo
17:00 sugar joined #mojo
17:23 mattastrophe joined #mojo
17:24 dod joined #mojo
17:39 ajmrch joined #mojo
17:44 asarch__ joined #mojo
17:54 amon joined #mojo
17:55 ans joined #mojo
18:06 Martin90 Hmm none of these attempt to change template dir helped -> http://paste.scsys.co.uk/499941?hl=on&amp;submit=Format+it%21#format
18:07 Martin90 $r->any('/')->to('Page#index')->name('index') --> still looking for page/index.html.ep instead of theme/index.htm.ep
18:11 thowe joined #mojo
18:21 disputin joined #mojo
18:22 ZoffixWork joined #mojo
18:23 ZoffixWork Martin90, well, all your attempts did is added more paths for the renderer to find templates at.
18:23 Martin90 yes I noticed
18:23 ZoffixWork Martin90, the template => 'theme' is what you need to do in your controller
18:24 ZoffixWork Hm
18:24 Martin90 I know that I can render it manulay within controller
18:25 Martin90 but is there any way to change that default way $r->any('/')->to('Page#index')
18:25 Martin90 it doesn't look reasonable to me
18:25 sri think about what exactly you did when you added the template path
18:25 sri you were very close
18:26 Martin90 I have just expand the folders scope ;)
18:26 sri look closely http://mojolicio.us/perldoc/Mojolicious/Renderer#paths
18:26 Martin90 haven't change auto renderer bahviour
18:27 Martin90 one sec please
18:29 thowe Hi folks
18:29 Martin90 hm, no idea
18:30 Martin90 still looks for Template "page/index.html.ep"
18:31 Martin90 I doubt I can solve it that way
18:31 Martin90 no matter what directory I push to the scope it always try to look for controller/action.html.ep
18:33 ZoffixWork I've no idea what sri meant by #paths link
18:34 ZoffixWork The problem at hand: when controller is "page" make it look for templates in "theme/", not "page/".
18:35 Martin90 inversely
18:36 good_news_everyon joined #mojo
18:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcbSz
18:36 good_news_everyon mojo/master 424c7a2 Sebastian Riedel: show how to add paths and classes with higher precedence
18:36 good_news_everyon left #mojo
18:36 sri this
18:37 ZoffixWork Martin90, if you put your template into /theme/page/index.html.ep then it'll work
18:37 dvinciguerra joined #mojo
18:37 Martin90 yes you said it correctly
18:37 sri odds are i didn't understand Martin90 at all
18:37 ZoffixWork Can ->name() on ::Route change the controller name of the template? Like ->name('not_controller_name/template') ?
18:38 Martin90 I doubt it
18:38 sri oh well
18:38 ZoffixWork From what I understand  ->to('foo#bar') looks for template 'foo/bar', but the issue at hand is Martin90 wants it to look for 'ber/bar'.
18:38 ZoffixWork Martin90, just do it in controller? :)
18:39 ZoffixWork I recall wanting to do the same thing, BTW. I forget why though.
18:39 sri that makes no sense at all, of course i misunderstood that ;p
18:40 panshin joined #mojo
18:41 Martin90 sri, your comment is about higher precedence which has nothing to do here
18:41 sri sorry for the snark, i need to step back from answering questions a bit
18:41 Martin90 the problem is that no temp is found
18:42 sugar joined #mojo
18:42 ZoffixWork Martin90, ->name('theme/bar')
18:42 sri (the theme question is one that came up on the mailing-list, and is a very sensible one)
18:43 Martin90 ZoffixWork, do this work for you ?
18:44 Martin90 ->name('theme/bar') ?
18:44 ZoffixWork Martin90, I'm about to try...
18:44 good_news_everyon joined #mojo
18:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcb7V
18:44 good_news_everyon mojo/master 3fb9c6f Sebastian Riedel: pluralize the path
18:44 good_news_everyon left #mojo
18:44 Martin90 even if, it makes named routes ugly
18:45 ZoffixWork ¯\_(ツ)_/¯
18:45 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Renderer
18:46 sri that's all there is to it
18:55 Martin90 needs to tinker in these 3 files ?
18:55 ZoffixWork A better question is: what are you trying to accomplish?
18:55 Martin90 ZoffixWork, I think you know it
18:56 ZoffixWork :/
18:56 ZoffixWork Martin90, no. You told me you want "page" to be "theme". But not why
18:56 ZoffixWork I want bigger picture
18:56 Martin90 wait a while..
18:57 Martin90 what happens first in $r->any('/login')->to('User#login')->name('login'); --> Does it first look for rendere in controller app or try to render template user/login.html.ep ?
18:58 Martin90 joined #mojo
18:58 Martin90 I lost connection
18:58 Martin90 what happens first in $r->any('/login')->to('User#login')->name('login'); --> Does it first look for rendere in controller app or try to render template user/login.html.ep ?
18:59 ZoffixWork Since you gave it ->name(), it makes the name of the template using that value, which by my understanding should be in  '$Templates_Dir/login.html.ep'
19:00 ZoffixWork If you hadn't gave it ->name(), then it'd use user/login version... And you can override both in the controller's action, by setting stash value 'template' to the template
19:00 sri ZoffixWork: what makes you believe name has a higher precedence?
19:00 ZoffixWork sri, logical guesstimate
19:00 ZoffixWork :)
19:01 jberger (reminder that sri asks questions like this in order to improve the documentation)
19:01 sri so not based on documentation?
19:01 Martin90 ZoffixWork, I think ->name has nothink to do with theme dir at all
19:01 ZoffixWork sri, indirectly. I saw that ::Route takes ->name; so it's logical that providing ->name would override its default behaviour of using controller/action
19:02 Martin90 the truth is ->name is only kind of helper i.e for url_for
19:02 sri that would make naming routes pretty painful, don't you think?
19:03 sri imagine you're building a clean mvc app, with controllers and templates following the controller/action naming theme, now you need to reference the route with url_for and add a name
19:03 sri oops, suddenly everything breaks
19:05 ZoffixWork I see
19:05 ZoffixWork Martin90, I was wrong
19:05 Martin90 'templates following the controller/action naming theme' so without a renderer in the controller it will always look for  controller/action theme ?
19:07 Dada_is_crazy Hi. Can I access the name of a route in a under ? I mean my under protect many routes, so is there a way to know what route he is protecting in the current request.. (not sure it's clear, telle me if it's not)
19:08 * pink_mist understands the question, but has no idea about an answer
19:08 Martin90 sri, what about the order of actions ?
19:09 Martin90 I mean, what happens first in $r->any('/login')->to('User#login')->name('login'); --> Does it first look for render in controller app or try to render template user/login.html.ep ?
19:10 sri Dada_is_crazy: http://mojolicio.us/perldoc/Mojolicious/Controller#match
19:12 Dada_is_crazy sri: thanks! I don't fully understand it, but I'll try and I'll be back if it doesn't work :)
19:17 melo joined #mojo
19:19 good_news_everyon joined #mojo
19:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vcNf3
19:19 good_news_everyon mojo/master 234bb7a Sebastian Riedel: more diverse examples
19:19 good_news_everyon left #mojo
19:19 sri Dada_is_crazy: see commit
19:26 panshin joined #mojo
19:27 Dada_is_crazy sri: Yea, it works just perfectly! thanks :)
19:31 sugar joined #mojo
19:32 panshin joined #mojo
19:57 Martin90 I think it looks for template user/login.html.ep if controller does not render anything
20:12 sugar joined #mojo
20:17 Dada_is_crazy Can I store information in the session in a under ?
20:18 bpmedley Dada_is_crazy: I believe so
20:19 genio Dada_is_crazy: Yes.  Check out the growing guide. It shows this very thing
20:21 genio Dada_is_crazy: Are you trying to store data and not seeing it?
20:21 CandyAngel I guess PostgreSQL is the "main" database backend for Mojolicious..
20:21 Dada_is_crazy genio: yes I am
20:21 mattastrophe joined #mojo
20:21 genio can you pastebot a snippet to show us?
20:22 PopeF speaking of under...
20:23 PopeF For an under to be called with every route, I should use $app->routes->under(sub { ... }) , correct?
20:23 Grinnz_ no, you should make the under route, then spawn the rest of the routes from it
20:23 Grinnz_ the routes which you want to be under it
20:24 shadowpaste "Dada_is_crazy" at 217.168.150.38 pasted "my $auth = $r->under(sub { my" (11 lines) at http://paste.scsys.co.uk/499948
20:24 PopeF Grinnz_,  so $app->routes->under(sub { ... })->get( ... ) ?
20:25 bpmedley Dada_is_crazy: Would you try "return 1" instead of just return at then end of auth?
20:25 Dada_is_crazy there it is... I thought I kinda need to do it there because I need to access the $self->match->endpoint->to_string.. but I can pass it to the render aswell..
20:26 Dada_is_crazy bpmedley: no no, I already returned 1 if the user was connected (return 1 if $self->check_connectet() )
20:27 bpmedley So, the last return is a failed auth?
20:27 Dada_is_crazy yep
20:28 sri CandyAngel: yes
20:28 genio you're more or less following this: http://mojolicio.us/perldoc/Mojolicious/Guides/Growing#Simplified-application-class
20:28 genio But, why would there be any session data if you're not yet logged in?
20:29 Dada_is_crazy the point was to redirect the user to the right page after he logs in
20:30 Dada_is_crazy because there are many url render the login page if the user isn't log
20:30 Dada_is_crazy *rendering
20:30 CandyAngel Can you use the same database for Minion as you do for other app-related stuff? Or is it better to keep it separate?
20:31 sri should be fine
20:32 CandyAngel Okie
20:32 CandyAngel Time to learn PostgreSQL stuff then :D
20:32 Dada_is_crazy so.. any idea what I'm doing wrong?
20:32 sri <3 postgres
20:33 bpmedley Dada_is_crazy: I'm having some difficulty following the application logic.  Would you consider explaining your authentication logic?
20:34 sri for a short time mongodb was actually the "main" database... that was a really bad decision
20:34 CandyAngel Oh? how come?
20:34 sri it's as bad as its reputation ;p
20:35 CandyAngel I.. don't know it's reputation
20:35 sri fun for a time... but then problems keep popping up
20:35 CandyAngel Ah
20:35 sri it's just badly designed
20:35 Dada_is_crazy ok so here it is : I have a /manage route which needs the user to be authenticate. So if he isnt, this $auth under renders the template "login/login", but the I want the user to be redirected to /manage. And I have many others routes like /manage which will render "login/login" if the user isn't authenticate...
20:36 Dada_is_crazy *I want the user to be redirected AFTER HE LOGGED IN
20:36 preaction the mongodb dev team do not prioritize stability, which makes it a poor choice if you do
20:36 Dada_is_crazy (forgot to precise)
20:42 jberger and scenarios for data loss aren't as unlikely as most dbs make it
20:42 jontaylor joined #mojo
20:44 absolut_todd joined #mojo
20:46 disputin joined #mojo
20:46 stokachu_ joined #mojo
20:46 upasana joined #mojo
20:47 Phil22 joined #mojo
20:47 Zx3_ joined #mojo
20:47 janus` joined #mojo
20:47 Quaii joined #mojo
20:47 Dandre1 joined #mojo
20:48 graf joined #mojo
20:48 mikegrb joined #mojo
20:48 btyler_ joined #mojo
20:48 salparad1se joined #mojo
20:48 abracadaniel^ joined #mojo
20:48 diego_k joined #mojo
20:49 ashleydev joined #mojo
20:49 tinita_ joined #mojo
20:49 upasana- joined #mojo
20:52 tyldum joined #mojo
20:52 melo joined #mojo
20:52 thowe joined #mojo
20:52 mudler joined #mojo
20:52 Snelius joined #mojo
20:52 Lee joined #mojo
20:52 vytas joined #mojo
20:52 Mikey joined #mojo
20:52 stephan48 joined #mojo
20:52 cstamas joined #mojo
20:52 dustinm joined #mojo
20:52 gabiruh joined #mojo
20:52 marcusr joined #mojo
20:52 renormalist joined #mojo
20:52 crab joined #mojo
20:52 dysfun joined #mojo
20:52 lestrrat joined #mojo
20:52 al_ joined #mojo
20:52 esh joined #mojo
20:52 firnsy joined #mojo
20:52 worklapperl joined #mojo
20:52 skaji joined #mojo
20:52 sivoais joined #mojo
20:52 spicyjack joined #mojo
20:52 allison joined #mojo
20:52 bzero joined #mojo
20:52 caeles joined #mojo
20:52 jwang joined #mojo
20:52 sawtooth joined #mojo
20:52 tempire joined #mojo
20:52 tyldum joined #mojo
20:52 bowtie joined #mojo
20:53 dvinciguerra joined #mojo
20:56 chansen joined #mojo
20:59 Lucas1 joined #mojo
21:15 MartinR joined #mojo
21:27 sri heh
21:27 sri no need for op anymore
21:28 MartinR ;p
21:33 sri that new surface from microsoft is really beautiful
21:35 MartinR sorface of what ?
21:35 Grinnz_ surface is the name :P
21:35 MartinR surface*
21:35 MartinR ahh :p
21:35 pink_mist MartinR: https://en.wikipedia.org/wiki/Microsoft_Surface
21:36 Grinnz_ surfaces have always been pretty nice, if i cared about tablets I'd probably be interested in one
21:36 sri really too bad it's windows
21:36 CandyAngel Is it usual to have Apache in front of a Mojolicious app?
21:37 MartinR my note 3 does it well ;P
21:37 Grinnz_ CandyAngel: it can be
21:37 sri CandyAngel: that's literally in the cookbook
21:38 CandyAngel sri: It says in the cookbook *how*, it doesn't tell me if that is a common method
21:38 Grinnz_ CandyAngel: apache can handle static files, SSL, and more importantly for our use case, it can share port 443 with the other virtualhosts
21:39 sri CandyAngel: it's that common it's in the cookbook ;p
21:39 Grinnz_ if you don't already have it setup, i'd recommend going for nginx instead though
21:39 sri nginx is more common though
21:39 CandyAngel So is hypnotoad, nginx and PSGI
21:39 Grinnz_ i dunno about common :P
21:39 Grinnz_ apache is *everywhere*
21:39 sri apache is still bad at websockets i think
21:40 Grinnz_ CandyAngel: the proxy option lets you still utilize the full mojo IOLoop capabilities, PSGI does not
21:40 meredith i've had mojolicious running an app behind a path on an apache vhost for a few years, low traffic
21:40 CandyAngel For all I know, it's most common to just launch hypnotoad on port 80 :P
21:40 Grinnz_ CandyAngel: you can deploy hypnotoad directly of course, especially if you have nothing else that you want to serve on that port
21:41 CandyAngel Ohhhhh I see
21:41 Grinnz_ but wanting to serve multiple names on one port is very common, and the easiest way to do that is with apache or nginx
21:42 CandyAngel I don't think websockets will be used like.. ever
21:42 meredith yeah, in my case i'm serving about 8 other domains from that same ip/port.  the other major apache/nginx use case is reverse proxy to more than one app server
21:42 Zoffix CandyAngel, that's what they said about HTML5!
21:42 CandyAngel :P
21:43 * Zoffix still recalls early projections for it to be adopted only by 2025 :)
21:43 CandyAngel If only
21:43 CandyAngel -.-
21:43 * CandyAngel hates sites that don't work properly unless you enable all the things
21:43 meredith i can't vouch for the quality of it but there is apparently a mod_proxy_wstunnel with apache >= 2.4.5
21:43 Grinnz_ there's also toadfarm for serving multiple apps on one port directly with hypnotoad
21:43 CandyAngel Is that a hyperlink or is it 43KB of javascript.. WHO KNOWS?!
21:44 Grinnz_ websockets change the whole dynamic of certain websites, they can greatly increase efficiency
21:45 Grinnz_ if you've ever tried to implement a chat page in javascript before websockets, and then you look at the example chat.pl included with mojo, you'll see why :P
21:45 meredith it's really nice just having a websocket rigged up for sending users notices about background activity
21:45 CandyAngel I don't know how to do any dynamic web stuff
21:46 CandyAngel I guess it could be useful for like.. notifying of messages and stuff
21:46 CandyAngel Like you have received a PM, without refreshing the page?
21:46 MartinR ajax
21:46 CandyAngel (because that has the natural fallback of when you load a page, you'll see it)
21:47 MartinR asynchronous request
21:47 meredith it's good to get under your belt when you're ready for it :)   i'm betting, say, Convos is a good place to see patterns used
21:48 CandyAngel I don't mind implementing stuff that works when JS is disabled
21:48 CandyAngel But I come across quite a few sites where simple things that have existed forever (anchors) don't work if you don't enable JS
21:48 CandyAngel Which would be great if one of them didn't allow people to get user-submitted JS to execute on everyone's computer...
21:49 MartinR you know, js is everywhere..
21:50 CandyAngel Unfortunately
21:50 Adura_ JS is enabled where I want it. Can't submit a form without JS, won't be submitting a form.
21:50 meredith i think the only thing that really bugs me with js stuff nowadays is href="javascript:..." where i can't choose to open it in a tab
21:50 CandyAngel Adura_: Exactly
21:51 Grinnz_ meh. non-JS forms suck
21:51 CandyAngel If I ever add JS, it'll be a working site without JS, then if JS is enabled, it can replace things that make it use JS to make it nicer or whatever
21:51 CandyAngel So the form works fine without JS, you just find out problems after you submit it
21:52 CandyAngel Or you can enable JS and you can find out immediately or whatever
21:52 MartinR http://paste.scsys.co.uk/499954 --> it should prints out "Wrong name or.." if user filed is filled ?
21:54 Zoffix MartinR, yeah
21:54 Zoffix MartinR, with a caveat of "filled with 0"
21:54 Grinnz_ if I wanted to spend 3x as much development time on forms, i'd make them IE8 compatible
21:55 Zoffix I'm dropping IE8 in January.
21:55 Zoffix Right when MS does, so I'd have an excuse :P
21:55 Grinnz_ we're IE10+ only here :P
21:55 Grinnz_ it's a very javascript heavy app, so it was kind of necessary
21:56 Adura_ You're right about that meredith, I expect middle-click usefulness...!
21:56 Grinnz_ also i think you need IE10+ for websockets
21:56 MartinR Zoffix, it works kind of odd for me
21:56 MartinR or I don't understand it
21:56 Grinnz_ Adura_: i complained to our JS devs when their menus didn't work with middle click, and they fixed it :P
21:56 Adura_ Thar we go.
21:58 MartinR Zoffix, its definitely not protecting empty filed
21:59 Zoffix MartinR, "protecting"?
21:59 MartinR filed*
21:59 MartinR ok, worning about
21:59 MartinR warning*
22:00 jberger MartinR: can you please make a minimal working example of what you are asking about?
22:00 MartinR it just prints out warning when already has param user
22:00 jberger oh, sure
22:00 Zoffix MartinR, then the problem is elsewhere
22:00 jberger do you have the corresponding % }
22:00 jberger oh sorry
22:00 jberger % end
22:01 jberger and the % on the first line? I'm assuming that's just a bad copy
22:01 MartinR yes ;)
22:01 MartinR it's ok
22:02 MartinR it works, I just ask if I understood it correctly, thanks
22:02 jberger I mean, if its working, then its working :-P
22:03 MartinR I found it in some example code and for me it is odd warning that's why I asked
22:03 MartinR the text warning is ok, but condition is odd ;P
22:19 ajr_ joined #mojo
22:24 MartinR joined #mojo
22:32 geheimnis` joined #mojo
22:52 da5id joined #mojo
23:05 Phil22 is there a "mojo way" to do very simple REST API authentication via shared secret, but not sending that plaintext over the wire?  The use case is a central REST API, with a zillion Mojo->UA clients that talk back to it - I want to identify and authenticate them in the simplest manner possible
23:05 Phil22 seems like a number of people would have already solved this problem vs. yet another custom token subroutine :)
23:06 pink_mist put the api under https?
23:07 pink_mist done and done
23:07 meshl joined #mojo
23:07 Phil22 due to the environment, still like to avoid sending plaintext over the wire
23:07 Phil22 but yeah of course https
23:07 Phil22 shrug, figured it was worth asking
23:08 pink_mist it's not plaintext if it's https
23:08 Phil22 yes, I know
23:10 lsm joined #mojo

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