Re: [Catalyst] utf8 on c-res-write or c-res-print

2014-02-20 Thread Tomas Doran

On Feb 20, 2014, at 2:19 PM, Dmitry L. dim0...@gmail.com wrote:

use utf8;

You shouldn’t need this unless you have actual utf8 characters (rather than 
escapes) in your source code.

my $fh = $c-res-write_fh;
my $test = \x{41f}\x{440}\x{43e}\x{431}\x{430};
utf8::encode($test);

You probably actually want Encode::encode(‘UTF-8’, $test);

$fh-write($test);
 
 On 20 February 2014 17:45, Sergey Dmitriev sergey.program...@gmail.com 
 wrote:
 Hello,
 
 I'm trying to put some utf8 strings as a part of Catalyst response as
 follows:
 

Right, you can’t do that :)

If you try to use the raw write interfaces you have to send bytes not 
characters (and so need to encode your utf8 character strings).

 $c-res-print ( ... )
 and
 $c-res-write( ... )
 
 line by line.
 
 However it dies with
 
   Wide character in syswrite at . IO/Handle.pm line 474
 
 Any ideas how can utf8 be written to response?
 
 E.g. set binmode on output handle. Cannot find how.
 Using Catalyst Runtime 5.90042.
 

This is not what you want to do.

The handle is already binary - just you’re not writing binary to it, you’re 
writing characters (and perl does not know how to translate those characters 
into bytes).

Cheers
Tom


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Implementing Webhooks.

2014-01-15 Thread Tomas Doran
My take on this is to log things into ZeroMQ (via Message::Passing), and route 
them to Message::Passing::Output::WebHooks - the code for that output might not 
be as bullet proof as you’re looking for, but it should be a reasonable 
starting place.

I’d probably go right ahead and implement the timeout in that output for a 
first take - you’d lose anything which was waiting in a retry interval as and 
when you restarted the hook server, but that would presumably be very 
infrequently, and if you had _lots_ of timeouts, it could use a lot of RAM.. 
But depending upon that scale / relaibility you actually need both of these 
things might be just fine.

Cheers
Tom

On Jan 15, 2014, at 7:28 PM, Bill Moseley mose...@hank.org wrote:

 I'm running Catalyst under mod_perl2 (currently, subject to change).   Some 
 requests trigger a callback to a user-provided URL -- a webhook.
 
 Obviously, it's best to do those asynchronously and not in-process.   Don't 
 want a web request (or really an Apache process) hanging while waiting on an 
 external web server to respond.
 
 A queue is probably the best approach, but there's also some advantage of 
 having the Catalyst app make the webhook request -- specifically because the 
 Catalyst app has the context of the request and has application logging 
 available. 
 
 How would you implement this?
 
 
 How would that change if you wanted more than just fire-and-forget?  For 
 example, if you wanted to provide some kind of retry interval for failed 
 callbacks. The external server might be temporarily down for maintenance.
 
 
 Thanks,
 
 
 -- 
 Bill Moseley
 mose...@hank.org
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] C::Authentication::Credential::MultiFactors and C::Authentication::Progressive

2013-07-27 Thread Tomas Doran

On Jul 23, 2013, at 12:58 AM, Ferruccio Zamuner nonsolos...@diff.org wrote:

 Hi,
 
 I'm a bit confused about user case
 
 when I can use Catalyst::Authentication::Realm::Progressive
 or
 when I can use Catalyst::Authentication::Credential::MultiFactor
 
 When have I to prefer one of them?

They both look entirely similar.

I'd prefer Catalyst::Authentication::Realm::Progressive, as it's already 
shipped with the auth plugin (and likely to be better maintained).

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: [Catalyst-dev] Trouble with ProxyPass

2013-06-18 Thread Tomas Doran
Moved from dev list to normal list..

On 18 Jun 2013, at 05:16, Andreas Marienborg om...@palle.net wrote:

 
 On Jun 17, 2013, at 6:44 PM, Jillian Rowe jir2...@qatar-med.cornell.edu 
 wrote:
 
 I am looking into using the proxypass option solely for development. I
 
 But I don't think letting Apache (or other frontend web servers like nginx)
 handle serving of files like that is a bad thing.

I think it's a bad thing _for development_, as it's a pain in the ass :)

Cheers
t0m
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: [Catalyst-dev] Trouble with ProxyPass

2013-06-17 Thread Tomas Doran
Hi Jillian.

You wanted the Catalyst list, not the dev list - the dev list is for the 
development of Catalyst itself :)

On 17 Jun 2013, at 12:44, Jillian Rowe jir2...@qatar-med.cornell.edu wrote:

 Hello,
 
 I'm having trouble getting my application running under ProxyPass using
 Apache. I'm not entirely sure if it my worries lie in catalyst or
 apache. I do have another application (not catalyst) which uses
 proxypass with the exact same SSL config and its fine.
 
 It will display pages fine, but when I go to submit a form I get the
 following:
 
 Although this page is encrypted, the information you have entered is to
 be sent over an unencrypted connection and could easily be read by a
 third party.
 

This is as URIs in your form are being generated as http://, not https://

 Are you sure you want to continue sending this information?
 
 
 This is what my apache config looks like:
 
 
ProxyRequests On
ProxyVia On
ProxyReceiveBufferSize 16384
Location /
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse http://127.0.0.1:3000/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
 
SSLRequireSSL
SetHandler perl-script
RequestHeader set X-URL-SCHEME https

You want:

RequestHeader set X-Forwarded-HTTPS ON


Order allow,deny
Allow from all
/Location
 
 I have $c-config-{using_frontend_proxy} = 1.
 

And also this setting to get Plack::Middleware::ReverseProxy loaded (see the 
source code for that for the why I think you need the other header)

 My application works fine if I just do localhost:3000, and it also works
 fine when I run it as a fastcgi application. I do not get the security
 warning when running either under development or fastcgi.
 
 I am looking into using the proxypass option solely for development. I
 am working on an application that uses very big data and log into a
 virtualbox for it. I have several file locations that are references to
 urls.
 
  Alias /bigdata /data/share/web_public/bigdata
Directory /data/share/web_public/bigdata
   AllowOverride All
   Options Indexes MultiViews FollowSymLinks
   order Allow,Deny
   Allow from all
/Directory
 
 So I need something happening with apache I think. Is there anyway to
 get Catalyst to alias those paths for me?

Yes! You can do that quite easily :)

If you make a controller responsible for those paths, then you can just use the 
static file plugin to serve them.. E.g.

package MyApp::Controller::BigData;
use Moose;
use namespace::autoclean;

BEGIN { extends 'Catalyst::Controller' }

sub bigdata: Chained('/') Args {
my ($self, $c, @path) = @_;
# This method comes from Catalyst::Plugin::Static::Simple
$c-serve_static_file('/data/share/web_public/bigdata/' . join('/', @path));
}

I've just mashed this out on the bus - so debugging/fixing will surely be 
needed - but something fairly close to this should work!

 
 I have really been making my head explode over this, and help would be
 very appreciated!!!


Good luck! If you're still struggling then hopping on irc and asking for help 
could be your best (fastest) way to resolve.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Chained and exceptions

2013-05-10 Thread Tomas Doran

On 9 May 2013, at 14:25, Bill Moseley mose...@hank.org wrote:

 I have a feeling I asked this before, but cannot find the post.
 
 [info] Exception powered by Catalyst 5.90030
 
 What's the reasoning that chained actions continue to run after an earlier 
 exception?
 


You're after this: https://metacpan.org/module/Catalyst::ActionRole::DetachOnDie

which gives you the alternate behaviour (i.e. detaching from the chain on first 
exception).

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Chained and exceptions

2013-05-10 Thread Tomas Doran
We should make it a config variable that defaults to the old behaviour but 
adjust -Devel to default it to true in new apps.

This keeps back compat, but makes new apps behave 'correctly'.

+1 from me.

t0m

Aristotle Pagaltzis pagalt...@gmx.de wrote:

* Bill Moseley mose...@hank.org [2013-05-10 17:15]:
 What would the developers think of deprecating this behavior (for the
 few that might actually be relying on this) and issue a warning if
 a config option is not set that fixes the issue?

I’ll second that, I’d love to drop some more unbreak-me boilerplate.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] IMPORTANT SECURITY FIX: Catalyst-Authentication-Store-LDAP v1.013

2013-04-26 Thread Tomas Doran
Hi

Catalyst-Authentication-Store-LDAP version 1.013 (only) contains a major 
security hole.

If you are using this module (at this version) then you MUST upgrade.

To see if you have a vulnerable version installed, run the following command:

perl -MCatalyst::Authentication::Store::LDAP\ 999
Catalyst::Authentication::Store::LDAP version 999 required--this is only 
version 1.014, DATA line 741.
BEGIN failed--compilation aborted, DATA line 741.

If the version number in the error message is = 1.012, then you are NOT 
vulnerable
If the version number in the error message is = 1.013, then you are ARE 
vulnerable - you MUST upgrade.
If the version number in the error message is = 1.014, then you are NOT 
vulnerable

If you are not using the LDAP store in any of your applications (but just have 
it installed), then you are not vulnerable, although I strongly recommend 
upgrading anyway in case you do start using this module at a later time.

The fixed version has only been uploaded in the last few mins. If you want to 
upgrade before this hits a mirror site near you, then you can install the tar 
ball directly by saying:

cpanm 
http://pause.perl.org/incoming/Catalyst-Authentication-Store-LDAP-1.014.tar.gz

Or, if you don't have cpanm installed, you can say: curl -L cpanmin.us | perl - 
-- 
http://pause.perl.org/incoming/Catalyst-Authentication-Store-LDAP-1.014.tar.gz 
or, of course, download the file manually and install with the usual perl 
Makefile.PL  make install

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...

2013-03-31 Thread Tomas Doran
.'
  'init_arg' = 'help_flag'
  'name' = 'help'
  'opt_string' = 'help|usage|?|h!'
  'required' = undef
   2  HASH(0x935d890)
  'doc' = 'Force debug mode'
  'init_arg' = 'debug'
  'name' = 'debug'
  'opt_string' = 'debug|d!'
  'required' = undef
   3  HASH(0x9441a28)
  'doc' = 'Specify a hostname or IP on this host for the server to 
 bind to'
  'init_arg' = 'host'
  'name' = 'host'
  'opt_string' = 'host|h=s'
  'required' = undef   
   4  HASH(0x9441898)   
  'doc' = 'Fork the server to be able to serve multiple requests at 
 once'
  'init_arg' = 'fork'  
  'name' = 'fork'  
  'opt_string' = 'fork|f!'
  'required' = undef   
   5  HASH(0x9440e98)   
  'doc' = 'Specify a different listening port (to the default port 
 3000)'
  'init_arg' = 'port'  
  'name' = 'port'  
  'opt_string' = 'port|p=i'
  'required' = undef   
   6  HASH(0x9059388)   
  'doc' = 'Specify a pidfile'
  'init_arg' = 'pidfile'
  'name' = 'pidfile'   
  'opt_string' = 'pidfile|pid=s'
  'required' = undef   
   7  HASH(0x9441798)   
  'doc' = 'Support keepalive'
  'init_arg' = 'keepalive'
  'name' = 'keepalive' 
  'opt_string' = 'keepalive|k!'
  'required' = undef   
   8  HASH(0x9441178)   
  'doc' = 'Run in the background'
  'init_arg' = 'background'
  'name' = 'background'
  'opt_string' = 'background|bg!'
  'required' = undef   
   9  HASH(0x94411a8)   
  'doc' = 'use Catalyst::Restarter to detect code changes and restart 
 the application'
  'init_arg' = 'restart'
  'name' = 'restart'   
  'opt_string' = 'restart|r!'
  'required' = undef   
   10  HASH(0x9441128)  
  'doc' = 'Restarter directory to watch'
  'init_arg' = 'restart_directory'
  'name' = 'restart_directory'
  'opt_string' = 'restart_directory|rdir|restartdirectory=s@'
  'required' = undef   
   11  HASH(0x94411b8)  
  'doc' = 'Set a restart delay'
  'init_arg' = 'restart_delay'
  'name' = 'restart_delay'
  'opt_string' = 'restart_delay|rd=i'
  'required' = undef   
   12  HASH(0x9441028)  
  'doc' = 'Restart regex'
  'init_arg' = 'restart_regex'
  'name' = 'restart_regex'
  'opt_string' = 'restart_regex|rr=s'
  'required' = undef   
   13  HASH(0x943dc10)  
  'doc' = 'Follow symbolic links'
  'init_arg' = 'follow_symlinks'
  'name' = 'follow_symlinks'
  'opt_string' = 'follow_symlinks|sym!'
  'required' = undef   
   14  HASH(0x943d880)  
  'init_arg' = 'restarter_class'
  'name' = 'restarter_class'
  'opt_string' = 'restarter_class=s'
  'required' = undef   
