Camelia, the Perl 6 bug

IRC log for #mojo, 2013-04-12

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

All times shown according to UTC.

Time Nick Message
00:00 powerman1 left #mojo
00:01 rem_lex|pivo joined #mojo
00:14 rem_lex| joined #mojo
00:32 shmuel joined #mojo
00:47 jberger joined #mojo
01:01 egopro joined #mojo
01:20 rem_lex joined #mojo
01:22 jberger joined #mojo
01:26 good_news_everyone joined #mojo
01:26 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JhArIg
01:26 good_news_everyone mojo/master c381eee Sebastian Riedel: 1005 status code must not be sent
01:26 good_news_everyone left #mojo
01:36 jb360 joined #mojo
01:51 rem_lex joined #mojo
01:57 good_news_everyone joined #mojo
01:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/HbsgYw
01:57 good_news_everyone mojo/master 360d51b Sebastian Riedel: updated a few WebSocket examples
01:57 good_news_everyone left #mojo
01:57 Meiermann joined #mojo
02:01 d4rkie joined #mojo
02:06 jberger joined #mojo
02:46 cy joined #mojo
02:48 preflex_ joined #mojo
03:02 egopro joined #mojo
03:24 Adurah joined #mojo
03:30 tempire joined #mojo
03:46 jb360 joined #mojo
03:48 good_news_everyone joined #mojo
03:48 good_news_everyone [mojo] kraih tagged v3.95 at f8d53ab: http://git.io/mO4PdA
03:48 good_news_everyone left #mojo
03:51 egopro joined #mojo
04:21 xaka joined #mojo
04:41 rem_lex|pivo joined #mojo
05:08 good_news_everyone joined #mojo
05:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/InbYHA
05:08 good_news_everyone mojo/master 255f107 Sebastian Riedel: imrpoved default descriptions in Test::Mojo
05:08 good_news_everyone left #mojo
05:24 ka2u joined #mojo
06:09 Mike-PerlRecruiter_ joined #mojo
06:18 mattastrophe joined #mojo
06:23 yacc1 joined #mojo
06:23 yacc1 hi
06:23 Mike-PerlRecruiter_ joined #mojo
06:24 yacc1 ppl, how to check that hypnotoad load correctly ssl certificates from config?
06:25 yacc1 I have a strange tls error while checking ssl like this:
06:25 yacc1 $ openssl s_client -host localhost -port 3000
06:25 yacc1 CONNECTED(00000003)
06:25 yacc1 depth=1 /C=US/O=Thawte, Inc./CN=Thawte SSL CA
06:25 yacc1 verify error:num=20:unable to get local issuer certificate
06:25 yacc1 verify return:0
06:25 yacc1 14361:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1093:SSL alert number 40
06:25 yacc1 14361:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
06:26 yacc1 Config file is:
06:26 yacc1 {
06:26 yacc1 hypnotoad => {
06:26 yacc1 listen => ['https://*:3000'.
06:26 yacc1 '?cert=conf/XXX_2014_10_24.crt'.
06:26 yacc1 '&key=conf/XXX.key'.
06:26 yacc1 '&ca=conf/root_cert_sslwildcard.crt'],
06:26 yacc1 workers => 10,
06:26 yacc1 },
06:26 yacc1 };
06:26 yacc1 Could anyone help me? :)
06:28 mattastrophe joined #mojo
06:29 ver joined #mojo
06:30 davido joined #mojo
06:41 dod joined #mojo
06:43 DaTa yacc1: please use a pastebin
06:43 yacc1 Ok
06:44 DaTa yacc1: openssl x509 -noout -in XXX_2014_10_24.crt -subject -issuer
06:45 rem_lex| joined #mojo
06:46 yacc1 subject= /C=RU/ST=Russian Federation/L=Moscow/O=<hidden>/CN=*.mydomain.ru
06:46 yacc1 issuer= /C=US/O=Thawte, Inc./CN=Thawte SSL CA
06:48 denisboyun joined #mojo
06:48 yacc1 I think its all about of file formating in .crt, .key files :\ No?
06:51 mattastrophe joined #mojo
06:52 rihegher joined #mojo
06:55 Vandal joined #mojo
07:05 suy joined #mojo
07:09 dod joined #mojo
07:10 egopro joined #mojo
07:11 egopro joined #mojo
07:13 rihegher left #mojo
07:22 DaTa yacc1: does openssl s_client -CAfile root_cert_sslwildcard.crt -connect localhost:3000 work?
07:35 dpetrov_ joined #mojo
07:48 podz joined #mojo
07:48 podz good morning
07:54 podz what is the current internationalisation strategy with mojo? I am reading this article: http://showmetheco.de/articles/2010/5/buildin​g-multilingual-website-with-mojolicious.html and it states that Mojolicious::Plugin::I18n is in the core. As far as I can tell, this plugin is nowhere to be found on my 3.95 installation.
08:01 jzawodn joined #mojo
08:18 jzawodn joined #mojo
08:23 fhelmber_ joined #mojo
08:43 podz there are 2 different Mojolicious::Plugin::I18n modules on CPAN
08:44 podz so it appears that neither one of them are in the core and there is now a namespace collision
08:45 podz on top of that, there is a 3rd one here by yet another author: https://bitbucket.org/nuclon/​mojolicious-plugin-textdomain
08:47 podz I am guessing that this is the right one to use: http://search.cpan.org/~sharifuln/Mojolicious-​Plugin-I18N-0.9/lib/Mojolicious/Plugin/I18N.pm - would somebody please confirm before I start my project?
08:50 d4rkie joined #mojo
08:51 jpn joined #mojo
08:51 dod joined #mojo
08:58 mrphilov joined #mojo
09:02 maxhq joined #mojo
09:08 rwstauner joined #mojo
09:23 arthas joined #mojo
09:31 mire joined #mojo
09:33 powerman1 joined #mojo
09:34 powerman1 hi. how to fix req->url so it will be same both when running as hyphotoad and as cgi using: RewriteRule ^(.*)$ /myapp.cgi/$1 [L]
09:35 denisboyun joined #mojo
09:35 powerman1 right now it looks like there is two differences: url->base contain 'myapp.cgi', which is expected, and url->path doesn't have leading slash, which looks wrong
09:49 nic podz: I18N used to be in core, but was separated out to its own distribution
09:49 podz thanks nic
09:50 podz i am currently struggling to find a way to do domain-specific internationalisation without reinventing the wheel
09:52 podz by domain-specific, i mean multiple domains inside of one language where there can be different per-domain translations for the same word
09:54 nic So you have a subdomain using posh lingo and one using street slang?  it's a common problem :)
09:54 podz let me give a concrete example
09:55 podz i have a category called "shop", and a type called "gas"
09:55 nic I know in S Americas there can be different translations of the same word en->es but in that case you use sub-langs es.??
09:55 podz in finnish, this would be "kauppa" and "kaasu"
09:56 podz however, if I have a category called "amenity" and a type called "gas"
09:56 podz in finnish, this "gas" would become "bensiini" in the domain of amenity
09:57 podz savvy?
09:57 nic yep
09:57 podz how to solve this problem with standard libraries?
09:58 podz perhaps it is unsolvable, and i just need to handle it through a HoH
09:58 nic 'homonyms' is the name of your problem
09:58 nic (I don't think there's a cream for it)
09:59 podz so it's either a HoH, or db table join
10:00 nic I think so; it's not in the scope of I18N
10:00 rem_lex| joined #mojo
10:06 dod joined #mojo
10:09 podz homonym disambiguation - that's the 5 dollar term of the day
10:13 podz thanks, i know exactly how to solve this problem now
10:40 Britzel joined #mojo
10:57 denisboyun joined #mojo
11:13 mire joined #mojo
11:37 Kripton joined #mojo
11:54 dvinciguerra joined #mojo
11:56 phips|mac joined #mojo
12:08 dod joined #mojo
12:15 laouji joined #mojo
12:38 moltar joined #mojo
12:38 mire joined #mojo
12:38 rem_lex|pivo joined #mojo
12:47 podz left #mojo
12:56 bluescreen joined #mojo
13:14 diego_k joined #mojo
13:25 dod joined #mojo
13:41 kbenson joined #mojo
13:42 gabiruh joined #mojo
13:48 powerman1 is if($c->req->env->{GATEWAY_INTERFACE}) correct way to detect cgi environment (to remove cgi file name from base using pop @{$url->base->path};)?
13:49 asarch joined #mojo
13:52 doby joined #mojo
14:04 sri powerman1: what kind of response are you expecting for this issue? https://github.com/kraih/mojo/issues/477
14:05 sri it's pretty much incomprehensible to me
14:05 powerman1 sri: what I'm trying to get is ability to run code with as minimal changes as possible in all these environments
14:06 powerman1 i.e. I'm developing usually with nginx and using / location, but I may need to install that webapp as cgi in /myapp/
14:07 powerman1 right now my before_dispatch hook contain about 30 lines (with comments, of course) to make this possible
14:08 sri i could leave the issue open to see if someone else understands it, but i don't think the chances for that are pretty good
14:08 powerman1 I think url->path and url->base->path should have same values no matter which environment used… at least as much as possible
14:10 sri for me to be able to do anything you either have to propose actual changes (with a patch) or at least prove a bug with a unit test
14:11 powerman1 sri: for example, look at 3rd issue in my list. I'm using url->path to prefix lines in log, for ease tracing which action log that. empty url->path when running as cgi result in _no_ prefix in log, and this break my log parsing tool
14:11 sri clearly there's a language barrier, so odds are you won't get anywhere without code
14:12 sri i do not understand you
14:12 powerman1 ok, I get it. I'll try to provide code or tests.
14:16 gryphon joined #mojo
14:17 sri powerman1: so far it seems more like a feature request i don't understand, which we do not accept on github anymore http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Contributing#Feature_requests
14:19 powerman1 sri: 1st item is most likely bug (I'm working on minimal example for it now); others are request to have existing features work in same consistent way, there is no new feature requests IMO. but that's up to you to decide, of course
14:20 sri that is a feature request
14:26 sh4 joined #mojo
14:30 denisboyun joined #mojo
14:34 powerman1 sri: is https://github.com/kraih/mojo/i​ssues/477#issuecomment-16296139 easier to understand?
14:36 sri powerman1: ok, that's not a bug, *you* are responsible for rewriting the URL properly
14:36 powerman1 I did that exactly as shown in guide. no?
14:36 sri which guide?
14:37 powerman1 cookbook
14:37 powerman1 under "Rewriting"
14:37 sri i'm sure the nginx recipe does not include rewriting
14:38 sri the Rewriting recipe is a hypothetical example, we have no idea how your environment looks like
14:38 sri that depends entirely on your setup
14:38 Kripton joined #mojo
14:38 powerman1 sri: nginx works as reverse proxy, and this topic exactly about that case, isn't it?
14:39 sri so are mod_proxy and varnish, what is your point?
14:39 sri is the recipe so confusing that we should remove it?
14:40 sri obviously there can't be a one size fits all rewriting recipe
14:42 powerman1 sri: am I understand you correctly, you point is: in my setup I have to use "$url->path->trailing_slash(undef) if $url->path eq '//';" because it's specific to my setup (which is actually exactly same setup as recommended in guides)?
14:44 bowtie joined #mojo
14:44 sri i've actually lost track of what exactly we are discussing now
14:45 sri please just propose actual changes, i have the feeling we are talking past each other
14:46 bowtie joined #mojo
14:46 * sri has to run a few kilometers now
14:48 powerman1 sri: :) ok, see. I've set up nginx using setup from guide. works ok for / location. for /app/ location route '/' before broken and require extra workaround when url->path become '//'. is it happens because of:
14:48 powerman1 a) something wrong with nginx setup for non / location?
14:48 powerman1 b) something wrong with push/shift recipe in guide?
14:48 powerman1 c) something wrong with mojo?
14:48 powerman1 d) nothing wrong, just use that workaround.
14:49 powerman1 I may be wrong about mojo, but I expect some guarantees about things like url->path from web framework.
14:49 powerman1 Like if user request / url then url->path should be '/' no matter which engine (cgi or hypnotoad) works now.
14:50 powerman1 So either I'm wrong and mojo doesn't provide any guarantees about such things, or mojo is broken because when it running as cgi url->path will be empty in this case.
14:51 ka2u joined #mojo
15:01 sh3 joined #mojo
15:15 nic powerman1: I hit a similar problem, but I have only a vague recollection of the fix
15:16 nic I think CGI has an env var that get's populated
15:16 two_tired joined #mojo
15:16 nic so strip out the value of the env var from the path, and ta-da! the result is the same on all envs
15:17 basiliscos joined #mojo
15:19 powerman1 nic: actually `pop @{$url->base->path} if $c->req->env->{GATEWAY_INTERFACE}` usually enough
15:20 powerman1 when you cgi (or symlink to it) located in public/
15:21 nic that's probably equivalent
15:21 nic I vaguely remember it being important when doing redirects
15:23 powerman1 actually for cgi you can even doesn't touch base->path at all, if it's ok for you to serve static content using same cgi (which is rarely good choice)
15:38 sri powerman1: ok, that i can answer, no, we do not make any guarantees
15:38 sri we do try hard to do the right thing though
15:39 sri everything mojolicious does is based on crowd sourced CGI environments https://github.com/kraih/mojo/b​lob/master/t/mojo/request_cgi.t
15:39 sri if you want something added, that would be a feature request
15:39 sri patches are of course very welcome
15:40 powerman1 sri: ok, thanks
15:46 denisboyun joined #mojo
15:54 dpetrov_ joined #mojo
15:59 bpmedley_ joined #mojo
16:11 d4rkie joined #mojo
16:15 mattastrophe joined #mojo
16:17 ka2u joined #mojo
16:21 rihegher joined #mojo
16:29 labrown joined #mojo
16:29 inokenty joined #mojo
16:32 rihegher left #mojo
16:33 mire joined #mojo
16:38 suy joined #mojo
16:39 irctc265 joined #mojo
16:43 irctc265 left #mojo
16:49 nic powerman1: Just found my old cgi project...
16:49 rihegher joined #mojo
16:49 nic turns out I found a simpler fix (for me)...
16:49 nic BEGIN { $ENV{SCRIPT_NAME} = '/'; }
16:51 xaka joined #mojo
16:52 * sri hates CGI environments, there are so many ways to break them
16:53 ka2u joined #mojo
16:54 powerman1 actually, after sri explain there no guarantees it looks like instead of trying to carefully fix mojo paths (which is complicated enough) it's much easier to just _set_ them to correct values. looks like 3 lines of code does the trick, but I'm still testing…
17:01 powerman1 yep, it works. https://gist.github.com/powerman/5373490
17:06 sri if everybody does the same, we'll never get better CGI support
17:08 stephan48 :(
17:08 sri perhaps we should just stop trying at all and only support the minimal feature set required for PSGI to work
17:08 stephan48 cgi is nice if you want to test something quickly
17:09 sri for that you don't need all the path correcting features
17:09 sri things get messy once you start messing with mod_rewrite and friends
17:09 stephan48 hehe
17:11 powerman1 sri: if you change 'no guarantees' policy to something strict, like psgi define env vars format it will make sense to add this 'feature' to mojo. if not - it's better to have this snippet in every startup() and have guaranteed paths.
17:13 powerman1 to build something on top of anything that bottom thing must guarantee some sane behaviour, or overall construction will occasionally fail
17:13 sri powerman1: that's silly
17:14 sri if you've ever worked with different web servers you'd know that they all implement CGI differently, and even change things around between versions
17:15 powerman1 yep. that's why we need some extra layer between our code and web servers
17:16 nic powerman1: Try setting $ENV{SCRIPT_NAME}... maybe to ->config('basename')
17:17 powerman1 nic: nope, that won't work
17:19 sri it's so frustrating when people keep throwing around silly hacks instead of searching for the root of a problem
17:21 sri not to mention blaming policy instead of contributing anything constructive
17:22 sri powerman1: is this just the language barrier or are you intentionally only providing the least amount of information necessary to keep the discussion going?
17:22 powerman1 sri: any ideas about how to "search for the root of a problem"?
17:23 ka2u joined #mojo
17:23 powerman1 no, I'm really prefer to use right solution instead of hacks, but in this case only way I see is change policy, as I said.
17:23 powerman1 that doesn't mean I think current policy is wrong - no, it's ok
17:24 powerman1 I just doesn't see other ways. Maybe you'll give me some ideas?
17:25 sri i linked to the unit tests earlier https://github.com/kraih/mojo/b​lob/master/t/mojo/request_cgi.t
17:25 sri add new tests, make them work
17:25 powerman1 for now it looks like there is no way to auto-detect base path in all cases - when nginx configured to non-/ location there is no way to detect it
17:26 sri if they fail, you can trace the route of the problem in Mojo::Message::Request
17:26 sri *root
17:28 powerman1 so, to set base path correctly user much define it manually. that sounds more like noticeable mojo's interface change, not just some fix in ::Request
17:29 sri i'm out of the discussion now, only way to make me pick it up again is with patches
17:32 powerman1 sri: ok, maybe later. I'm just few days with mojo and not familiar with it internals enough to write good non-trivial patches.
17:47 mattastrophe joined #mojo
17:53 GabrielVieira joined #mojo
17:54 ka2u joined #mojo
17:58 njlg joined #mojo
18:04 powerman1 left #mojo
18:21 _xaka_ joined #mojo
18:24 Mike-PerlRecruiter_ joined #mojo
18:24 ka2u joined #mojo
18:30 rem_lex| joined #mojo
18:35 mire joined #mojo
18:37 denisboyun joined #mojo
18:38 sri nic: that applies to you too
18:39 sri at this point i'm almost certain there's a SCRIPT_NAME handling bug that could have been fixed months ago had you reported it
18:55 ka2u joined #mojo
19:06 sh3 joined #mojo
19:46 mattastrophe joined #mojo
20:05 gryphon joined #mojo
20:06 phillipadsmith There is probably a ridiculously obvious answer to this question… nonetheless: given two sites www.domain.com and app.domain.com, where app. is a Mojolicious app, what's the most straightforward way to "include" content from www.domain.com?
20:06 phillipadsmith On www.domain.com, I'm using straightforward include statements to insert a snippet of HTML into the page where necessary. I'm wondering if I'm going to need to grab this content in the app ($ua->get( …) ) and then provide it as a string to the route?
20:17 phillipadsmith Answering my own question: Yep, that works. :)
20:21 sh4 joined #mojo
20:33 alester joined #mojo
20:36 bluescreen joined #mojo
20:38 bluescreen_ joined #mojo
20:41 bpmedley joined #mojo
20:54 s1037989 joined #mojo
21:39 cy joined #mojo
21:50 powerman1 joined #mojo
21:51 powerman1 sri: I've reviewed code. Thing is, to fix paths we need to get real base path from user.
21:52 powerman1 Mojo::Message::Request have no access to app data.
21:52 powerman1 First place where paths in req meet app data is Mojo::Server::new's on(request) handler.
21:53 powerman1 Which is sure bad place to mangle some paths.
21:53 powerman1 Next it goes to Mojolicious::handler(), same thing.
21:53 powerman1 And next time we can catch it is in custom plugin.
21:54 powerman1 So, I see only two options how to make patch you asked for:
21:55 powerman1 a) make new 'core' plugin like PoweredBy to fix paths (it can get real base path from user using either plugin's param or predefined app->config variable)
21:56 powerman1 b) use new environment variable MOJO_BASE_PATH to make real base path available in Mojo::Message::Request
21:56 powerman1 sri: what you think about this?
21:57 sri looks like i did not understand you at all and we wasted a lot of time... because this has absolutely no place in core
22:01 powerman1 so, we back to 'use silly hacks'? :)
22:02 sri you gave the impression that the CGI environment had enough information for Mojo::Message::Request to be smarter parsing it
22:02 cy joined #mojo
22:02 sri if that's not the case, then you're not using a hack, just a normal solution
22:03 powerman1 actually I mention several times what user must provide this data (base path) manually, for ex.:
22:03 powerman1 > (20:28:26) powerman1: so, to set base path correctly user much define it manually. that sounds more like noticeable mojo's interface change, not just some fix in ::Request
22:04 powerman1 if that considered normal solution it probably make sense to add these 3 lines of code to guides instead of current push/shift snippet
22:04 powerman1 to save a day I lost today for someone else
22:04 * sri considers the problem solved and goes back to Mango hacking
22:07 moltar joined #mojo
22:08 powerman1 left #mojo
22:09 rem_lex|pivo joined #mojo
22:25 Kripton joined #mojo
22:27 cy joined #mojo
23:17 jpn joined #mojo
23:17 hrupp_ joined #mojo
23:28 jpn joined #mojo
23:38 jpn joined #mojo
23:45 jpn joined #mojo
23:51 jpn joined #mojo
23:53 d4rkie joined #mojo
23:56 jpn joined #mojo
23:59 KindOne joined #mojo

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