Camelia, the Perl 6 bug

IRC log for #mojo, 2012-06-27

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

All times shown according to UTC.

Time Nick Message
00:38 sri hmm
00:38 sri the config plugin currently makes the configuration available as $self->stash('config'), is that a feature or bug?
00:39 sri or more specifically, as $app->defaults('config'), which gets merged into the stash for every request
00:46 * sri demands answers!
00:54 marty hmmm.   I use stash_key when loading json config files.
00:54 marty Not sure if they will collide.
00:54 sri what is stash_key?
00:56 marty http://search.cpan.org/~mramberg/Mojolicious-2​.39/lib/Mojolicious/Plugin/Config.pm#stash_key
00:57 sri oh, i don't remember that, it's not there anymore it seems
00:57 marty Well, I guess I better fix my code.  :)   I've not looked at that section for a while.
00:58 sri maybe more evidence that the config stash key might be a bug
01:00 marty Ahh, I see what I did.  Redundant.   $config = $self->plugin('JSONConfig', { file => 'site.json', stash_key => 'config' } );
01:00 marty prolly the stash_key has not been working for a while.
01:01 sri interesting, so you are using $config?
01:01 marty I think so.  Let me check
01:02 marty Yes, I am
01:02 marty and it works
01:02 sri it also has tests, just no documentation
01:04 sri marty: you use it in templates?
01:04 laouji joined #mojo
01:04 Akron joined #mojo
01:05 scott_ joined #mojo
01:05 sri i can see app->config->{foo} being a lot more annoying to type than $config->{foo} there
01:05 marty Yes.  Templates and layout
01:05 * marty nods
01:05 GitHub151 joined #mojo
01:05 GitHub151 [mojo] kraih pushed 1 new commit to master: http://git.io/f9PFCA
01:05 GitHub151 [mojo/master] fixed config plugin documentation - Sebastian Riedel
01:05 GitHub151 left #mojo
01:05 sri then lets declare it a feature :)
01:06 marty \o/
01:06 marty For once, I am ahead of the curve.   :)
01:06 sri \o/
01:07 Akron 3.0! I'm here! I've got beer! Is the party already over???!
01:08 sri you missed it
01:08 Akron WHAT?!
01:08 sri we completely marcus'd the hackernews post though :)
01:08 Akron DAMN! All the beer now ... for nothing?
01:09 Akron Hackernew...beer! I am talking about beer!!!
01:10 Akron Well ... congrats to everyone bringing 3.0 to life - especially you.
01:10 sri \o/
01:11 * sri steals a beer
01:11 Akron It#s free! It's on the internets!
01:12 sri i brought a whole beer keg... where do i fill it up?!
01:13 Akron You need an API?
01:15 Akron (Oh - TAP isn't a valid http verb ... that's wrong.)
01:20 Akron Just out of curiosity: What was the reason against ->respond_to(qr/json/ => sub { ... }) etc. - so regexes as keys in respond_to?
01:22 sri don't think that was ever brought up for discussion
01:22 Akron I have an idea: Allow qr/.../ as keys of respond_to!
01:23 sri what's the advantage?
01:24 Akron For example if I use jQuery I somehow know the sequence of accept-headers and I could make it a rule in respond_to, ignoring all the complicated preference stuff of "accept".
01:25 sri that sounds very anti REST
01:26 sri brute for content negotiation
01:26 sri *force
01:27 sri i can see that being a plugin, but not for core
01:27 Akron Oh, is REST still hip?
01:28 sri considering REST is really just about using web technologies the way they were intended, i don't think it will ever go out of fashion
01:29 Akron I thought it was out of fashion nearly a decade with no one complaining ... ;)
01:29 sri HATEOAS is all the latest hipness btw
01:38 Akron That's still pretty short for an abbreviation that tries hard to impress. ;)
01:55 d4rkie joined #mojo
02:35 CromeDome joined #mojo
03:33 kthakore joined #mojo
03:41 kthakore joined #mojo
04:14 kthakore joined #mojo
04:24 kthakore joined #mojo
04:28 xaka joined #mojo
04:50 Leandr joined #mojo
04:53 CromeDome joined #mojo
04:59 fhelmber_ joined #mojo
05:27 Leandr joined #mojo
05:52 sri hmmm
05:53 ovnimancer joined #mojo
05:54 sri interesting attack SomeModel->insert({type => 'user', name => $self->param('name')}) with query ?name=sri&name=type&name=admin
05:55 sri since ->param('name') returns all values in list context it would end up as {type => 'user', name => 'sri', type => 'admin'}
05:56 sri tempire, marcus, crab: solve the problem! :)
05:57 sri all perl frameworks are affected btw., since we all cargo culted the shitty CGI.pm API
06:02 Foxcool joined #mojo
06:15 tempire that problem is already solved
06:16 sri is it?
06:16 tempire it's a solution I like to call considering the implications of your data model
06:17 tempire I don't know that there's any surefire way to prevent such a thing
06:18 tempire given that the situation would imply the user is not checking the data before it goes into the db
06:18 tempire s/user/developer/
06:20 tempire I guess I don't view that as a security issue as much as a careless implementation
06:20 tempire not that I've ever done anything careless
06:20 * tempire keeps his mouth shut
06:22 stephan48 maybe make a guide about security and note such obstacles there?
06:22 stephan48 f.e. good & bad pratices for such cases
06:23 stephan48 cause i dont see it a responsible of the framework to fix the users stupidness
06:23 tempire well, it can encourage
06:23 stephan48 or even the language, how that ends we see in php
06:23 tempire I wouldn't call it stupidness as much as carelessness or inexperience
06:23 stephan48 yea
06:24 stephan48 so someone could explain the above attack in a away newbies understand it and also show them ways for input validation f.e. forcing the return value to be a scalar
06:25 sri that same problem has recently been exploited in rails
06:25 stephan48 yup
06:26 stephan48 i dont see a reliable way on fixing this on framework level..
06:26 tempire other than preventing the list context return from ->param
06:27 stephan48 yea
06:27 stephan48 i btw use this behaviour
06:27 sri we even use list context internally
06:27 sri for tag helpers
06:28 vishwanathms joined #mojo
06:28 vishwanathms_ joined #mojo
06:28 stephan48 removing that would definitively break backward compatibility
06:28 sri it's also important for compatibility with all the cpan modules supporting the CGI.pm ->param api
06:28 stephan48 yea
06:29 tempire the whole list context is basic perl convention, it would be a shame to discard of it.
06:30 tempire we could php the problem away and have a new method called param_single
06:30 stephan48 ye
06:30 sri lol
06:31 tempire I even lol'd myself on that one.
06:31 stephan48 nonsense, cause most people/apps will probably continue using ->param(...)
06:31 stephan48 ye
06:32 stephan48 lets just mimik phps ?bla[]= behaviour then we can be safe
06:38 taryk joined #mojo
07:00 Vandal joined #mojo
07:16 marcus sri: catalyst isn't affected if you use $c->req->params->{foo}
07:16 sri marcus: same could be said for mojolicious ;p
07:17 marcus sri: I guess. Catalyst community encourages the params variant in their docs tho
07:17 marcus sri: https://gist.github.com/3002192
07:17 * sri doesn't want to encourage $self->req->params->to_hash->{foo}
07:18 marcus sri: but it's so pretty!
07:18 marcus totally beats $self->param('foo')
07:22 marcus stephan48: I believe ruby on rails does that too.
07:22 arpadszasz joined #mojo
07:23 marcus http://www.misuse.org/science/200​6/12/28/rails-params-and-arrays/
07:25 Patterner think "What Would PHP Do?" and do the opposite?
07:26 * marcus sees a bumper sticker in this somewhere.
07:32 sri marcus: http://hastebin.com/raw/semugojuso # something like that sounds sensible?
07:35 marcus sri: yeah, something like it. not sure about the second paragraph, seems to be repeating the comment of the first code example  a bit
07:35 marcus but basically that's the gist of it.
07:44 GitHub116 joined #mojo
07:44 GitHub116 [mojo] kraih pushed 1 new commit to master: http://git.io/ZS4xBw
07:44 GitHub116 [mojo/master] better description for param behavior - Sebastian Riedel
07:44 GitHub116 left #mojo
07:50 sri proposals for sensibly changing the behavior are welcome of course
08:05 marcus changing the behaviour would break pretty much every mojo app out there, so I'd be opposed to that.
08:10 spleenjack joined #mojo
08:12 vishwanathms joined #mojo
08:12 vishwanathms_ joined #mojo
08:24 pau4o joined #mojo
08:29 dypsilon joined #mojo
08:30 sri mkay
08:32 Foxcool joined #mojo
08:35 i_am_batman joined #mojo
09:28 daxim joined #mojo
09:31 chansen joined #mojo
09:41 Andrei666 joined #mojo
09:49 laouji_rouge joined #mojo
09:56 Htbaa joined #mojo
10:14 memowe O HAI o/
10:18 Htbaa1 joined #mojo
10:19 Htbaa2 joined #mojo
10:20 i_am_batman finally: i've read the changes
10:20 i_am_batman nothing too drastic. looks clean. i like it :)
10:23 sri i think the times of drastic changes are mostly over :)
10:46 lukep joined #mojo
11:06 nicolasbd joined #mojo
11:06 nicolasbd hi all
11:15 venkatk_ joined #mojo
11:20 xaka joined #mojo
12:06 nicolasbd Plugin::Mount is so weird .. it's like a random route mounter
12:08 * marcus resists making mount jokes.
12:09 crab wow, that's weird. it's wacky, like how you can use mount(1) to mount arbitrary filesystems!
12:09 marcus crab, otoh...
12:09 marcus :)
12:09 * nicolasbd can't understand jokes because he's a stupid french guy :(
12:10 marcus nicolasbd: are you saying it's not behaving as described by the docs?
12:11 nicolasbd well .. no, it's behaving like it should but .. kinda randomously (does this word exist ?)
12:12 marcus no
12:12 marcus :)
12:12 marcus randomly
12:12 crab randopotamus
12:12 marcus is that a randomly sized hippo?
12:13 nicolasbd for example, I have a controller with a method that can "mount" sub apps .. I understood that, if it does it itself, the routes won't be available from other controllers
12:13 nicolasbd so I made a method in my main app class, and I call it from my controller like "$self->app->mount($theAppToMount)"
12:14 nicolasbd and then I call the route
12:14 nicolasbd sometimes it works
12:14 nicolasbd sometimes it doesn't :)
12:14 nicolasbd best way I found is to mount all subapps in the "startup" method of the main class, but I would love to do it dynamically
12:15 crab you have to do it in startup
12:16 nicolasbd and then can I call startup in my app ?
12:16 nicolasbd to "reload" all routes ?
12:21 nicolasbd yes I can
12:21 nicolasbd thanks for the precisions
12:25 sri like i said before, changing routes after the first request has been handled is not officially supported
12:25 marcus dynamic routes at runtime sounds scary
12:25 sri it may or may not work, or might break in a future version
12:25 marcus nicolasbd: what is the use case for that?
12:26 sri small changes to route caching can change runtime semantics completely
12:27 nicolasbd sri: well it's ok to restart "startup", sounds coherent to me .. I first wanted a dedicated method, but it's fine like that
12:28 crab nicolas: no, you can't call startup again
12:28 crab i mean you can, but don't expect good things to happen
12:28 marcus it's not meant to work like that, at leaxst.
12:28 sri that only doubles the number of routes
12:29 nicolasbd marcus: i make a web desktop for internal use in my lab, and I modified the "Generate::App" command to create apps that fits to my ExtJS application, and I want the admin to generate and register apps on the fly, and the user to install them .. and start them without reloading the page
12:29 nicolasbd ah, damn' .. so I should "restart" the desktop by reloading the page then
12:29 crab then you need to do your own dispatching
12:30 nicolasbd nevermind, it's not that annoying ..
12:30 marcus uhm, what's running on your page and what's running on the server is two different things :)
12:30 crab i don't see how reloading your page makes any difference
12:30 nicolasbd ah yes you're right, it wont restart the server
12:30 nicolasbd huh
12:32 sri you would have to know how routes work very very well to make it work
12:32 mire joined #mojo
12:33 nicolasbd so what could happen if i call startup again ?
12:34 nicolasbd i doubles all the routes ?
12:35 nicolasbd hey, I could tell morbo to restart the server ?
12:35 marcus setting up morbo to watch the folder where you drop your routes would probably work
12:36 marcus then having some way of telling your desktop app which apps you have installed through eventlistener or something similar
12:36 nicolasbd actually, morbo is watching the folder where new apps are generated, so it might already restart the server each time
12:36 marcus yes, it probably does
12:37 marcus note that morbo is actually a development server, and single threaded.
12:37 marcus it might be right for your particular needs tho.
12:37 nicolasbd damn' ..
12:38 marcus hypnotoad is our production web server
12:38 marcus app server even
12:38 nicolasbd but hypnotoad doesn't reload itself when sources change, does it ?
12:38 marcus no. but it does support zero-downtime restarts
12:39 marcus sri: not sure how you would trigger one easily from inside the app itself?
12:39 nicolasbd yeah .. well, me neither
12:39 nicolasbd but morbo can be fine for internal use, I don't expect big trafic
12:39 nicolasbd well .. yes, actually, it could happen
12:40 crab just send USR2 to the right pid, it should work
12:41 nicolasbd not sure i'll do that
12:42 crab sorry, that was to marcus.
12:42 crab i am trying not to get involved in your plan :-)
12:43 nicolasbd well .. thank you guys for your explanations, because i was making mistakes without even seeing it
12:43 marcus crab: yeah, I understand that would work, but I was wondering if there's an easier way.
12:43 nicolasbd crab: haha .. you find it too dirty ?
12:44 tadamo joined #mojo
12:44 sri code changes at runtime pretty much always suck
12:44 sri solving one problem will cause two new ones
12:44 crab nicolasbd: not dirty exactly, but full of pain and suffering
12:44 crab yeah, what sri said
12:45 crab but that said, i still think it would be easier to do it with your own dispatcher
12:45 crab and not think about changing routes dynamically
12:45 crab (or subdispatcher, whatever)
12:45 sri restarting with hypnotoad works because it only leaves the listen socket open but performs a full interpreter restart
12:46 sri creating a new app is not just adding routes for it, you also need to propagate those changes to all worker processes
12:47 nicolasbd actually, evertyhing works pretty fine with the current code, when "startup" is called after an app has been generated .. if i can keep morbo in prod, it can be ok .. but why shouldn't i ?
12:49 nicolasbd currently, "startup" loads the routes to "mount" from a database, but it could also browse the app directories since they're all well generated
12:50 nicolasbd well, i'm kinda new to perl & mojolicious, so i might not realize how much "full of pain & suffering" it is .. everything looks easy to me right now :)
12:50 nicolasbd but it might not be the good way to proceed
12:52 * nicolasbd killed everybody with impertinence
12:53 Mad_Dud congratulations on 3.0!!!
12:54 memowe \o/
12:55 sri \o\
12:57 nicolasbd joined #mojo
13:03 nicolasbd don't know if you guys heard about that, but a young french ubuntu forum moderator died from cancer (at 23 .. ouch), but he had prepared a message, placed in the trash, to be seen after his death, where he's kind of sad to leave, but happy to talk .. weird but cheerful
13:03 nicolasbd he also donated all his student bank account content to the ubuntu community
13:09 memowe wow...
13:10 Psyche^ joined #mojo
13:13 marcus sublime text 2.0… hmm
13:16 marty Am I correct:  Sublime text 2 - Mojolicous bundle does not highlight css or js in embedded blocks?  ie:   %= stylesheet begin .... % end
13:16 marty Sublime text 2 with Soda is very compelling.
13:19 marcus marty: probably right
13:20 sri marty: i'm sure the maintainer accepts pull requests :)
13:20 jnap joined #mojo
13:21 marty Ya.  I was wondering who maintains it
13:21 sri i opened a ticket for __DATA__ support a few days ago and he added it already
13:21 marty My Jedit does highlighting of css and js within templates so I'm used to it.  I just have to read up on how the syntax files work
13:21 marcus probably https://github.com/njlg
13:21 sri https://github.com/SublimeText/Mojolicious
13:22 marcus wow, he misspelled Controller at the top of his web page =) http://njlg.info/
13:23 nicolasbd hey .. not bad, i'll install it into sublime. I'd love to have such a stuff in Webstorm, because the coloration goes crazy when I put some "%" in it
13:23 marcus but he's into Mojolicious at least :)
13:25 marty The Soda theme is so nice.   (Found it from sri's tweet)
13:25 marcus it's awesome, now that they've revamped it.
13:25 * sri can't wait for the dark soda theme to get updated
13:26 bjoernfan joined #mojo
13:26 bjoernfan Hello.
13:26 marty Ahhh, it does highlight css and js if you use <style></style> and <script></script>
13:26 * sri waves
13:26 marty HI bjoernfan
13:26 mire joined #mojo
13:27 bjoernfan I'm running a cronjob doing svn update; hypnotoad script/foo. It works great (it updates and continues to run), but apparently it segfaults every time.
13:28 AmeliePoulain joined #mojo
13:28 marcus is that like a fan of bears, or a fan of bjørns?
13:28 bjoernfan Does that sound familiar to anybody?
13:28 marcus bjoernfan: not really.
13:28 bjoernfan My name happens to be Björn, and "fan" is kind of a curseword in Swedish.
13:29 bjoernfan :>
13:29 bjoernfan trivia
13:29 marcus fairy snuff :)
13:29 sri segfault is a serious problem, prolly a perl bug or broken xs module
13:30 bjoernfan kernel: perl[31984]: segfault at a80 ip 00007f2401552e52 sp 00007fff77b17c30 error 4 in libperl.so[7f24014be000+162000]
13:30 bjoernfan Every twenty minutes, as per my cronjob. I commented it out and it stopped.
13:30 memowe bjoernfan: http://fave.mind-exchange.com/wp-co​ntent/uploads/2010/10/metal-fan.jpg
13:31 bjoernfan memowe: Maybe I'll check jpegs from home instead of on the job. :P
13:31 memowe Its SFW
13:31 memowe s/Its/It's/
13:32 bjoernfan CentOS 6.2, 64-bit, 5.10.1
13:32 CromeDome joined #mojo
13:32 bjoernfan Same thing happens on a 32-bit machine running the same version of Perl.
13:34 bjoernfan memowe: Yeah, I came to think of that "What about our huge fans?" or whatever she says in is it S05E01 or S06E01.
13:34 bjoernfan :>
13:34 marcus Hva er upplysningsinstitutet?
13:34 memowe eh eh eh eh
13:35 memowe He does it again #thatfunny"language" ;)
13:35 bjoernfan marcus: Placeholder so far. It's a bit long to type out... I usually just type the IP instead.
13:35 crab do you say fy faen in swedish too?
13:35 marcus crab: they just say 'fan'
13:36 marcus bjoernfan: sounds like a good organization tho :)
13:39 marcus bjoernfan: does the segfault happen if you manually restart from the command line as well?
13:39 bjoernfan Nope.
13:40 bjoernfan marcus: And yeah, thanks, just trying to not get to off topic. :P
13:40 marcus bjoernfan: good luck with that ;-)
13:41 marcus bjoernfan: I would probably upgrade to the latest perl and hope it went away if I was in your shoes.
13:41 bjoernfan sri: Is it possible to get some kind of dumps?
13:42 bjoernfan Yeah, maybe that's it.
13:44 bjoernfan Looks like it's the latest one available from CentOS.
13:45 bjoernfan sri: Awesome job btw, it's a pleasure to work with. :)
13:45 CromeDome joined #mojo
13:45 andrefs joined #mojo
13:48 crab i still get occasional core dumps from my mojo app
13:50 bjoernfan Where do they end up?
13:50 bjoernfan $HOME?
13:51 Andrei666 joined #mojo
13:52 Andrei666 hey guys, I'm trying to create this bridge
13:52 Andrei666 my $admin = $r->bridge('/admin')->to('admins#​auth')->route('/')->to(controller => 'admins');
13:52 Andrei666 and $admin->route('/#admin_name')->to('admins#home');
13:53 Andrei666 the admins#home, redirects me to a homepage for admins, which should render the admins name
13:53 Andrei666 the thing is
13:53 Andrei666 if I log in
13:54 Andrei666 the not found page keeps telling me
13:54 Andrei666 it didn't find the page "/admin/admin"
13:54 Andrei666 second admin should be the wild card..
13:55 Andrei666 what am I doing wrong?
13:56 crab hmm, not sure, but i would say don't chain the first ->route()
13:57 crab $admin = $r->bridge(...); $admin->route('/')...; $admin->route('/#admin_name')...;
13:57 Andrei666 ok
13:57 Andrei666 i'll try
13:59 Andrei666 well..still the same
13:59 Andrei666 None of these routes matched your GET request for /admin/admin,
14:00 Andrei666 in the admin#auth, should i redirect back to something?
14:01 Andrei666 it doesn't sound good, and probably it isn't
14:01 marcus Andrei666: did you look at  myapp routes to get the relevant parsing of your routes?
14:02 Andrei666 marcus: the examples from perldoc?
14:02 marcus Andrei666: no, the command ./script/myapp routes
14:02 Andrei666 i did, but I'll double check
14:03 Andrei666 how can I paste them here
14:03 marcus gist.github.com
14:03 Andrei666 so that they won't be too messy
14:04 Andrei666 https://gist.github.com/3004248
14:05 Andrei666 i want to create, a bridge for authenticated admins, or try to use the under directive...so that only logged admins should ..let's say delete users...
14:06 marcus admin#auth should return true, does it?
14:07 Andrei666 in there, i check if there is 'admin_name' in session..
14:07 Andrei666 and I just return...
14:07 Andrei666 i'll test now..
14:08 Andrei666 god damn it...
14:08 marcus :D
14:08 Andrei666 marcus: big thanks...
14:08 Andrei666 i was just returning,
14:08 Andrei666 now with a return 1; it's all ok :)
14:08 Andrei666 damn it..
14:09 Andrei666 i need to learn more perl :))
14:09 Andrei666 :D
14:09 Andrei666 marcus: (bow)
14:09 marcus you're welcome.
14:09 Andrei666 btw...congrats to you on the new release :)
14:10 Andrei666 mojolicious is the only framework that I work now...
14:10 Andrei666 and I'm not looking back to the others...
14:10 Andrei666 i just keep trying to learn more and more..:)
14:13 marcus :)
14:21 rem_lex joined #mojo
14:26 spleenjack joined #mojo
14:40 memowe coffeeeeeeeee!
14:45 daniel_ joined #mojo
15:25 alester joined #mojo
15:27 daniel__ joined #mojo
15:27 * marty wonders what is wrong with the dark soda theme
15:31 jnap joined #mojo
15:32 nicolasbd joined #mojo
15:32 nicolasbd hello again
15:32 crab hi again
15:33 nicolasbd sorry if this is another stupid question, but what is "dispatching" ? and do you think it's a good idea to use the "before dispatch" hook to check something (for example, if user is logged in), and do something depending on it ?
15:34 daniel_ joined #mojo
15:38 marcus nicolasbd: it could be. We usually use bridges.
15:42 nicolasbd oh ok, didn't see that
15:43 daniel__ joined #mojo
15:43 nicolasbd so, you define a route, and you define a bridge for the same route, that check things and return 1 or 0 ?
15:45 nicolasbd well, no, I'm not sure since the example makes a bridge for "/foo" and a route named "/bar"
15:46 nicolasbd in my case i should have a bridge on "/" and all routes attached to this, is that right ?
15:50 Leandr joined #mojo
15:51 d4rkie joined #mojo
15:54 pau4o left #mojo
15:56 nicolasbd yeah, bridges look cool
15:56 nicolasbd thank you
15:57 nic ooh, MOJO_NO_IPV6=1 has just removed the bonkers error I was struggling with; I must be suffering from out-of-datedness
15:58 nic hm, that's not true
15:59 nic It must have been running in development mode by mistake; wow I need more coffee
16:11 nic pfff, half a cup of coffee and it becomes obvious I'm using the wrong process gid
16:21 mire joined #mojo
16:31 CromeDome joined #mojo
16:37 daniel_ joined #mojo
16:41 daniel_ joined #mojo
17:11 dypsilon1 joined #mojo
17:17 inokenty joined #mojo
17:29 jnap joined #mojo
17:45 i_am_batman joined #mojo
18:08 i_am_batman hi
18:09 i_am_batman why doesn't the hidden_field use ->_input() like the rest?
18:39 * marty just sent a pull request to the sublime text 2 - Mojolicous plugin author to highlight css and js in templates
18:42 rwstauner joined #mojo
18:46 i_am_batman marty++
18:52 dog_chocolate joined #mojo
18:58 dog_chocolate_ joined #mojo
19:01 dog_chocolate__ joined #mojo
19:13 cynovg joined #mojo
19:20 andrefs joined #mojo
19:25 atom12 joined #mojo
19:40 * tempire looks at the channel through his google glasses
20:07 * marcus tries to hide his shame.
20:17 dog_chocolate joined #mojo
20:32 marty Hmmm,  on my sublime text 2, the cursor jump after applying perltidy is intermittent.  Might be possible to find a fix.
20:36 ilbot2 joined #mojo
20:36 Topic for #mojo is now Mojolicious real-time web framework 3.0 🌈 http://mojolicio.us 🌈 http://irclog.perlgeek.de/mojo/today
20:39 sri marty: i can confirm that
20:40 sri marty++ # btw
20:47 diegok o/
20:48 diegok sri: thank you for include my example!, I was expecting your opinion before preparing a pull request but you did it all so fast!, as always :)
20:49 nic http://hastebin.com/rihokiseki.coffee
20:49 nic That problem is spoiling my party
20:49 diegok When I mount other mojo app and both apps has a helper that creates and return an object. The app will have two of those objects on each fork?
20:50 nic When I do "./myapp daemon -u ebdb" it isn't running as 'root', but nor is it behaving the way 'ebdb' does in the shell
20:54 knshaum joined #mojo
20:54 nic hm, the process definitely has GROUP and RGROUP correct
20:57 diegok nic: it works here
20:57 nic bizarre
20:58 diegok nic: http://hastebin.com/requsufane.coffee
20:58 andrefs joined #mojo
20:58 nic drwxr-s--- 3 root ebdb 4096 Jun 26 15:46 /var/local/auth/ebdb
20:58 diegok I run it with my user...
20:59 diegok nic: it change something to you when you change user?
20:59 nic In a normal perl script, the ebdb:ebdb user sees it as a dir, but not when running from a Mojolicious::Lite daemon
20:59 diegok nic: in my case it works as expected
20:59 diegok giving this is just normal perl program
21:00 diegok that uses mojo library
21:01 nic diegok: in your test, does the path have similar permissions?
21:01 diegok the path is my homedir :)
21:02 nic I think it might be central that the dir is only readable by virtue of its group
21:03 diegok nic: oh!, I just re-readed your paste (I've missed the thing that running with -u root work's_
21:04 nic hm, I was wrong; even if 'ebdb' is the owner of the dir, it still gets 'false' for ' -d <dir>'
21:05 nic I realise I'm probably doing omething dumb, but my test example is so small I'm failing to see how to cut it down further
21:07 nic right, it's something to do with the permissions of the ancestor dirs
21:08 diegok nic: hm, same here when I test -f on a file that only has owner rw
21:08 diegok works off mojo, fails inside...
21:09 nic in my parent dir, the 'ebdb' user has zero permissions
21:09 nic for some reason a normal perl script doesn't care, but the daemon script does
21:09 diegok :-/
21:15 andrefs joined #mojo
21:18 daniel_ joined #mojo
21:35 nic http://hastebin.com/nemaximuwa.vhdl
21:36 nic ...is a clearer illustration
21:36 nic Shows that ojo gets it right but Mojolicious::Lite gets it wrong
21:36 nic (if the two small scripts are the same)
21:37 nic sri: Where's the best place for bug reports?  github?
21:40 dog_chocolate joined #mojo
21:42 dog_chocolate Hi, anyone know what's going on with this (likely) schoolboy error? http://i49.tinypic.com/359d6qa.jpg
21:43 dog_chocolate Here's a dump on the mojo app that's producing it http://pastebin.com/h2VtpjRc
21:43 dog_chocolate bridge + route are at the bottom
21:43 dog_chocolate surely that should work?
21:45 lukep joined #mojo
21:48 lukep joined #mojo
21:48 sri nic: what bug?
21:50 marty dog_chocolate:  Not sure if this will help but maybe removing the lading slash on the bridged route?  ie: $app->route('test/general')->to(controller => 'test', action => 'general')
21:50 marty s/lading/leading/
21:50 sri marty: leading slash doesn't matter
21:50 sri same for trailing slash, we ignore both
21:50 dog_chocolate marty, cheers,yeah i had it without initially no go =/
21:50 marty Ahh,  I did not know that.  Now I do.  :)
21:51 sri \o/
21:51 dog_chocolate just getting to grips with mojo... i had some very similar code running under 2.8/2.9 + im pretty sure it worked,  might try running it under that
21:52 marty I'm using bridge routes with 3.0 and they work great.  So whatever it is, I don't see it.
21:59 jnap_ joined #mojo
22:00 jnap_ joined #mojo
22:01 i_am_batman left #mojo
22:04 nic sri: Did you see http://hastebin.com/nemaximuwa.vhdl
22:04 nic I'm guessing I should open an 'issue' on github?
22:04 sri nic: i don't see a bug
22:05 nic Are the two bits of code different?
22:05 sri i don't know, but the chances that this is a mojolicious bug is very very very small
22:06 sri perl quirk maybe
22:06 sri you're welcome to open a ticket, but i don't see it go anywhere
22:06 nic surely ojo and Mojolicious::Lite should give the same answer?
22:07 sri dunno
22:07 sri and it's not ojo vs Mojolicious::Lite but oneliner vs script
22:09 nic I guess I need to try a full Mojolicious implementation then, in the hope my app will work under that
22:09 sri very unlikely
22:09 sri i'm 99% sure it's a perl quirk
22:09 sri https://github.com/kraih/mojo/blob/m​aster/lib/Mojo/Server/Daemon.pm#L226
22:10 sri that's all we do for user switching
22:10 nic Ah, are you thinking that ojo is closer to the shell and Mojolicious(::Lite) are more prone to perl quirks?
22:10 sri oneliners might retain their parents permissions or something stupid like that
22:10 nic I see
22:10 dog_chocolate_ joined #mojo
22:12 sri it's prolly even platform dependend, those uid/gid syscalls behave different all the time
22:13 i_am_batman joined #mojo
22:18 nic sri: I've just run different tests which confirm you're right
22:18 sri :)
22:18 nic => perl oneliners inherit special powers of the original invoker
22:19 nic It might be the difference between actual guid and apparent guid
22:20 nic So if you run a oneliner as 'root', even though you can get the process to run as non-root, it still has special powerzz
22:21 sri POSIX::setuid is supposed to set both... but i suppose it doesn't always work
22:22 nic sri: Thanks for clearing that up; I can stop barking up the wrong tree now and try a different approach
22:23 sri kinda funny how most bug reports these days boil down to perl quirks :)
22:23 sri nic: what perl version are you using btw?
22:24 * sri bets on 5.10
22:24 nic sri: v5.16.0 on debian linux
22:24 sri oh
22:25 nic i686 and amd64 gave the same results
22:37 daniel_ joined #mojo
22:45 dog_chocolate__ joined #mojo
22:50 andrefs joined #mojo
22:57 nic Can you use "sub production_mode {" in a Lite app?
22:57 nic I'm trying to work out why mine isn't being called
22:57 nic It's picking up the env vars correctly, which set the mode and log level
23:19 daniel__ joined #mojo

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