'params' = HASH(0x942e5d0) 
   'application_name' = 'Waste::Web'
 
 Looks like a red herring to me... Still quite a puzzle!
 
 Disabling the cache is allowing the app to launch, so there's that. :( 
 Further pointers welcome!
 
 
 On Sat, Mar 30, 2013 at 6:55 PM, Tomas Doran bobtf...@bobtfish.net wrote:
 What's the backtrace look like if you load Devel::SimpleTrace or Carp::Always?
 
 Cheers
 t0m
 
 On 30 Mar 2013, at 12:04, will trillich will.trill...@serensoft.com wrote:
 
  We have a Catalyst app Waste::Web that has been running fine and we are 
  trying to upgrade to a more modern set of libraries via cpanm. (One 
  library was upgraded that caused conflicts, now we're running a sweep to 
  get everything updated...)
 
  We have an old app called Spills that still runs fine. The problem is 
  with a different old app called Waste::Web... It won't start, throwing 
  the can't use string as HASH ref error, neither as standalone server for 
  testing nor via apache. Suggestions?
 
 
 
  At first we thought maybe the script formats had changed. So we ran a quick 
  sample catalyst.pl Catalyst::Upgrade to come up with the latest structure 
  for comparison. This I'll call new script below. Then we looked at the 
  script/*pl files, the lib/* files. None of the structures seem to have 
  changed from what we can tell.
 
  That is, the old script/*server.pl script has the same standard structure 
  as the brand new script:
 
  #!/usr/bin/env perl
  BEGIN {
 $ENV{CATALYST_SCRIPT_GEN} = 40;
  }
  use Catalyst::ScriptRunner;
  Catalyst::ScriptRunner-run('Waste::Web', 'Server');
  1;
 
  Comparing lib/Waste/Web.pm (old script) to lib/Catalyst/Upgrade.pm (new 
  script) also looks similar -- commented code redacted for space:
 
  package Waste::Web;
  use Moose;
  use namespace::autoclean;
 
  use Catalyst::Runtime 5.80;
 
  use Catalyst qw/
 ConfigLoader
 Static::Simple

Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...

2013-03-31 Thread Tomas Doran

On 31 Mar 2013, at 19:58, will trillich will.trill...@serensoft.com wrote:

 Hmm. I don't see anything out of line here...?
 
 $ perl Makefile.PL 
 include /home/will/projects/perl-mvc/Waste/inc/Module/Install.pm
 include inc/Module/Install/Metadata.pm
 include inc/Module/Install/Base.pm
 include inc/Module/Install/Makefile.pm
 Cannot determine perl version info from lib/Waste/Web.pm
 include inc/Module/Install/Catalyst.pm
 include inc/Module/Install/Include.pm
 include inc/File/Copy/Recursive.pm
 *** Module::Install::Catalyst
 Please run make catalyst_par to create the PAR package!
 *** Module::Install::Catalyst finished.
 include inc/Module/Install/Scripts.pm
 include inc/Module/Install/AutoInstall.pm
 include inc/Module/AutoInstall.pm
 *** Module::AutoInstall version 1.04
 *** Checking for Perl dependencies...
 [Core Features]
 - Test::More ...loaded. (0.98 = 
 0.88)
 - Catalyst::Runtime  ...loaded. (5.90020 
 = 5.80032)
 - Catalyst::Plugin::ConfigLoader ...loaded. (0.32)
 - Catalyst::Plugin::Static::Simple   ...loaded. (0.29)
 - Catalyst::Action::RenderView   ...loaded. (0.14)
 - Moose  ...loaded. (2.0801)
 - namespace::autoclean   ...loaded. (0.13)
 - Config::General...loaded. (2.49)
 - Catalyst::Plugin::Session  ...loaded. (0.29)
 - Catalyst::Plugin::Session::Store::DBIC ...loaded. (0.11)
 - Catalyst::Plugin::Session::State::Cookie   ...loaded. (0.17)
 - Catalyst::Plugin::Authentication   ...loaded. (0.10016)
 - Catalyst::Plugin::Authentication::Credential::Password ...loaded. (0)
 - Catalyst::Plugin::Authorization::Roles ...loaded. (0.08)
 - Catalyst::Plugin::Cache...loaded. (0.09)
 - DBIx::Class::Cursor::Cached...loaded. (1.01)
 *** Module::AutoInstall configuration finished.
 include inc/Module/Install/WriteAll.pm
 include inc/Module/Install/Win32.pm
 include inc/Module/Install/Can.pm
 include inc/Module/Install/Fetch.pm
 Writing Makefile for Waste::Web
 Writing MYMETA.yml and MYMETA.json
 Writing META.yml
 

That's your app's Makefile.PL

I asked for the Makefile.PL for Catalyst::Runtime (as that includes the 'you 
must upgrade this plugin for this version of Catalyst' warnings.

 And our app class is same as I posted in the original message of this thread 
 -- very standard:
 
 package Waste::Web;
 use Moose;
 use namespace::autoclean;
 
 use Catalyst::Runtime 5.80;
 
 use Catalyst qw/
 ConfigLoader
 Static::Simple
 Session
 Session::Store::DBIC
 Session::State::Cookie
 Authentication
 Authentication::Credential::Password
 Authorization::Roles
 Cache
 /;
 use Waste::Lib::CSV;
 
 extends 'Catalyst';
 
 our $VERSION = '1.10';
 
 __PACKAGE__-config(
 name = 'Waste::Web',
 # Disable deprecated behavior needed by old applications
 disable_component_resolution_regex_fallback = 1,
 );
 
 # Start the application
 __PACKAGE__-setup();
 

Yeah, I'd strongly guess it's one of the plugins :)

 Which cpanm module needs an upgrade? And is there a way for me to figure that 
 out for next time so I don't have to bother the list with it? :)


Hopefully the one running the -Runtime Makefile.PL will tell you :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Argh! Trying to upgrade Catalyst -- getting Can't use string as a HASH ref...

2013-03-30 Thread Tomas Doran
What's the backtrace look like if you load Devel::SimpleTrace or Carp::Always?

Cheers
t0m

On 30 Mar 2013, at 12:04, will trillich will.trill...@serensoft.com wrote:

 We have a Catalyst app Waste::Web that has been running fine and we are 
 trying to upgrade to a more modern set of libraries via cpanm. (One library 
 was upgraded that caused conflicts, now we're running a sweep to get 
 everything updated...)
 
 We have an old app called Spills that still runs fine. The problem is with 
 a different old app called Waste::Web... It won't start, throwing the 
 can't use string as HASH ref error, neither as standalone server for 
 testing nor via apache. Suggestions?
 
 
 
 At first we thought maybe the script formats had changed. So we ran a quick 
 sample catalyst.pl Catalyst::Upgrade to come up with the latest structure 
 for comparison. This I'll call new script below. Then we looked at the 
 script/*pl files, the lib/* files. None of the structures seem to have 
 changed from what we can tell.
 
 That is, the old script/*server.pl script has the same standard structure as 
 the brand new script:
 
 #!/usr/bin/env perl
 BEGIN {
$ENV{CATALYST_SCRIPT_GEN} = 40;
 }
 use Catalyst::ScriptRunner;
 Catalyst::ScriptRunner-run('Waste::Web', 'Server');
 1;
 
 Comparing lib/Waste/Web.pm (old script) to lib/Catalyst/Upgrade.pm (new 
 script) also looks similar -- commented code redacted for space:
 
 package Waste::Web;
 use Moose;
 use namespace::autoclean;
 
 use Catalyst::Runtime 5.80;
 
 use Catalyst qw/
ConfigLoader
Static::Simple
Session
Session::Store::DBIC
Session::State::Cookie
Authentication
Authentication::Credential::Password
Authorization::Roles
Cache
 /;
 use Waste::Lib::CSV;
 
 extends 'Catalyst';
 
 our $VERSION = '1.10';
 
 __PACKAGE__-config(
name = 'Waste::Web',
# Disable deprecated behavior needed by old applications
disable_component_resolution_regex_fallback = 1,
 );
 
 # Start the application
 __PACKAGE__-setup();
 
 In the new script there *is* a new option to the __PACKAGE__-config call but 
 it's just to instantiate the X-Catalyst http header. All serious structures 
 look the same.
 
 But Catalyst::Upgrade runs just fine, and an old app Spill runs just fine, 
 where Waste::Web throws the error:
 
 Waste$ perl script/waste_web_server.pl 
 Can't use string (Waste::Web) as a HASH ref while strict refs in use at 
 /usr/share/perl5/Class/Accessor/Fast.pm line 10.
 Compilation failed in require at 
 /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50.
 
 Waste$ cd ../Catalyst-Upgrade/
 Catalyst-Upgrade$ perl script/catalyst_upgrade_server.pl 
 HTTP::Server::PSGI: Accepting connections at http://0:3000/
 
 Any ideas why we'd be getting this error?
 
 Here's the single-step debug log:
 
 Catalyst::Script::Server::run(/usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm:240):
 DB1 v
 237 $self-pidfile-write
 238:if $self-_has_pidfile;
 239 
 240==  $self-_run_application;
 241 }
 242 
 243 
 244 }
 245 
 246 sub _plack_loader_args {
 
 DB1 s
 Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:88):
 88: my $self = shift;
 
 DB1 n
 Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:89):
 89: my $app = $self-application_name;
 
 DB1 n
 Catalyst::ScriptRole::_run_application(/usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm:90):
 90: Class::MOP::load_class($app);
 
 DB1 p $app
 Waste::Web
 
 DB2 n
 Can't use string (Waste::Web) as a HASH ref while strict refs in use at 
 /usr/share/perl5/Class/Accessor/Fast.pm line 10.
 Compilation failed in require at 
 /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50.
 at /usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm line 90.

 Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0xa5e1660)')
  called at /usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm line 240

 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0xa5e1660)') 
 called at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50
Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Waste::Web', 
 'Server') called at script/waste_web_server.pl line 8
 Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info.  
 
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: 

Re: [Catalyst] Setting an environment variable with the value of a header

2013-03-26 Thread Tomas Doran

On 25 Mar 2013, at 10:18, Robert Rothenberg rob...@gmail.com wrote:

 On 25/03/13 14:11 Tomas Doran wrote:
 
 On 25 Mar 2013, at 11:51, Robert Rothenberg rob...@gmail.com wrote:
 
 The issue is getting Catalyst to use the header in place of the
 environment variable.
 
 
 Erm, the remote user Authentication::Credential::Remote comes from a
 header, not the environment already.
 
 Really? It seems to use the REMOTE_USER variable when I've tried it.
 
 Looking at the source code, it seems to check the environment.

Yes, but 'the environment' != environment variable.

 If Plack is translating headers into special environment variables, then
 it's a matter of telling A::C::Remote a different source.  What would be the
 name?


No, plack translates headers into the PSGI $env - this is completely orthogonal 
to environment variables!

I think you're conflating the two as that is how CGI traditionally works - but 
nothing else does this :)

 E.g. if you run an app as external FCGI, it has it's startup environment,
 but the remote user comes per-request down FCGI (as a header)…
 
 I'm running the Plack server directly, not FCGI, and using a reverse proxy.

Sure - I wasn't suggesting anything about your deployment, just a thought 
experiment to prove it _cannot_ be an environment variable :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst with HTTP authentication

2013-03-26 Thread Tomas Doran

On 25 Mar 2013, at 11:54, Robert Rothenberg rob...@gmail.com wrote:
 
 I'd suggest updating the documentation for A::C::Remote accordingly. (I can
 do this if you point me in the direction of the git repo)

git://git.shadowcat.co.uk/catagits/Catalyst-Plugin-Authentication.git

is the read only repository URI (as per META.yml)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst with HTTP authentication

2013-03-25 Thread Tomas Doran

On 22 Mar 2013, at 13:34, Robert Rothenberg rob...@gmail.com wrote:
 I'm unsure what to do here. Should I write a Plack::Middleware plugin that
 translates the X-Proxy-REMOTE_USER header to an env-{REMOTE_USER}?


That's exactly what's needed here :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Setting an environment variable with the value of a header

2013-03-25 Thread Tomas Doran

On 25 Mar 2013, at 11:51, Robert Rothenberg rob...@gmail.com wrote:
 
 The issue is getting Catalyst to use the header in place of the environment
 variable.


Erm, the remote user Authentication::Credential::Remote comes from a header, 
not the environment already.

E.g. if you run an app as external FCGI, it has it's startup environment, but 
the remote user comes per-request down FCGI (as a header)…

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst with HTTP authentication

2013-03-14 Thread Tomas Doran

On 12 Mar 2013, at 17:10, Robert Rothenberg rob...@gmail.com wrote:

 (Unless you mean you want to do the authentication on the proxy, rather than 
 the app servers).
 
 I want to do the latter.

You should still be able to use Authentication::Credential::Remote, you'll just 
need to re-configure your web server and proxy to do the right thing with 
headers (i.e. the proxy needs to send the username along in a header, and then 
the web server needs to pass that down into the environment.

Have a go and post some configs for your proxy / web server if it isn't working 
for you.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is there an authentication store for htdigest files?

2013-03-12 Thread Tomas Doran

On 12 Mar 2013, at 14:13, Robert Rothenberg rob...@gmail.com wrote:

 I am using Catalyst::Authentication::Credential::HTTP and would like to use
 digest authentication with htdigest files.
 
 Is there an htdigest equivalent of Catalyst::Authentication::Store::Htpasswd?

Not afaik I'm afraid.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst with HTTP authentication

2013-03-12 Thread Tomas Doran

On 12 Mar 2013, at 13:20, Robert Rothenberg rob...@gmail.com wrote:

 On 11/03/13 15:37 Lukas Thiemeier wrote:
 
 I am using Catalyst::Authentication::Credential::Remote in a current
 project. It lets the webserver do all the authentication. You can use
 any authentication method and storage which is supported by your
 webserver, including htpasswd files.
 
 How do you pass the remote user in a reverse proxy?
 
 

It's just http headers, it'll just transparently pass through the proxy.

(Unless you mean you want to do the authentication on the proxy, rather than 
the app servers).

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst with HTTP authentication

2013-03-11 Thread Tomas Doran

On 11 Mar 2013, at 14:10, Robert Rothenberg rob...@gmail.com wrote:
 There is Catalyst::Authentication::Store::Htpasswd, but it does not work
 with Catalyst::Authentication::Credential::HTTP.

Why? How?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Backlog for proposed changes in next Catalyst release

2013-03-10 Thread Tomas Doran
Turning it into a role and making it optionally be applied would be a nice to 
have (i.e. so people could turn it off if needed).

It working seamlessly with apps which already use the (old) plugin is a *must* 
have (but to be fair - maybe we can just filter U::P::U::Encoding out of the 
plugin list if there, and break hard if old C::P::Unicode is found?)

Does anyone have a strong opinion on this being added to their app by default?

Does anyone have an app which needs you to NOT load the unicode plugin? Speak 
now, or you're gonna have a bad time :)

I'm all for this, and I'm feeling that our strategy of doing obsessive 
backwards compatibility has hurt us in the past. If you're not doing unicode 
right, your app is _broken_, and you need to fix it - if that stops you 
upgrading, then so be it.

If anyone cares enough to say this should make it 6.0, that's also cool.

Catalyst 6.0 mandatory being correct… Job done!

Cheers
t0m


On 5 Mar 2013, at 15:42, Bill Moseley mose...@hank.org wrote:

 
 
 On Tue, Mar 5, 2013 at 7:09 AM, John Napiorkowski jjn1...@yahoo.com wrote:
 Bill, I think there's general agreement that the plugin is stable enough and 
 right enough that it should represent core behavior.  Although one of 
 Catalyst's strengths has been to be un-opinionated and leave stuff to 
 external distributions when possible, I think this does fall under the 'all 
 good apps should work this way'.  I've tentatively pegged it for the March 
 Catalyst release, since it seems pretty straightforward, at least for now.  
 If you think you can fit it in (or talk your boss/clients/whatever into 
 paying for your time) please give a shout out.  It would be great to see more 
 people get to know Catalyst internals a bit, otherwise I don't really see how 
 we are going to be able to move the platform forward.
 
 The month of May is more likely for me, unfortunately. 
 
 I was thinking of turning the plugin into a Role and then consuming if the 
 plugin was not already listed or if a config option to disable was not set.  
 That is, on by default but can be disabled.   Is that in line with what you 
 were thinking?
 
 Ha!  I was looking at the code just now and saw a comment that included this 
 URL:
 
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg02350.html
 
 I guess I've thought about this before
  
 
 
 
 I wonder what percent of Catalyst apps make use of that plugin.
 
  Not sure, but I think the play-perl ticket has a good way to not break most 
 people's code
 
 
 -- 
 Bill Moseley
 mose...@hank.org
 
 
 
 
 
 -- 
 Bill Moseley
 mose...@hank.org ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Using the Catalyst Makefile to install

2013-03-10 Thread Tomas Doran

On 8 Mar 2013, at 04:57, Francisco Obispo fobi...@isc.org wrote:

 They are installed by default under the lib/ directory, I'm not a big fan of 
 that setup,

Nobody is a big fan of this setup.

This pre-dates Module::ShareDir.

If someone was to fix things such that new applications installed their stuff 
to the correct Module::ShareDir location, and we (i.e. Runtime) fell back to 
looking under lib/ also (for compat with older applications which hadn't been 
re-installed), then this would get a ++ from me!

I don't think the involved (code) changes are actually particularly hard, just 
nobody has hated it quite enough to fix it.

 so what we usually do (in debian), we setup a custom package that does the 
 magic that we need, including the nginx setup, etc.

I assume you're using 'we' to mean the debian perl team, so I'm cling y'all in, 
sorry!

If debian have a standard way of making this less retarded, then we'd entirely 
love to evaluate that as a downstream patch / thing we can work together to fix.

Exactly where do you relocate things and how does it fit into the toolchain 
(i.e. does this fit to what File::ShareDir does, and if not - why not?)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ActionClass('RenderView') questions

2013-03-10 Thread Tomas Doran

On 5 Mar 2013, at 14:46, E R pc88m...@gmail.com wrote:
 My use case is that I am developing a second view class, but it can't handle 
 all of the templates yet. So the logic I am putting into the end method is:
 
   if (View2 can handle template $c-stash-{template}) {
 $c-stash-{current_view} = 'View2';
   }
 
 This way I can incrementally test View2 as I add capabilities to it.

aha!

I'd handle this with a 3rd view, which just delegates to the 2nd view, then the 
1st if the newer view doesn't like it..

This separates the 'do I call a view at all' logic - which you're happy with 
Catalyst's handling of, from the 'which of my views do I delegate to from _this 
request_' handling - which needs to be your own logic..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Tutorial (in VMware) keeps losing ability to authenticate

2013-03-04 Thread Tomas Doran

On 2 Mar 2013, at 14:54, Dan Lowe d...@tangledhelix.com wrote:

 Thanks for suggestions, everyone. This does seem to be what's happening 
 (despite the fact that the VM is running ntpd). Even quite a while after 
 un-sleeping the computer, the VM continues to have an incorrect date, so ntpd 
 doesn't seem to be doing a very good job here.

ntpd will not adjust things if your time is too wacky, and even if it does, it 
tends to tend _slwly_ back towards a correct setting.

This is exactly the behaviour you want in a server that's on all the time - but 
exactly not what you want in a VM / laptop that gets paused regularly..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] May be asynchronous communication between Catalyst applications

2013-03-04 Thread Tomas Doran

On 4 Mar 2013, at 17:14, linuxsupport lin.supp...@gmail.com wrote:

 Yes, I know that and tried with -f option, but result was same.

No other ideas. Some code you haven't shown us doesn't work as you expect - we 
can't really do anything other than guess at this point :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ActionClass('RenderView') questions

2013-03-04 Thread Tomas Doran

On 4 Mar 2013, at 22:59, E R pc88m...@gmail.com wrote:

 In my root controller, I have this method:
 
 sub end : ActionClass('RenderView') { ... }
 
 I understand that this method is called after the controller for the request 
 has finished and just before the view is called to render any output.
 
 My question is: in this 'end' method, how can I determine what the response 
 status is going to be (i.e. 200, 302, etc.),

As you will have set that already, so you can just call $c-res-status to 
retrieve it.

 and if the response is a redirect how can I get at the redirection location?

Again, you'll have set it already - i.e. it'll be retrievable from 
$c-res-headers if you need it.

What's the use-case here? Generally for a 200 you need to render a template, 
and for a 302 you don't want to (as there is no body), and the RenderView 
action class handles these default cases automagically.

This (generally) means that you don't need to get these values back - why do 
you think you need to / what are you trying to achieve?

 
 Also, what does it mean if $c-stash-{template} is undef at this point?

Maybe :)

You can explicitly set this, or you can let it default (in _some_ views) - it 
depends on your app.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catakyst::Runtime 5.90018 install issues

2012-12-05 Thread Tomas Doran

On 3 Dec 2012, at 21:18, Seven Reeds wrote:

 Hi,
 
 I am running RedHat Enterprise 5.8, perl v5.8.8
 
 I tried installing the runtime and devel modules from CPAN but they
 failed the tests.  I am only focusing on the runtime tests at this
 time though.
 
 First, the initial make seems to do a module dependency check but
 the tests have a version dependency on Getopts::Long.  Updating that
 module fixed the issue but the higher level dependency check should
 have found this.

Which test, which version?

(As yes, they should!)

Getopt::Long isn't actually used anywhere in the tests directly - so I'm not 
sure what to look for here :(

 
 Second, the test t/aggregate/live_component_controller_attributes.t
 fails with the message:
 
Bad name after view' at
 t/aggregate/live_component_controller_attributes.t line 23.
# Looks like your test exited with 255 before it could output anything.
 
 I'm not sure what to do about this one.

I've just installed RHEL 5.8, and successfully installed the latest 
Catalyst::Runtime (without seeing either of your issues) on the system perl.

So anything you're seeing must be due to a bad downstream dependency. :(

I'd be much obliged if you could try chasing these up / working out what they 
are, so that we can fix them.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] [ANNOUNCE] Catalyst-Runtime 5.90019

2012-12-04 Thread Tomas Doran
It gives me great pleasure to announce the latest version of Catalyst-Runtime, 
which fixes issues installing and running on both old (5.8) and new (5.17.6) 
versions of perl!

Full change log below as always.

Cheers
t0m

5.90019 - 2012-12-04 21:31:00
  - Fix for perl 5.17.6 (commit g7dc8663). RT#81601
  - Fix for perl 5.8. RT#61122
  - Remove use of MooseX::Types as MooseX::Types is broken on perl5.8
RT#77100  RT#81121


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst with Twiggy with Pocket.IO (Comet)

2012-11-28 Thread Tomas Doran

On 27 Nov 2012, at 20:11, Jaroslav Zajonc wrote:

 Hi all,
 
 I'd like to enable my Catalyst based (FastCGI) application to support a Comet 
 (Long polling) service with help of Twiggy - Pocket.IO (or Stardust like) 
 server. Now, for my Comet server I still want to use Catalyst app for 
 Authorization/Authentification and proxy only allowed user to Comet server.
 
 I am really struggling to understand how to achieve that. Actually if  
 possible, I'd be more than happy to have pure Catalyst app with Comet support.
 
 My current setup is Apache front-end server with 2nd app-server running 
 CatalystFastCGI app. I intend to build Comet server on app-server as well.
 
 Any idea how can I achieve that?
 

Just also run Twiggy, and direct comet traffic to the twiggy instance on your 
front end apache..

The checking authorisation part for one user will block the server - but that's 
ok really, as this is quick (I mean, it's quick in FCGI, right?) and the comet 
connections are, by their nature, long lived - so you don't make too many of 
them (i.e. there are lots of idle connections - which is why you're using an 
async server, but these connections are long lived - the actual act of 
connecting is rare).

Until you have 1000s of concurrent users, you're unlikely to be doing enough 
re-connections to notice - and when you are, just balance connections across 
multiple copies of Twiggy with mod_proxy_balancer.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Tomas Doran

On 31 Oct 2012, at 09:29, Craig Chant wrote:

 Sorry for the missing capital, and yes that's what I ran... also I'm sorry if 
 I miss ready the tutorial, I have Dyspraxia.
 
 Why would you have two -config statements and not all the setting in one 
 -config , that makes no sense?

Right - you're given the choice to organise things however makes sense to you..

 I did provide the output from the server plus debug screen?
 


Not in this thread, that I can see. Apologies if that's me being blind, but I 
do not see any logs of the server startup debug, or debug for a request.

Cheers
t0m
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't get view / template to work ?

2012-10-31 Thread Tomas Doran

On 31 Oct 2012, at 12:32, Alexander Hartmaier wrote:
 Guys, Craig is on IRC now and I'm helping him to resolve the issue.
 He is using Catalyst::View::HTML::Template not ::TT so the options are
 different.

Awesome, thanks for jumping in an helping, much appreciated! (I have been real 
busy so not looking at irc at all today).

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Unable to output anything in Root.pm - 'auto'

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 12:00, Craig Chant wrote:

 What was the reason for not using DBIC again?
 
 The non-normalised DB with a  missing schema and the fact the data is spread 
 across two SQL servers on separate DSN's.


You didn't say anything there that didn't imply DBIC is fine.

The reason for not using DBIC again?

Also, your SQL abstraction has hilarious SQL injection holes - you do know 
about this, right?

 It's just before the return of the record set or count I was wondering if I 
 need to add '$sth-finish();' or '$dbh-disconnect();' - which I have in my 
 current (non-catalyst) app version of the class (module).

You're doing something wrong with DBI here!

 I also believe that DBIC gets all columns from all tables, which I don't 
 want, dunno, perhaps I'm missing something with DBIC, but I understand my 
 data the way I retrieve it and didn't think there was anything wrong with 
 using my SQL class, it has served me well for 10 years, and powers all my 
 current apps.

That's by default, and optional.

 One thing I have found already is the app doesn't seem to see real time SQL 
 updates even if I issue$sth-finish();$dbh-disconnect(); at the end 
 of my method.
 
 I make a manual change to SQL (switch the 'Locked' flag between 'yes'  'no') 
 , refresh the app and it isn't registering the SQL change, so already it 
 seems something is being cached somewhere and I need to stop this, my apps 
 need to see DB changes instantly.

Again, you're doing something wrong or insane here - this is not normal, so you 
must be asking for it somehow.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 20:08, Craig Chant wrote:

 I'm also convinced there is a caching issue, how can I refresh the browser on 
 a controller/action i've changed the response-body of and still get the old 
 output?
  
 Please advise if there is some form of caching in Catalyst so I can turn it 
 off.

There is no caching, anywhere, unless you explicitly ask for / enable it.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 20:08, Craig Chant wrote:

 The path/controller/action is resolving correctly now, but any response-body 
 change I make in the 'index :Path' action, isn't showing  when i refresh my 
 browser?

You're not showing us the debug output of the failing request, so it's very 
hard to help debug that request.

If you want this form of interactive help, you'd be much better off dropping 
into irc for interactive help, rather than the mailing list, which by it's 
nature is more asynchronous.

Hope to see you in irc!

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Global 'helper' methods

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 14:03, Craig Chant wrote:

 So it seems it’s OK to whack them in the main MyApp.pm , here is an example 
 of what is currently in a ‘MemberGlobs.pm’, which is ‘required’ in 90% of all 
 the perl scripts.

snip

 I’m forever having to switch between UK dates and USA dates so have helper 
 methods.
  
 Where do these go?

The example function was immutable, and side effect free.

As such, it's purely functional, and thus I'd import it (i.e. write a module 
which just exported functions, and export it from there).

 Also where do you put application global constants?

How constant is constants?

If it's configurable, it comes from the config file!

If it's a real constant (as per the functions above), same situation applies.

However, I'd suggest that if you need functions such as this, your entire 
approach is broken! You should be inflating all dates and times into DateTime 
objects, and then using a correctly configured DateTime::Formatter::XXX to 
format them as appropriate for the output context.

This would mean that you'd set the date format generically for a user / page / 
whatever granularity you want, and you'd do conversion in one or two places - 
thus supporting the DRY principle, and allowing you to be much more flexible in 
future, when you need other date/time output formats.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Global 'helper' methods

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 14:39, Craig Chant wrote:

 Well I opted for putting my globals (methods and constants) in MyApp.pm
 
 It's working grand with $c-myMethod or $c-MY_CONSTANT
 
 I use to have them working as a bareword within my application , but 
 $c-MY_CONSTANT is just as easy!

It's also several times slower :)

Unless they are methods (which use state) or constants which are really config, 
they're really better off in a function based style.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Global 'helper' methods

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 15:03, Craig Chant wrote:
 
 Plus I always felt loading an entire module to re-arrange a tiny string seems 
 a bit OTT?

Yes, it is :)

If you know that re-arranging a string is all you're ever going to be doing, 
then sure - don't' do that..

However, usually when you're dealing with the US, then you're _also_ dealing 
with a time zone offset, right? You don't want to only show local format dates, 
but also local time zones.

As a case in point, right now (for this working week), we're out of daylight 
savings time in the UK, however they're still in daylight savings times on the 
east of the US…

I for one do not want to care about this sort of stuff, ever.

 Dunno, what's the overhead of DateTime?


Significantly less than the overhead of caring about time zones, ever. :-D

If you're only doing day resolution (or only UTC), it's less convincing…

But basically, I wouldn't care unless it specifically shows up as slow in a 
real profile - premature optimisation is the root of all evil, etc. 

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Global 'helper' methods

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 15:47, Hugh Barnard wrote:

 Hi 
 
 On measurement in general, I'd recommend: Devel::NYTProf::Apache ; there's a 
 write up here:
 http://www.slideshare.net/bobcatfish/profiling-with-develnytprof 
 

++

Personally, I'd not be using mod_perl if I could help it, but NYTProf is 
awesome!

 . It looks like I've been having performance problems because millions of 
 rows get blessed into objects, not sure of this but it looks like a DBIC 
 thing at the moment. 

Inflating a million objects is costly.

Are you really building an HTML page with a million rows? If so, why (isn't 
paging a better solution?)

I.e. I'd generally say you should either paginate things, or make the query 
return an aggregate set of results by doing the math or whatever at the DB 
server.

However, if you really do need to re-inflate a lot of stuff, look at 
DBIx::Class::ResultClass::HashRefInflator - given you only want the raw data 
and none of the clever, this is much much faster :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.
  
 I have a controller Login.pm
  
 I ran the view helper script ‘create view HTML HTML::template’
  

This can't possibly have worked? You mean create view HTML HTML::Template right?

 As per the tutorial I’ve added the following to the config section of MyApp.pm
  
 TEMPLATE_EXTENSION = '.tp',   

This needs to be inside the following block

 'View::HTML' = {
 #Set the location for templates files
 INCLUDE_PATH = [
 __PACKAGE__-path_to( 'root', 'src' ),
 ],
 },
  
 I have created a template in ‘root/src/login’  of login.tp
  
 In my controller I have …
  
 sub login :Path :Args(0) {
 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');   
  
 }
  
 But all I get is…
  

No idea.

  
 What am I doing wrong?
  

Not showing us the full debug output of starting the server and making the 
request.

Sorry to be harsh - but it's impossible to divine what code your app is running 
without that output…

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can't get view / template to work ?

2012-10-30 Thread Tomas Doran

On 30 Oct 2012, at 23:06, David Schmidt wrote:

 On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:
 
 On 30 Oct 2012, at 16:52, Craig Chant wrote:
 
 I seem stuck with implementing my first view / template.
 
 I have a controller Login.pm
 
 I ran the view helper script ‘create view HTML HTML::template’
 
 
 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?
 
 As per the tutorial I’ve added the following to the config section of 
 MyApp.pm
 
TEMPLATE_EXTENSION = '.tp',
 
 This needs to be inside the following block
 
'View::HTML' = {
#Set the location for templates files
INCLUDE_PATH = [
__PACKAGE__-path_to( 'root', 'src' ),
],
},
 
 C::M::Tutorial says otherwise
 
 http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View


Sorry, but you're wrong.

The tutorial says:

Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
following:

The OP says: As per the tutorial I’ve added the following to the config 
section of MyApp.pm

So, the OP has done something totally different to what the tutorial says, and 
thus it will behave differently.

If he moves that line to inside the View (as the tutorial suggests), it'll work.

If he moves it to inside the 'View::HTML' block in MyApp.pm, thus namespacing 
it into the appropriate component, it'll work.

Where it is right now - it will be ignored.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Moose's make_immutable in Catalyst classes

2012-10-24 Thread Tomas Doran

On 24 Oct 2012, at 05:35, Toby Corkindale wrote:
 I was just wondering.. should we be adding Moose's make_immutable call
 to the end of these classes?
 ie. __PACKAGE__-meta-make_immutable;


This makes things faster if you construct lots of them (and also makes things a 
bit safer, as they can't be changed), at the cost of a bit of startup time.

Generally Catalyst components are only initialised once (i.e. they're scoped to 
the lifetime of the app), so there is no speed benefit to immutable in this 
case (actually, it's probably a startup speed reduction), but I still tend to 
use it for the safety…

So it's entirely optional, in classes which implement ACCEPT_CONTEXT (and so 
are constructed once per request), you will see a speed benefit from doing it, 
but this is the less unusual case.. 

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst-Runtime 5.90017 isntallation problem

2012-10-23 Thread Tomas Doran

On 22 Oct 2012, at 07:48, Siddhartha wrote:

 Hi 
 
 
 I have problem to install Catalyst-Runtime 5.90017 on OpenSUSE 12.1
 Any ideas


This fail is due to changes in HTTP::Message (we were relying on it's internals 
in tests and they changed) - you can safely force the install, or you can 
downgrade HTTP::Message 2 releases and it'll all work.

Now fixed in master, there will be a new release soon.

Cheers
t0m




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-23 Thread Tomas Doran

On 23 Oct 2012, at 11:37, Craig Chant wrote:

 Bingo - You are a genius Tom!
 
 Thank you so, so much, I would never have found that switch buried in the 
 documentation for a long, long time!
 
 I cannot thank the Catalyst community enough for bearing with me and taking 
 the time to provide all the suggestions and support I have received!

Woop!

Really glad that's fixed for you :-D

I know there were a few things you worked out during this discussion / issue 
that it'd be worthwhile clarifying in the documentation…

The one I know for sure, I've already done:

http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Manual.git;a=commitdiff;h=689b0b148a6d4e4c6257618f412460d925c11659

Please could someone offer a patch to fix / clarify this? 
(git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git)

TIA
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-23 Thread Tomas Doran

On 23 Oct 2012, at 12:04, Lyle wrote:

 On 23/10/2012 11:37, Craig Chant wrote:
 Bingo - You are a genius Tom!
 
 Thank you so, so much, I would never have found that switch buried in the 
 documentation for a long, long time!
 
 As this is standard behaviour for IIS, Catalyst really should be setting this 
 by default when it's running under IIS. I didn't realise Catalyst had missed 
 this, otherwise I probably could have answered the op's question from the 
 start.

The option is on by default in generated skeleton apps, and has been for quite 
a while (at least 2 years). However we can't set it by default as it breaks 
back compat (see the extensive explanation of the different strategies for path 
resolution one can employ next to the option).

This should be done at the Plack middleware level IMO - I.e. there should be 
middleware to synthesise a sane PATH_INFO - this is generic to anything that 
uses PATH_INFO (not just Catalyst), and it's where / how we already apply all 
of this conditional logic.

I'd +1 a patch to add a middleware for this (to Plack).

 IIS also doesn't have the pwd as the folder where the script is running. So 
 you usually need to do:
 
 use FindBin qw ($RealBin $RealScript);
 use lib $FindBin::RealBin;
 chdir $RealBin;
 
 Otherwise you get issues when people try to open files with a relative path.


This is normal in other web servers also.

Doing that is broken, we provide $app-path_to so you don't ever have to do 
that.

Cheers
t0m
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-23 Thread Tomas Doran

On 23 Oct 2012, at 22:03, Lyle wrote:

 Otherwise you get issues when people try to open files with a relative path.
 
 This is normal in other web servers also.
 
 Doing that is broken, we provide $app-path_to so you don't ever have to do 
 that.
 
 How is it broken?

Because, as much as possible, code should attempt to separate concerns.

The pwd should be the responsibility of the web server layer, not a dependency 
of your application component.

Standard daemonization techniques include a chdir('/') step 

which is always going to ruin relative paths.

Your application precluding your web stack from being a daemon is a pretty big 
ask, no?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-22 Thread Tomas Doran

On 18 Oct 2012, at 14:15, Craig Chant wrote:

 Here is the output for the /librarydocs path.
 
 
 *** $env
 
 $VAR1 = {
  'psgi.multiprocess' = 1,
  'SCRIPT_NAME' = '',
  'PATH_INFO' = '/',


Right, that's IIS asking for a path of /

Ergo Catalyst serves / :_)

I know other people have got this working on IIS7, so it must be possible to 
get the correct path passed to your app (but I don't know how)..

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-22 Thread Tomas Doran

On 18 Oct 2012, at 14:15, Craig Chant wrote:
 Here is the output for the /librarydocs path.
 
 
 *** $env
 
 $VAR1 = {
  'psgi.multiprocess' = 1,
  'SCRIPT_NAME' = '',
  'PATH_INFO' = '/',

snip

  'REQUEST_URI' = '/librarydocs'

Actually, do you you have the 'use_request_uri_for_path' config variable set, 
or not?

(https://metacpan.org/module/Catalyst#CONFIGURATION)

As setting that to true may fix your issues..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Progress bar

2012-10-20 Thread Tomas Doran
And UploadProgress is shipped, should be available once it's reindexed 
(permissions cock up), which should be shortly :)

Cheers
t0m

On 19 Oct 2012, at 22:51, Tomas Doran wrote:

 
 On 18 Oct 2012, at 16:14, Bill Moseley wrote:
 How close is this version of Catalyst for a release?  Unfortunately, I 
 noticed this while preparing for an app release next week.
 
 About now - there are a couple of other patches, and I have half a tuit spare 
 :)
 
 Cheers
 t0m
 
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] [ANNOUNCE] Catalyst-Runtime 5.90017

2012-10-19 Thread Tomas Doran
I'm very happy to announce the latest release of Catalyst-Runtime.

This release contains a number of small improvements to enable extensibility, 
and a bug fix.

Full changelog below as always.

Cheers
t0m

5.90017 - 2012-10-19 22:33:00
  - Change Catalsyt _parse_attrs so that when sub attr handlers:

1) Can return multiple pairs of new attributes.
2) Get their returned attributes passed through the correct attribute 
handler.

e.g sub _parse_Whatever_attr { return Chained = 'foo', PathPart = 'bar' }

Will now work because both new attributes are respected, and the Chained
attribute is passed to _parse_Chained_attr and fixed up correctly by that.

  - In Catalyst::Test, don't mangle headers of non-HTML responses. RT#79043

  - Refactor request and response class construction to add methods
that roles can hook to feed extra parameters into the constructor
of request or response classes.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Progress bar

2012-10-19 Thread Tomas Doran

On 18 Oct 2012, at 16:14, Bill Moseley wrote:
 How close is this version of Catalyst for a release?  Unfortunately, I 
 noticed this while preparing for an app release next week.

About now - there are a couple of other patches, and I have half a tuit spare :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Progress bar

2012-10-17 Thread Tomas Doran

On 17 Oct 2012, at 07:13, Dimitar Petrov wrote:

 Hey Bill,
 
 I think t0m fixed that a week ago in trunk and it should be working. You 
 might want to check the trunk of the Catalyst and the Plugin and to see if it 
 works for you and probably ask t0m to upload new version on CPAN.

This needs a Catalyst release first - I was waiting till there were a few more 
changes for that, but if it's hurting people now, we could do a new version 
with just the tiny changes I made to support this.

Can I get a 'yes this new code works' from someone trying it before we ship new 
versions? :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Progress bar

2012-10-17 Thread Tomas Doran

On 17 Oct 2012, at 15:54, Bill Moseley wrote:

 
 
 On Wed, Oct 17, 2012 at 12:34 AM, Tomas Doran bobtf...@bobtfish.net wrote:
 
 
 This needs a Catalyst release first - I was waiting till there were a few 
 more changes for that, but if it's hurting people now, we could do a new 
 version with just the tiny changes I made to support this.
 
 By the way, I wonder if it wouldn't be cleaner to use _build_request instead 
 of a builder for the args.   In this case might have to completely override 
 _build_request to inject in the cache -- or make the cache rw so that it 
 can be set after _build_request.

No, and the explicit reason it's not cleaner is that 'rw' - would that we could 
change things so that the request object was constructed in it's final 
immutable form!

 Seems like giving the request the app as an attribute would be a bad idea, 
 but not clear what that is. :)
 

Too much coupling! App has a request has an app - ARGH.

 I've been struggling a bit with hierarchy of classes where I need to pass 
 child construction params down to child constructors.  I've added parent 
 attributes to the child classes, manually passed args (as you are doing 
 here), and even had separate config objects that I pass around.  Haven't 
 found anything that I'm that fond of.

You should inject _just_ the dependencies that the class in question needs, 
having explicitly broken them out.

Passing the app down makes the app a 'god object'.

Why would you care? Well, Say you want to persist most session data into the 
DB, but you're happy with progress bars being in memcache - if you pass the 
cache explicitly to the request you can do this trivially, if you pass the 
entire $c or $app down to the request, you cannot do this at all.

Hope this helps!

Cheers
t0m
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-17 Thread Tomas Doran

On 17 Oct 2012, at 16:49, Craig Chant wrote:

 Hi,
  
 I’ve been going round in circles unable to find any help on why my catalyst 
 application won’t work on IIS7 Windows Server 2008 R2
  
 I find all the documentation to be incorrect,, such as setting the path to 
 ‘*’ stops all static content being served from the root/static directory , I 
 had to put ‘*.’ For images etc to show.
  

Patch please?

 Now I cannot get any path to be recognised, 
 http://mydomain/mycontroller/mymethod does nothing, and all that will load is 
 the Root.pm - sub index :Path :Args(0) method.
  

Loading the wrong URI is significantly different to doing nothing, no?

 It doesn’t matter what URL I point my browser to all I ever get is the 
 welcome screen from the Root.pm index method.
  
 If I use localhost for the devel server the app resolves the URL path 
 correctly and the associated action runs from the correct controller.
  
 However, over IIS7 it will not work and I cannot find any resources to 
 explain why.
  
 Please help!
  

You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug 
logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please 
add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one 
at the start to dump $env, and two near the bottom to dump $c-request-uri and 
$c-request-base just after they've been assigned to…

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] X-Forwarded-Path

2012-10-10 Thread Tomas Doran
You're not doing anything wrong - there just isn't a common spec for doing 
this..

You probably want to be using Catalyst::TraitFor::Request::ProxyBase, which I 
wrote specifically for this use-case however :)

Cheers
t0m

On 10 Oct 2012, at 14:34, Stephen Shorrock wrote:

 Hi,
 
 Catalyst 5.90011
 
 I'm trying to run an application behind a frontend proxy where the
 path at the front end is not route:
 
 config on frontend.mydomain.ac.uk
 
 Location /CUFSE
   RewriteEngine On
   RewriteCond %{REMOTE_USER} (.+)
   RewriteRule . - [E=RU:%1]
   RequestHeader set REMOTE_USER %{RU}e
   RequestHeader set X-Forwarded-Path '/CUFSE'
   ProxyPass http://backend.mydomain.ac.uk:5000/
   ProxyPassReverse http://backend.mydomain.ac.uk:5000/
 /Location
 
 On the backend my application is run via starman and has contained in
 its configuration:
 
 __PACKAGE__-config(
   name = 'CUFSE',
   using_frontend_proxy = 1,
   ...
 
 I would there for expect that when calling $c-uri_for('some/path') I would 
 get:
 
 http://frontend.mydomain.ac.uk/CUFSE/some/path
 
 but the frontend portion of the path is not there instead I only have:
 
 http://frontend.mydomain.ac.uk/some/path
 
 I've attempted to grep all Perl modules for /X[_-]Forwarded[_-]Path/i
 but with no joy.
 
 Is the passing of the path supported or am I doing something incorrectly
 
 (source of method:
 http://wiki.catalystframework.org/wiki/wikicookbook/frontendproxy)
 
 Thanks in advance
 
 Stephen
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Testing with 5.8 and 5.9 on one system

2012-09-19 Thread Tomas Doran
Either perlbrew or local::lib should work perfectly for what you want to do.

Cheers
t0m

On 18 Sep 2012, at 10:35, Geovanny Junio :: eutsiv wrote:

 Do you know perlbrew?
 
 Em 18/09/2012 05:52, Hugh Barnard hugh.barn...@gmail.com escreveu:
 Hi folks
 
 I am currently working on [a clients] Catalyst application that has problems 
 with 5.9 and works with 5.8. I'm doing this on their system so I'd prefer to 
 be minimally invasive too.
 
 My current though is to install 5.9 in my home directory on their system 
 using local::lib: earch.cpan.org/~apeiron/local-lib-1.008004/lib/local/lib.pm 
 and then switch between the two by modifying the use statements for the tests.
 
 However, I'd welcome any suggestions, experiences and/or tips when doing 
 something like this. The ideal is [for me] two VMs or two systems but that 
 isn't currently an option. 
 
 Best regards Hugh Barnard
 
 -- 
 http://www.hughbarnard.org
 http://www.twitter.com/hughbarnard
 http://www.big-wave-heuristics.com/
 
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Testing with 5.8 and 5.9 on one system

2012-09-19 Thread Tomas Doran

On 19 Sep 2012, at 11:07, Hugh Barnard wrote:

 Hi folks Thanks for both of these. What I've done so far, in case anyone else 
 ends up with something like this:
 
 1. Partial rehearsal on one of my own systems!
 2. Used local::lib to get Catalyst in local_perl in my home directory
 though I think might be able to just use Makefile.pl with PREFIX?
 3. [Happily] there's a module preload in the application which sets some 
 'extra' @INC values
 so I've pushed my local Catalyst directory onto the 'front' of that…

You shouldn't really need or want to do either of step (2) or step (3) here.

Instead you should just set the environment variables that local::lib tells you 
before running Makefile.PL (unless I'm misunderstanding you).

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Streaming video online to a flash or HTML5 player

2012-09-18 Thread Tomas Doran

On 14 Sep 2012, at 20:06, Hector Azpurua wrote:

 I'm developing a site with serves several videos online, using Catalyst and 
 the JWplayer, and I cant find a stable way of stream the videos to the client 
 player with the capability of start the video from a random point.
 
 I searched the web for some ways to do it but I cannot find a simple way of 
 implementing it in Catalyst (RTMP or HTTP Pseudostreaming) because i need my 
 program to serve the videos only if a user have the permission to do it, not 
 serve the file directly. The only simple example that i found was a old 
 Catalyst script streaming an MP3 
 (http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Streaming/lib/Streaming.pm)
  but I didn't know if that will work as expected if I apply that technique to 
 videos.

Yes, it will.

 What would be a good approach to serve online videos in Catalyst/Perl in a 
 non complicated way? Or what is the recommended way to do it?

A lot of people use the web server to do this, using X-Sendfile (lighttpd or 
apache mod_sendfile) or X-Accel-Redirect (nginx).

This pushes the work of serving the file off to the web server (which is more 
efficient), but also allows your application to do the access control.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Applying roles that contain actions.

2012-09-07 Thread Tomas Doran

On 5 Sep 2012, at 21:48, Bill Moseley wrote:
 
 Currently I just manually apply the role directly in the existing controller, 
 so not a huge issue, but would be handy if I could just add a role to the 
 base class and pull in all the components

What's stopping you doing this?

There is no reason you can't have actions (from a role) in a base class..

Alternatively, if you want to switch things on and off from config, look at 
CatalystX::Component::Traits.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Localizing output in Catalyst plugins using $c-loc

2012-09-03 Thread Tomas Doran

On 3 Sep 2012, at 08:53, Jan Grmela wrote:
 What is the best way to localize strings in a Catalyst plugin?

If it's a 'real' plugin, then it's already composed onto the app, and so you 
can just use $c-loc - do you instead mean a model or other component that 
doesn't have such easy access?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIx::HA

2012-08-26 Thread Tomas Doran

On 26 Aug 2012, at 09:49, Theo Bot wrote:
 You are right. It's an DBIC issue. Do you happen to know where I csn address 
 this issue?
 

I'd start with the places documented by DBIC for help with DBIC :)

https://metacpan.org/module/DBIx::Class#GETTING-HELP-SUPPORT

Although I have to say I don't particularly see how this is related to 
DBIx::Class either, given DBIx::HA isn't part of that either - however I'm sure 
that they're more likely to have answers, and/or be able to tell you if using 
one with the other is possible...

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIx::HA

2012-08-25 Thread Tomas Doran

On 25 Aug 2012, at 10:41, Theo Bot wrote:

 I already create a model with the ..._create.pl script. But I want to use a 
 dual-master mysql setup. And I want the application server to be able to 
 failover over to a back-up server.

Yes, and this functionality is nothing to do with Catalyst, so I don't see how 
Catalyst is relevant here ;)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIx::HA

2012-08-24 Thread Tomas Doran

On 24 Aug 2012, at 08:34, Theo Bot wrote:
 How do I implement the DBIx::HA module for using a dual-master mysql 
 implementation?

No idea, but I know it's not relevant to catalyst, as you're going to do this 
outside Catalyst and bind it in with a Catalyst::Model::Adaptor, right? :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] working around request timeouts

2012-08-21 Thread Tomas Doran

On 21 Aug 2012, at 17:54, James R. Leu wrote:

 Chakkit et. al.
 
 Catalyst::Plugin::RunAfterRequest ended up being the easiest first step.
 Thank you Chakkit, for the suggestion.
 
 Now that I have this implemented I'm seeing why a work queue system
 is needed if this fix needs to be more then an interim solution.
 I quickly use up all the child processes, and simply adding more children
 process will not scale.
 
 My thought is to implement a hybrid work queue Run after Request (RaR)
 system.  Where the work queue contains the closures that would
 normally be handed to RaR.

Why? I mean, you need very minimal info here - you need to persist a 'work to 
do' thing to the DB, just log that to a message queue (where something picks it 
up later).. The message is very minimal, like { type = Job::FooBar, id = 
 }

Much simpler and easier + lower coupling - the stuff that implements the job 
can change independently of the app.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Parsing of undecoded UTF-32 at /home/davidw/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Catalyst/Test.pm

2012-08-16 Thread Tomas Doran

On 16 Aug 2012, at 02:45, Bill Moseley wrote:
 
 Shouldn't that code check that the content-type is HTML before attempting to 
 parse?


Yes!

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst Roles With ACL

2012-08-14 Thread Tomas Doran

On 14 Aug 2012, at 18:12, Blaine Everingham wrote:
 
 When I try and run my program I get 
 Failed to load user data.  You passed [ARRAY(0x39a8964)] to authenticate() 
 but your user source (MyApp::User) only has these columns: 
 [id,alias,name_first,name_last,email]   Check your authenticate() call.
 
 Any idea on how I can load the roles?


You didn't show us the -authenticate() call in your code that the error 
message tells you is the problem.

Before doing anything else, I'd like to see that call, to check it isn't the 
source of the problem ;_)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] How to handle role checking using a MockObject for Catalyst contexts

2012-08-06 Thread Tomas Doran

On 6 Aug 2012, at 15:56, Robert Rothenberg wrote:

 My application has a lot of tests scripts (and even some utility scripts)
 that create a Test::MockObject that imitates a Catalyst context.
 
 But it's largely a kluge, especially for handling authentication with things
 like
 
  $c-check_any_use_role(...)
 
 So, what are the best practices for generating a fake Catalyst context that
 is, for all intents, logged-in as a particular user?
 

Test::MockObject is fairly evil (it uses UNIVERSAL::can and UNIVERSAL::isa 
which are fundamentally broken).. But this solution is entirely workable.

Personally, latterly, I've just been using Moose directly when I want to mock a 
class:

Moose::Meta::Class-create(….

e.g. https://gist.github.com/199215 (from 
http://bobtfish.livejournal.com/265829.html)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Change in $c-engine-prepare_parameters

2012-08-04 Thread Tomas Doran

On 3 Aug 2012, at 14:39, Bill Moseley wrote:

 What it doesn't do any more is set $c-req-parameters when called directly, 
 only when called as a builder.
 
 
 I don't think prepare_parameters should be both a builder AND a method.   
 What about this approach:

+1, except I think the clearer should be _clear_parameters - we don't want to 
add a new public method for this if it can be avoided.

Fancy making a 'proper' patch someone can apply which does these changes and 
updates the relevant doc?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] po files directory for I18n and compilation

2012-07-25 Thread Tomas Doran

On 24 Jul 2012, at 23:57, Jeremy Trench wrote:

 Hi, I have just started to use I18n for localization. It works fine, but I am 
 surprised because it seems that .po translations are only active after 
 restarts.
 This way I can´t give customers the freedom to localize/customize their app. 
 I am the webmaster, I must restart the app for every change they do in the 
 translations.
 And the .po files must be loaded in myapp/lib/I18n. But I dont want to give 
 them permissions to use that directory...
 Is there something I can do?
 .mo files are compiled versions of .po files. Can't they be used somehow to 
 avoid restarts?

Put the translations in the database if they're dynamic data which changes? :)

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] X-Forwarded-Port works no more?

2012-07-25 Thread Tomas Doran

On 24 Jul 2012, at 07:22, Alex Povolotsky wrote:

 On 07/23/12 21:52, Tomas Doran wrote:
 On 23 Jul 2012, at 08:48, Alex Povolotsky wrote:
 
 Hello,
 
 I'm setting up MojoMojo, https-protected.
 
 However, it keeps making http: urls.
 
 Setting X-Forwarded-Port did not help a bit, and trying to grep 
 X-Forwarded-Port to 443 did not help as well.
 
 I've set fastcgi_param HTTPS 1, and it helps, but why X-Forwarded-Port is 
 mentioned but does not work?
 
 Your post implies that your running the app as an FCGI, however you're 
 caring about X-Forwarded headers, which are only relevant if you're running 
 the app behind a proxy.
 
 Which (or both) of these are you specifying?
 
 Can you show us your web server config, and app config?
 
 
 Yes, FCGI
 

snip

 fastcgi_param HTTPS 1; # Only this line helps

snip

What does you mean with the comment there? I'd expect that line to be there, be 
necessary, and make things work?

 === mojomojo.conf ===
 name  MojoMojo
 using_frontend_proxy 1

You do not want to set this - you are not using a frontend proxy.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Managing module regressions.

2012-07-24 Thread Tomas Doran

On 24 Jul 2012, at 19:17, Fred Moyer wrote:
 Also, these experiences are that of a large team developing large apps
 to hundreds of servers. The experience of one developer deploying to a
 small environment will certainly be different.


I wonder how life would be different if you just deployed an entire perlbrew 
per app, so /opt/MyApp/bin/perl - this would make the cost of upgrading things 
much more trivial, as the cost would be per project, rather than having a wider 
impact.. It would also allow teams for each product to be strongly conservative 
(if that suited the team in question), or running much newer versions of stuff 
(on younger apps / more agile teams) - rather than having to dictate a version 
policy organisation wide. 

I'm _not_ saying it would be better - everyone's environment and constraints 
are different, but thinking 'what if' about an entirely different strategy is 
entirely worthwhile. A lot of your pain seems to come from the fact that you 
can only have one version of every library on each system.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Why does the installer include the 'xt' directory

2012-07-24 Thread Tomas Doran

On 24 Jul 2012, at 19:14, Robert Rothenberg wrote:

 On 24/07/12 18:34 Bill Moseley wrote:
 
 
 On Tue, Jul 24, 2012 at 9:35 AM, Robert Rothenberg rob...@gmail.com
 mailto:rob...@gmail.com wrote:
 
 
 Try this:
 
 

 http://search.cpan.org/~bobtfish/Catalyst-Devel-1.37/lib/Module/Install/Catalyst.pm#catalyst_ignore(@ignore)
 
 
 Maybe run make distclean first?
 
 You are calling catalyst_ignore before calling catalyst in your Makefile.PL?
 
 If those are done then this always works.. :)
 
 vim $(perldoc -l Module::Install::Catalyst)
 
 Ok. Silly cause of the problem. The documentation says it is a regex, rather
 than a file glob. Changing it from '.*[.]t$' to '*.t' seems to work.
 

Doc patch please? :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] X-Forwarded-Port works no more?

2012-07-23 Thread Tomas Doran

On 23 Jul 2012, at 08:48, Alex Povolotsky wrote:

 Hello,
 
 I'm setting up MojoMojo, https-protected.
 
 However, it keeps making http: urls.
 
 Setting X-Forwarded-Port did not help a bit, and trying to grep 
 X-Forwarded-Port to 443 did not help as well.
 
 I've set fastcgi_param HTTPS 1, and it helps, but why X-Forwarded-Port is 
 mentioned but does not work?


Your post implies that your running the app as an FCGI, however you're caring 
about X-Forwarded headers, which are only relevant if you're running the app 
behind a proxy.

Which (or both) of these are you specifying?

Can you show us your web server config, and app config?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] catalyst install fails on View::Component::SubInclude

2012-07-18 Thread Tomas Doran

On 18 Jul 2012, at 10:21, Andrew Baxter wrote:

 Hi,
 
 I'm trying to set up 'Gitalist' on a server; it uses Catalyst as a framework, 
 and the install is failing when it tries to install 
 Catalyst::View::Component::SubInclude.

snip

 Can anyone help with this?

Sorry about this - it's known broken (and we're being yelled as it's blocking 
new Catalyst in debian Wheezy). We're working on fixing it - however the 
easiest solution currently is to do some manual downgrades.

If you install Catalyst::Runtime version 5.90012 and then 
Catalyst::Plugin::SubRequest 0.16, then you should find that everything works 
as expected.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] prepare_body_chunk in Catalyst 5.9

2012-07-16 Thread Tomas Doran

On 12 Jul 2012, at 21:42, Eric Wright wrote:

 Looking into this further - in the the source for Catalyst I see that the 
 prepare_body statement has been moved to the Request object removing the 
 ability to hook into this event via the Plugin architecture. I was using this 
 hook to monitor the number of chunks transmitted to the server for monitoring 
 upload progress. I take it this approach is not going to be supported any 
 longer? From a design perspective, would it be recommended that I instead 
 extend and implement my own Request class for this purpose? Appreciate the 
 feedback. 

sigh

double sigh - I accidentally didn't send this - less relevant now..

bummer :(

I'm responsible for the changes in question, and what you are doing is an 
entirely valid use-csse.

To the wider community - is anyone else doing this?

To you, Eric - do you have any logistical or cultural problem moving this 
functionality to a custom request class/role (role recommended)?

As unless anyone disagrees (feel free if you think I'm wrong!), I think the 
change is actually good, and should stay (as only a very few people will be 
affected by it), but we should note it in Catalyst::Upgrading.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Plack::Middleware based session for Catalyst apps?

2012-07-15 Thread Tomas Doran

On 15 Jul 2012, at 10:29, Octavian Rasnita wrote:

 Hi,
 
 Is it possible to use Plack::Middleware sessions in Catalyst apps?

sub session { shift-request-env-{session} } ?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: Re [Catalyst] How to update data of already logged-in user?

2012-07-13 Thread Tomas Doran

On 13 Jul 2012, at 11:51, Sergey Dmitriev wrote:

 Ok, if so, no problem, i just need hint like 'how to do it right way'. :)

Clone the git repository, make a patch, mail it to the list :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: Re [Catalyst] How to update data of already logged-in user?

2012-07-12 Thread Tomas Doran

On 12 Jul 2012, at 07:18, Sergey Dmitriev wrote:

 Thank you Lu. BTW, set_authenticated is marked as internal method in 
 documentation, so it could be changed some day.
 

Well volunteered?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Wiki is Temporarily Unavailable

2012-07-03 Thread Tomas Doran

On 2 Jul 2012, at 23:46, Darren Duncan wrote:
 
 So is this the leap-second bug or the power outage or something else? -- 
 Darren Duncan

(1) or (3), not (2).

VM had hard locked, no console output etc :(

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Wiki is Temporarily Unavailable

2012-07-03 Thread Tomas Doran

On 3 Jul 2012, at 09:14, Alexander Hartmaier wrote:

 It was (1) if ntpd in the vm wasn't running according to what I've read.

Wasn't running? eh?

The bug in question was only triggered when ntpd _WAS_ running, and had 
signalled the kernel to take the leap second.

Your statement is, I guess, a typo?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Using Progressive realms when username and password fields are all different

2012-06-30 Thread Tomas Doran

On 29 Jun 2012, at 10:59, Will Crawford wrote:

 On 28 June 2012 23:12, Gavin Henry gavin.he...@gmail.com wrote:
 ...
 Thanks Tim. Yes, I know that but then the other two realms will fail
 and that's the point of progressive. I want to call one -authenticate
 which tries all the realms I've defined in progressive_oauth.
 
 Regrettably, the docs for the Password realm saith:
 
NOTE If the password_field is something other than 'password', you
 must be sure to use that same field name when calling
 $c-authenticate().
 
 I'd call that a bug, personally - it certainly isn't intuitive that
 you can specify the field to use, but then have to remember it in all
 your calls to authenticate().
 
 Not much can be done about that, though. Maybe someone can produce an adaptor?

I don't disagree that it's confusing, however it _is_ intentional, as you can 
pass an arbitrary hash of data into $c-authenticate for the auth info 
(allowing you to do lookups on the values of multiple fields).

What happens is that the configured 'password_field' is _removed_ by the 
Password credential when it calls the 'find_user' method, and then the 
remaining fields are passed to the store to lookup a user with - this allows 
you to say $c-authenticate({username = $u, password = $p, is_admin = 1});

For example.

Patches to improve the documentation would be welcome, of course! :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Using Progressive realms when username and password fields are all different

2012-06-30 Thread Tomas Doran

On 29 Jun 2012, at 21:18, Gavin Henry wrote:
 The main problem is that and the fact that username_field is missing.
 
 I'd like to do -authenticate( { username = $blah, password = $blah2 })
 
 if username_field and/or password_field is in the config, map those to
 above values, if not
 just use the default. Otherwise there's no way you can use a
 Progressive realm with
 non-consistent user/pass field names in your DB. I could add a
 viewbut it's not my
 DB.
 
 Silly or sane?

What you want / need is to be able to re-map the auth-info in some way before 
(or at the time of) the call to $realm-find_user

I'd suggest that C::Authentication::Realm be patched to support a 
'authinfo_mangle' config key, which would look something like this:

{
add = {
some_key = 'some_value',
},
remove = [qw/ some_other_key /],
rename = {
from_field_name = 'to_field_name',
}
}

This would allow you to add/remove/rename arbitrary fields that were passed 
into $c-authenticate({}); - this would solve the issue in a generic way, right?

Cheers
t0m





___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] ANNOUNCE Catalyst-Runtime 5.90015

2012-06-30 Thread Tomas Doran
Hi

I'm pleased to release the latest maintenance of Catalyst - 5.90015.

This release fixes regressions and incompatibilities resulting from he 
refactoring in 5.90013, and is a highly recommended upgrade for anyone using 
versions 5.90013 or 5.90014.

Full change log below as always.

Cheers
t0m

--

5.90015 - 2012-06-30 16:57:00
  - Fix $c-finalize_headers getting called twice. RT#78090
  - Fix test fails in Catalyst-Plugin-Session-State-Cookie. RT#76179
  - Fix test fails in Catalyst-Plugin-StackTrace
  - Fix test fails in Test-WWW-Mechanize-Catalyst


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] using perldoc on VM

2012-06-12 Thread Tomas Doran

On 11 Jun 2012, at 17:02, André Walker wrote:

 Anyway, it wouldn't hurt to have it installed by default. Shouldn't we update
 the VM? Who has permission to do so?

Yes!

Please hassle kd and/or hkclarke until it gets sorted out - (and / or just 
report a bug in the Tutorial - they do get looked at and fixed in batches!)…

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Additional scripts accessing the Model and Config?

2012-06-08 Thread Tomas Doran

On 7 Jun 2012, at 23:17, Luis Muñoz wrote:

 The part that's stumping me is how to go within Dump.pm about obtaining a $c 
 that allows me to get to the configuration (taken from the same place where 
 the web application takes it) and the model. 

You don't.

$c implies a web request context, which you don't have.

You can, however, call things as class methods, so:

$self-application_name-model('DB')-schema-foo

should work from inside your script, for example.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Additional scripts accessing the Model and Config?

2012-06-08 Thread Tomas Doran

On 8 Jun 2012, at 19:05, Luis Muñoz wrote:

 he configuration data (for instance, how to setup the database/ldap/whatever 
 Model, etc). Does that happen as well when using the class method?

Sorry - I'm confused - how does calling into the app to get stuff as 
$self-application_name-model('Foo')-some_method(@stuff)

not fix your problem?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] CatalystX::JobServer (anyone use it?)

2012-06-05 Thread Tomas Doran

On 4 Jun 2012, at 23:25, Seth Daniel wrote:

 I found CatalystX::JobServer mentioned in a thread from about a year
 ago.
 
 It seems to still only be on github.  Does anyone use this?  Can anyone
 recommend it?
 
 https://github.com/bobtfish/CatalystX-JobServer
 
 
 I am looking at using RabbitMQ and I already have a catalyst server
 doing some other things.  It seemed like an interesting idea to combine
 them somehow.

Hi Seth :)

I consider CatalystX::JobServer a failed experiment.

I was trying to do too many things (and too many new things!) at once. There is 
some interesting code there to steal, but whilst it probably 'works', I 
wouldn't recommend trying using that code in production.

Most of the good parts got ripped off by dakkar++, and combined with the (ideas 
from the) Catalyst::Engine::STOMP stuff, to make:

https://metacpan.org/release/CatalystX-ComponentsFromConfig
https://metacpan.org/release/Catalyst-ActionRole-JMS
https://metacpan.org/release/CatalystX-ConsumesJMS

which is ActiveMQ specific, but a nice jobs solution.

I pulled my experience from that and other things out into a stab at something 
more generic:

https://metacpan.org/module/Message::Passing

You can use ZeroMQ, STOMP or AMQP!

However, I haven't yet CPAN'd a Message::Passing specific process manager to 
manage a worker pool, or blessed a specific way of running workers, or got 
workers which can consume messages from multiple possible work pools etc..

What you're looking for is easily possible to do with the framework, I just 
haven't yet got anything reusable enough to share generally yet…

I'm hoping to expand the docs a lot in the next couple of weeks, and I'm 
talking about it at YAPC::NA, but feel free to drop into #message-passing to 
pick my brains and/or tell me how my documentation sucks!!

Cheers
t0m




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] $c-user and session questions

2012-05-31 Thread Tomas Doran

On 31 May 2012, at 14:00, Kenneth S Mclane wrote:

 I have an LDAP server authenticating my users. The look up returns a ton of 
 fields in a hash. My questions are as follows: 
 
 1. What happens to this data/information? Is it stored in the $c-user 
 object? 

Yes

 2. If it is, how do I access it? 

https://metacpan.org/module/Catalyst::Authentication::Store::LDAP::User

Like that. Specifically the -ldap_entry method is probably what you're after.

 3. Is there a simple way to look at what is stored in the user object? 

Data::Dumper::Dumper($c-user) ?

 4. I would like to store the users role in the session object so it can be 
 accessed for authorization purposes. The docs only have an example of storing 
 stuff in a shopping cart, which is a bit more than I need, but there isn't 
 enough there for me to figure out how to store just one thing, and retrieve 
 it, of course. Can someone show me how to do this? 
 

You need to override the user class, and implement the for_session and 
from_session methods to get additionally stuff serialized.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Role problems, Still

2012-05-24 Thread Tomas Doran

On 24 May 2012, at 13:45, Kenneth S Mclane wrote:

 Well since the passwords are maintained by a company wide system and can be 
 authenticated via LDAP, I don't think I want to reinvent the authorization, 
 since it is working.
 I think I will just reinvent the role checking, which should be much simpler.

Erm? The role checking _is_ the authorisation??

You mean 'the authentication'?

And I'm not suggesting you re-invent it… I was suggesting you continue to do it 
from LDAP?

 My question is: can I store the role information in the user session? I'll be 
 reading up on that today. Maybe one day I'll get ambitious and figure out how 
 to do it the way I wanted to. 

sure, you can just subclass the user class with your own user class to override 
the 'roles' method, and the 'for_session' and 'from_session' methods to do what 
you want.

Cheers
t0m
 
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Role problems, Still

2012-05-23 Thread Tomas Doran

On 23 May 2012, at 16:37, Kenneth S Mclane wrote:

 I am having difficulty in getting my user to authenticate against the second 
 realm. After successfully authenticating against the ldap server, I want to 
 authenticate against the dbic realm as well as that is where the roles are 
 stored. It seems to ignore a second call to $c-.authenticate. 

In this case, I would be using the DBIC authentication store module (not the 
LDAP one), with the self_check Credential option + the auto_create_user option, 
and writing a check_password method (yourself) which looked up the user in LDAP 
and did the auth there…

If you want roles and other foreign keys etc - then you want the user row from 
DBIC to be master, and authentication to just be delegated down to that row 
instance..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Module::Install::Catalyst and Test::Prereqs conflict?

2012-05-23 Thread Tomas Doran

On 23 May 2012, at 11:26, Robert Rothenberg wrote:

 I think that there is a problem using the Makefile.PL with Test::Prereqs and
 similar modules.
 
 When I run prereqs_ok(), I get the following error:
 
 _get_prereqs: Error loading Makefile.PL: Can't call method
 load_all_extensions on an undefined value at
 /usr/local/share/perl/5.10.1/Module/Install.pm line 206, DATA line 4267.
 BEGIN failed--compilation aborted at ./Makefile.PL line 4, DATA line 4267.

What leads you to suspect that this is anything to do with 
Module::Install::Catalyst?

I'd have guessed at a bug between Test::Prereqs and Module::Install itself, 
rather than the Catalyst specific extension..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Module::Install::Catalyst and Test::Prereqs conflict?

2012-05-23 Thread Tomas Doran

On 23 May 2012, at 17:15, Robert Rothenberg wrote:

 On 23/05/12 17:06 Tomas Doran wrote:
 
 On 23 May 2012, at 11:26, Robert Rothenberg wrote:
 
 I think that there is a problem using the Makefile.PL with Test::Prereqs and
 similar modules.
 
 When I run prereqs_ok(), I get the following error:
 
 _get_prereqs: Error loading Makefile.PL: Can't call method
 load_all_extensions on an undefined value at
 /usr/local/share/perl/5.10.1/Module/Install.pm line 206, DATA line 4267.
 BEGIN failed--compilation aborted at ./Makefile.PL line 4, DATA line 4267.
 
 What leads you to suspect that this is anything to do with 
 Module::Install::Catalyst?
 
 I'd have guessed at a bug between Test::Prereqs and Module::Install itself, 
 rather than the Catalyst specific extension..
 
 It occurs in some of the other modules that do the same thing, such as
 Module::CPANTS::Kwalalitee::Prereq.
 

So nothing?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] LDAP question

2012-05-22 Thread Tomas Doran

On 21 May 2012, at 17:12, Kenneth S Mclane wrote:

 I'm going to post this up here to avoid those quoting issues. I'm x'ing out 
 my password for obvious reasons. 
 

You missed out the app boot, and the initial bind / search… Which are the bits 
I think are going wrong.

Also, I think my bad - you probably want debug option 12, rather than 3 (for a 
more readable dump.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] LDAP question

2012-05-22 Thread Tomas Doran

On 21 May 2012, at 22:24, Kenneth S Mclane wrote:

 So I should leave it as self_check?

No.

You set it as plain / don't set it at all, as the password needs to be passed 
through Catalyst un-mangled - as the auth is done by logging in _as the user_ 
(and therefore with their password) in LDAP.

Cheers
t0m
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] LDAP question

2012-05-21 Thread Tomas Doran

On 21 May 2012, at 15:20, Kenneth S Mclane wrote:

 I am continuing on my journey to duplicate a web app for administering a db. 
 I have all my pages up and running, as well as search functionality.  I 
 decided to attack authentication next. I am using a php pages from a 
 different web app to get the settings for our LDAP server. 
 
 //Connect to ldap server 
 $ds=ldap_connect(xxx.xxx.xxx.xxx); 
 if ($ds) { 
 //Get ID for intranet user 
 $sr=ldap_search($ds, ou=ldap.server, o=domain.com, 
 mail=$username); 
 $info = ldap_get_entries($ds, $sr); 
 for ($i=0; $i$info[count]; $i++) { 
 $uid=$info[$i][dn]; 
 } 
 

snip

 credential = { 
 class = 'Password', 
 password_field = 'password', 
 password_type = 'self_check', 
 },

You don't want self_check here I don't think.

  
 store = { 
 binddn  = username, 
bindpw  = password, 
 class = 'LDAP', 
 ldap_server = '9.17.186.253', 
 ldap_server_options = { timeout = 
 30 }, 
 user_basedn = 'o=domain, o=com', 

Original code has:
 ou=ldap.server, o=domain.com


as the base? (Although a base higher up the tree should be fine)

 user_field = 'mail', 
 user_filter = 
 '((mail=%s)(objectclass=person))', 

You're searching more restrictively than the PHP code.

Try just 'mail=%s'

 user_scope = 'sub',  

 }, 
 }, 
 }, 
 }, 
 );
 
 They are apparently doing the initial bind with the credentials submitted by 
 the user, I am getting invalid credentials the way I have it above, if I 
 change it to anonymous I get a LDAP Error while searching for user: No such 
 object.  I could use some suggestions. 

You can turn on LDAP debugging and get a print out of what is actually going to 
= from the LDAP server, which would help determine which query specifically 
is failing..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] LDAP question

2012-05-21 Thread Tomas Doran

On 21 May 2012, at 16:42, Robert Wohlfarth wrote:

 On Mon, May 21, 2012 at 9:20 AM, Kenneth S Mclane ksmcl...@us.ibm.com wrote:
 They are apparently doing the initial bind with the credentials submitted by 
 the user, I am getting invalid credentials the way I have it above, if I 
 change it to anonymous I get a LDAP Error while searching for user: No such 
 object.  I could use some suggestions. 
 
 I dealt with an LDAP server that required you to login to query your own 
 information. The standard Catalyst::Authentication::Store::LDAP does not work 
 with this model.

Yes it does! What makes you think it doesn't?

 So I wrote a credential module that did nothing more than connect to the LDAP 
 server. If the connection succeeded, then that user is authenticated. 

That sort of strategy is usually a bad idea, as you're mandating that you have 
1 flat level of LDAP for users - you have to know the DN to bind as initially, 
and so if you do this, you have to concatenate the username to a DN in some way 
- which means if you ever reorganise your LDAP (for example putting users into 
grouped OU containers), then your auth will stop working.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] LDAP question

2012-05-21 Thread Tomas Doran
Your quoting and HTML mail settings are really broken!

You are not quoting anyone else's email, but just changing it's font - which 
means that anyone using a text mail client without fonts can't see the quoting..

On 21 May 2012, at 16:18, Kenneth S Mclane wrote:

 You can turn on LDAP debugging and get a print out of what is actually going 
 to = from the LDAP server, which would help determine which query 
 specifically is failing.. 
 
 I cannot find anything out there on turning on LDAP debugging? Strangely, if 
 I out my username and password in the bind fields it gives me Invalid 
 credentials. I authenticate through this ldap server many times a day, so I'm 
 almost sure it's some setting that is wrong. 

I'm sure some setting is wrong too!

But it's going to be hard to guess which one without knowing what error code 
gets returned, to what query!

The debugging bit isn't as obvious as I remember it being, sorry about that:

https://metacpan.org/module/Catalyst::Authentication::Store::LDAP#ldap_server_options

so you want to set: ldap_server_options = { debug = 3 } # Incoming and 
outgoing packets

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] [ANNOUNCE] Catalyst-Runtime 5.90012

2012-05-19 Thread Tomas Doran
Hi

I'm pleased to announce the latest maintenance release of Catalyst::Runtime, 
5.90012.

This release fixes issues with the upcoming perl 5.16.0, and has various other 
small fixes and documentation improvements.

Full change log is below as always.

Cheers
t0m

5.90012 - 2012-05-16 09:59:00

 Distribution META.yml changes:
  - author key is now correct, rather than what Module::Install
mis-parses from the documentation.
  - x_authority key added.

 Bug fixes:
  - Fix request body parameters being multiply rebuilt. Fixes both
RT#75607 and CatalystX::DebugFilter

  - Make plugin de-duplication work as intended originally, as whilst
duplicate plugins are totally unwise, the C3 error given to the user
is less than helpful.

  - Remove dependence on obscure behaviour in B::Hooks::EndOfScope
for backward compatibility. This fixes issues with behaviour changes
in bleadperl. RT#76437

  - Work around Moose bug RT#7536 which breaks
Catalyst::Controller::DBIC::API.

 Documentation:
  - Fix documentation in Catalyst::Component to show attributes and
calling readers, rather than accessing elements in the $self-{} hash
directly.
  - Add note in Catalyst::Component to strongly disrecommend $self-config
  - Fix vague 'checkout' wording in Catalyst::Utils. RT#77000
  - Fix documentation for the 'secure' method in Catalyst:Request. RT#76710


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] OpenID authentication just redirects back to the login page

2012-05-14 Thread Tomas Doran

On 14 May 2012, at 16:37, Robert Rothenberg wrote:
 
 Any idea's what's happening?

No, as we have no idea what code is executing, or how that code has been 
configured.

Need debug logs from the app and details about your auth config to even start 
guessing, sorry!

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] How to sudo using the Authentication plugin

2012-05-11 Thread Tomas Doran

On 11 May 2012, at 17:45, Robert Rothenberg wrote:

 We're working on an application with a lot of users, and where the passwords
 are encrypted (and future versions may also allow OpenID logins).
 
 Developers would like the ability for the root user to be able to become
 another user, for the purposes of debugging problems that real users might
 be having on a live system.
 
 How does one do this using the Authentication plugin?
 
 Obvious things to try like the $c-user($new_user) doesn't work, not does
 the (internal) $c-set_authenticated($user, $real) method.
 

The recommended approach would be to keep $c-user 'pure', and to arrange to 
stash the current user in a top level base chain part, or top level auto.

If everything then subsequently uses $c-stash-{current_user} - then you can 
do your sudo (or whatever other mechanism you may need in future) simply by 
swapping out the user here.

This makes things a lot more pure - as the canonical user that $c-user will 
give you is (more) immutable..

Also, if you swap the 'canonical' user part way through the request - when the 
session plugin comes to re-serialize the session at the end of request - you're 
pretty stuffed, as you're now writing out the wrong user… I.e. re-sudoing, or 
doing any root level action is likely to require you to log out and log in 
again - not what you actually want! :)

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Query not working

2012-05-10 Thread Tomas Doran

On 10 May 2012, at 15:17, Kenneth S Mclane wrote:

 I am trying to port this query to Catalyst: 

You mean DBIx::Class - Catalyst is totally database agnositc (no database is 
even required)

Whilst a lot of people here also use DBIC (and DBIC questions often get 
asked/answered here), you're generally more likely to get useful advice on the 
DBIC mailing list.

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Problems upgrading .psgi file (Warning You are running Catalyst::Engine::PSGI, which is considered a legacy engine for, this version of Catalyst. - Error response must be an array r

2012-05-03 Thread Tomas Doran

On 3 May 2012, at 07:52, Erik Wasser wrote:
 [error] response must be an array reference
 
 This error message comes from the source of mod_psgi.
 
 The content after the restart with the modified .psgi file is a 500
 Internal Server Error error page from every request.
 
 I'm using Catalyst 5.90011. What's wrong here? Isn't mod_psgi working
 anymore? Is mod_psgi still the way to go with apache and catalyst? Did I
 read Catalyst::Runtime correctly?

Catalyst uses the psgi.streaming interface, and mod_psgi doesn't support this.

Try adding Plack::Middleware::BufferedStreaming to make your responses 
unbuffered?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


  1   2   3   4   5   6   7   8   9   >