Re: [Catalyst] What happened to the Catalyst wiki?

2022-08-21 Thread Andrew
You can access the wiki via the WayBackWhen Machine at Archive.org it seems:
https://web.archive.org/web/20200216182737/http://wiki.catalystframework.org/wiki/



 
- Original Message - 
From: "Brian Lowe" 
To: 
Sent: Friday, August 05, 2022 9:46 AM
Subject: [Catalyst] What happened to the Catalyst wiki?


Hey all,

Several places in the Catalyst site refer to the wiki, but it's gone offline. 
Is there a way to restore it?

I have a couple of other questions as well, but I'll leave them for the time 
being. I'm hoping there's enough of a Catalyst community here to respond to 
some questions I have about the documentation.

Brian



___
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] Encoding

2020-02-10 Thread Andrew
There is also more info on Unicode Strings and Octets here:
http://modernperlbooks.com/books/modern_perl_2016/03-perl-language.html#VW5pY29kZWFuZFN0cmluZ3M

  - Original Message - 
  From: Andrew 
  To: The elegant MVC web framework 
  Sent: Tuesday, February 11, 2020 12:37 AM
  Subject: Re: [Catalyst] Encoding



  So what's happening in the controller, that might change it?

  Are you using commands or modules that work only with octets instead of UTF-8?

  my $octets = encode("UTF-8", $utf8_string);
  ...converts UTF-8 to Octets.

  my $utf8_string = decode("UTF-8", $octets);
  ...converts Octets to UTF-8.

  I put...
  use Encode qw(decode encode);
  ...at the start of my controller to use these functions.

  My UTF-8 boiler plate for my Catalyst Controllers is:

  #Always:
  use  strict;
  use  warnings;
  use  Moose;
  use  namespace::autoclean;

  #UTF-8:
  use  utf8;
  use  v5.30;
  use  warnings (
 'FATAL', #makes anything in this list fatal
 'utf8',  #utf8 is a warnings category. 
);

  #Specific: 
  use  Encode 
 qw(
  decode 
  encode
 );

  ...and any other specific modules I need, I put in the specific bit.

  The reason I use...
  use v5.30;
  ...is because it enables for following features:

  unicode_strings (auto-enabled with "use v5.12;" or higher),
  unicode_eval (auto-enabled with "use v5.16;" or higher),
  fc (auto-enabled with "use v5.16;" or higher).

  I guess I could just use v5.16, haha.
  I use v5.30 because it's fun to be working with the latest Perl, =).

  There are two webpages I found useful for understanding Perl and Unicode:

  
https://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default/6163129#6163129

  https://www.perl.com/pub/2012/04/perlunicook-standard-preamble.html/

  However, I do not know if it is a Perl and Unicode issue.
  It could be a MySQL issue,
  it could be a really simple mistake somewhere in the code, etc,
  it could be the other module you're using, etc.

  Until you share more context,
  it's difficult to know what the problem could be.
  Even then, I'm not an expert at character codes, ^_^.
  I do hope someone in this list can help you though,
  and everything works out, =).



- Original Message - 
From: Theo Bot 
To: The elegant MVC web framework 
Sent: Monday, February 10, 2020 1:22 PM
Subject: [Catalyst] Encoding


Hi,


I created a controller that requests data from a mysql database via another 
module. The data in this case is a place in Germany called "Münster". In the 
module that requests the data from mysql, with the mysql_enable_utf8 flag set 
to 1,  it is still correct just before it is returned to the catalyst 
controller. But what it arrives in the controller someting has changed. The 
original character values are:
77 - 252 - 110 - 115 - 116  - 101 - 114



But when they arrive in the controller it has changed into



77 - 195 - 188 - 110 - 115 - 116 - 101 - 114



And becomes unreadable. How do I handle this?

-- 



Kind regards


Theo










___
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] Find Action via Public Path.

2017-12-05 Thread Andrew
No one has replied yet, so I've taken to accomplishing the end result I was 
after using this:
http://wiki.catalystframework.org/wiki/wikicookbook/safedispatchusingpath

Basically...

 my $string="coolpage";
 $c->request->path($string);
 $c->dispatcher->prepare_action($c);
 $c->go($c->action, $c->request->args);


  - Original Message - 
  From: Andrew 
  To: The elegant MVC web framework 
  Sent: Tuesday, December 05, 2017 5:00 AM
  Subject: [Catalyst] Find Action via Public Path.


  Hello,

  Hope you're all well, =).

  Do any of you know what the best way to find an action name, via a public 
path, may be?
  I found $c->dispatcher->get_action_by_path($path) only works for private 
paths internal to our app.

  So for example, if we have:
  website.com/coolpage
  ...I've got the string "coolpage" and I want to call the associated action 
within my catalyst app.
  I thought it would be more secure to use the string to look up a 
corresponding action name / subroutine, and then call that subroutine, rather 
than call a request for whatever happens to be in the string.

  Any advice, appreciated.

  Many thanks,

  Yours,
  Andrew M.



--


  ___
  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] Find Action via Public Path.

2017-12-04 Thread Andrew
Hello,

Hope you're all well, =).

Do any of you know what the best way to find an action name, via a public path, 
may be?
I found $c->dispatcher->get_action_by_path($path) only works for private paths 
internal to our app.

So for example, if we have:
website.com/coolpage
...I've got the string "coolpage" and I want to call the associated action 
within my catalyst app.
I thought it would be more secure to use the string to look up a corresponding 
action name / subroutine, and then call that subroutine, rather than call a 
request for whatever happens to be in the string.

Any advice, appreciated.

Many thanks,

Yours,
Andrew M.

___
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] Custom Folder Names...?

2016-08-14 Thread Andrew
Hello, =).

Is it possible to customise the folder names of a Catalyst app?
For example: rename the Controller folder...?

Just wondered... =).

Yours,
Andrew.
___
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] KISS - Base Subroutines.

2016-07-15 Thread Andrew
I want to apologise for saying I was having trouble with extends.

When using extends,
$self->subroutinename(); worked fine,
while just subroutinename(); didn't - and that was my hiccup/mistake.
It's now working fine with $self->subroutinename(); to call the subroutine, 
although I've obviously had to anticipate the first value of @_ now being $self.

I'm new to Modern Perl, so still a bit iffy on things like $self (I know it's 
an object - and that's it),
so I'm intrigued to hear you mention simply using Use instead of extends.
I was searching through a lot of online tutorials, and all the older ones have 
use and use base as examples in base controller tutorials,
and the more recent ones mention extends instead.
The Definitive Guide to Catalyst states: "use base 'Catalyst::Controller' and 
use Moose; extends 'Catalyst Controller' are essentially the same,".
I also found a Catalyst Advent Calendar post (2008, Day 16) mentioning that in 
previous Catalysts you would use use, whereas in 5.80+ you could use use Moose, 
and then extends. I guess it's just another option - good to hear a plain old 
use could work also. KISS, =).

Yours,
Andrew.

  - Original Message - 
  From: Martin Thurn 
  To: The elegant MVC web framework 
  Sent: Friday, July 15, 2016 2:21 PM
  Subject: Re: [Catalyst] KISS - Base Subroutines.


  Don't bother with the extends stuff.  Just 


  use MyApp::CommonUse::FileOne;







   - - Martin 









--

  From: Andrew <catalystgr...@unitedgames.co.uk>
  Sent: Friday, July 15, 2016 9:10 AM
  To: The elegant MVC web framework
  Subject: Re: [Catalyst] KISS - Base Subroutines. 


  I'd have to look into how to do that, John.

  Right now, I've got something working, so I'll continue to build on that.

  One problem I have come across with my approach of a CommonUse folder, and 
.pm files within it,
  is when one of the .pm files needs to be used by another.

  I thought I could merely have the first file, extending 
Catalyst::Controller

  BEGIN { extends 'Catalyst::Controller' }

  and the second file, extending the first file:

  BEGIN { extends 'MyApp::CommonUse::FileOne' }

  ...and then the controller that needs to use FileTwo, extending that...

  BEGIN { extends 'MyApp::CommonUse::FileTwo' }

  Unfortunately, when FileTwo tries to call a subroutine in FileOne, I get:
  "Undefined subroutine ::CommonUse::FileTwo::subroutinename"
  If I stop worrying about the BEGIN/extends block, and instead just type: 
MyApp::CommonUse::FileOne::subroutinename(); it executes fine. 

  In short:
  I've a base controller directory called CommonUse.
  There are two files in it.
  How can FileTwo use subroutines in FileOne, without typing the explicit 
package path each time?

  Many thanks,

  Yours,
  Andrew.








--


  ___
  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] KISS - Base Subroutines.

2016-07-15 Thread Andrew

I'd have to look into how to do that, John.

Right now, I've got something working, so I'll continue to build on that.

One problem I have come across with my approach of a CommonUse folder, and .pm 
files within it,
is when one of the .pm files needs to be used by another.

I thought I could merely have the first file, extending Catalyst::Controller

BEGIN { extends 'Catalyst::Controller' }

and the second file, extending the first file:

BEGIN { extends 'MyApp::CommonUse::FileOne' }

...and then the controller that needs to use FileTwo, extending that...

BEGIN { extends 'MyApp::CommonUse::FileTwo' }

Unfortunately, when FileTwo tries to call a subroutine in FileOne, I get:
"Undefined subroutine ::CommonUse::FileTwo::subroutinename"
If I stop worrying about the BEGIN/extends block, and instead just type: 
MyApp::CommonUse::FileOne::subroutinename(); it executes fine. 

In short:
I've a base controller directory called CommonUse.
There are two files in it.
How can FileTwo use subroutines in FileOne, without typing the explicit package 
path each time?

Many thanks,

Yours,
Andrew.




  - Original Message - 
  From: John Napiorkowski 
  To: The elegant MVC web framework 
  Sent: Friday, July 15, 2016 1:57 AM
  Subject: Re: [Catalyst] KISS - Base Subroutines.


  I'd consider a Role or maybe a Util package with 'Exporter' depending on what 
the shared function is intended to do -jnap



  On Thursday, July 14, 2016 6:47 PM, "anthony.okusa...@usbank.com" 
<anthony.okusa...@usbank.com> wrote:




  Put a subroutine in a separate place, where it can be accessed / called, by
  whatever controllers need to use it? 
  
-
 
  Why not put all your subroutines in a Role  and consume the role in your main 
application class. 

  Package Role::HelpUtils; 
  use Moose::Role; 

  sub redirect_to_action { 
  my ($c, $controller, $action, @params) =@_; 
  
$c->response->redirect($c->uri_for($c->controller($controller)->action_for($action),
 @params)); 
  $c->detach; 
  } 

  1; 

  In your main app class, simply use the role 
  package MyApp; 
  use Moose; 
  use Catalyst::Runtime ; 
  with 'Role::HelpUtils'; 

  You can then access the subroutines using  e.g $c->redirect_to_action() 



  Thanks

  Tony B. Okusanya 




  From:"Andrew" <catalystgr...@unitedgames.co.uk> 
  To:"The elegant MVC web framework" <catalyst@lists.scsys.co.uk>, 
  Date:07/14/2016 05:59 PM 
  Subject:Re: [Catalyst] KISS - Base Subroutines. 

--



  Okay, no worries, I've done it now.

  Created a folder called CommonUse to exist alongside Controller, View, and
  Model folders, and hold perl modules that are commonly used, =).

  Create a file in the folder.

  Put my subroutine in the file.

  Then in the controller I want to find the subroutine, where it normally
  says:
  BEGIN { extends 'Catalyst::Controller' }
  ...I switch it to say:
  BEGIN { extends 'MyApp::CommonUse::File' }
  where MyApp is the name of my app, and File is the name of the perl
  module file I created in the CommonUse folder.
  Then that controller can call the subroutine, and everything seems to work,
  =).

  I read online, you could also put subrountines inside of Myapp.pm within the
  lib folder, and all controllers could access it. I did try that, however, I
  couldn't get it working, so any pointers on that appreciated.

  Yours,
  Andrew.



  - Original Message -
  From: "Andrew" <catalystgr...@unitedgames.co.uk>
  To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
  Sent: Thursday, July 14, 2016 9:20 PM
  Subject: [Catalyst] KISS - Base Subroutines.


  Is there a keep it simple stupid answer to the following question:

  Put a subroutine in a separate place, where it can be accessed / called, by
  whatever controllers need to use it?






  ___
  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/




  U.S. BANCORP made the following annotations
  -
  Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and propri

Re: [Catalyst] KISS - Base Subroutines.

2016-07-15 Thread Andrew
Thanks for your suggestion, Tony, =).

In your example, is HelpUtils a .pm file?
And if so, where in the Catalyst folder structure would it be placed?
Would I need to create a folder called Role? 
  - Original Message - 
  From: anthony.okusa...@usbank.com 
  To: The elegant MVC web framework 
  Sent: Friday, July 15, 2016 12:46 AM
  Subject: Re: [Catalyst] KISS - Base Subroutines.


  Put a subroutine in a separate place, where it can be accessed / called, by
  whatever controllers need to use it? 
  
-
 
  Why not put all your subroutines in a Role  and consume the role in your main 
application class. 

  Package Role::HelpUtils; 
  use Moose::Role; 

  sub redirect_to_action { 
  my ($c, $controller, $action, @params) =@_; 
  
$c->response->redirect($c->uri_for($c->controller($controller)->action_for($action),
 @params)); 
  $c->detach; 
  } 

  1; 

  In your main app class, simply use the role 
  package MyApp; 
  use Moose; 
  use Catalyst::Runtime ; 
  with 'Role::HelpUtils'; 

  You can then access the subroutines using  e.g $c->redirect_to_action() 



  Thanks

  Tony B. Okusanya 



  From:"Andrew" <catalystgr...@unitedgames.co.uk> 
  To:"The elegant MVC web framework" <catalyst@lists.scsys.co.uk>, 
  Date:07/14/2016 05:59 PM 
  Subject:Re: [Catalyst] KISS - Base Subroutines. 

--



  Okay, no worries, I've done it now.

  Created a folder called CommonUse to exist alongside Controller, View, and
  Model folders, and hold perl modules that are commonly used, =).

  Create a file in the folder.

  Put my subroutine in the file.

  Then in the controller I want to find the subroutine, where it normally
  says:
  BEGIN { extends 'Catalyst::Controller' }
  ...I switch it to say:
  BEGIN { extends 'MyApp::CommonUse::File' }
  where MyApp is the name of my app, and File is the name of the perl
  module file I created in the CommonUse folder.
  Then that controller can call the subroutine, and everything seems to work,
  =).

  I read online, you could also put subrountines inside of Myapp.pm within the
  lib folder, and all controllers could access it. I did try that, however, I
  couldn't get it working, so any pointers on that appreciated.

  Yours,
  Andrew.



  - Original Message -
  From: "Andrew" <catalystgr...@unitedgames.co.uk>
  To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
  Sent: Thursday, July 14, 2016 9:20 PM
  Subject: [Catalyst] KISS - Base Subroutines.


  Is there a keep it simple stupid answer to the following question:

  Put a subroutine in a separate place, where it can be accessed / called, by
  whatever controllers need to use it?






  ___
  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/



  U.S. BANCORP made the following annotations
  -
  Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and proprietary in nature. If you are not the 
intended recipient, please be advised that you are legally prohibited from 
retaining, using, copying, distributing, or otherwise disclosing this 
information in any manner. Instead, please reply to the sender that you have 
received this communication in error, and then immediately delete it. Thank you 
in advance for your cooperation.

  -


--


  ___
  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] KISS - Base Subroutines.

2016-07-14 Thread Andrew
Okay, no worries, I've done it now.

Created a folder called CommonUse to exist alongside Controller, View, and
Model folders, and hold perl modules that are commonly used, =).

Create a file in the folder.

Put my subroutine in the file.

Then in the controller I want to find the subroutine, where it normally
says:
BEGIN { extends 'Catalyst::Controller' }
...I switch it to say:
BEGIN { extends 'MyApp::CommonUse::File' }
where MyApp is the name of my app, and File is the name of the perl
module file I created in the CommonUse folder.
Then that controller can call the subroutine, and everything seems to work,
=).

I read online, you could also put subrountines inside of Myapp.pm within the
lib folder, and all controllers could access it. I did try that, however, I
couldn't get it working, so any pointers on that appreciated.

Yours,
Andrew.



- Original Message -
From: "Andrew" <catalystgr...@unitedgames.co.uk>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Thursday, July 14, 2016 9:20 PM
Subject: [Catalyst] KISS - Base Subroutines.


Is there a keep it simple stupid answer to the following question:

Put a subroutine in a separate place, where it can be accessed / called, by
whatever controllers need to use it?






___
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] KISS - Base Subroutines.

2016-07-14 Thread Andrew
Is there a keep it simple stupid answer to the following question:

Put a subroutine in a separate place, where it can be accessed / called, by
whatever controllers need to use it?






___
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] From Development to Production.

2016-03-09 Thread Andrew


  I'd suggest these files are the Model part of MVC and you should have a Class 
that you use to interact with files. This Class is independent of you Catalyst 
App and should be able to run in it's own right. Page 135 of the book 
discussing Database model because that's the common model but there are model 
class for working with files[1]. There are several references in the book to 
testing. Testing, along with software versioning are part of the tool-set 
you'll want to become familiar with if your going to be writing software. You 
could take a look at the advent calendar articles [2], they are not that 
up-to-date but useful none the less I'd say.

  ---> I have actually found a lot of the advent calendar articles really 
useful. I was shocked there weren't any for 2015 though, =P. Did we forget to 
do it last year / weren't there any volunteers? 


  Using a database would adios your permissions problems too. If you just want 
to sort out permissions problems, you could have the files/directories owned by 
the same user that runs you web server or do something fancy with suexec. 

  ---> UPDATE: Oh...do you mean the root user?
  ---> BEFORE-UPDATE: The trouble I experienced with having it owned by the 
user associated with the web domain was that there were two users needing to 
access it.
  However, what I've done for a quick fix until I can figure out a better 
solution, is thrown...
  umask ;
  ...into the appname.pm file, and now when I create directories with 0777 
permissions, as in a line like: 
  mkdir $my_data_folder_path."new_directory_we_are_making/", 0777;
  ...they're accessible to both users,
  and to enable file reading and writing, I'm just using Path::Tiny's slurp and 
spew - spew solving the access/permission problem, where append would not.
  So now I've got a quick fix allowing me to get cracking with my work,
  and then I'll read and research on the side how to improve it / what the 
better ways of doing it are.

  I want to caution you, in the nicest possible way. Writing software requires 
a number of skills and a lot of research and learning. You can't avoid the 
latter. What may seem like a lot of unnecessary aggravation (testing and 
version control) have come about because it's no fun fixing problems after the 
event.

  ---> Yes, I apologise some of the way I wrote came across as impatient, =). 
I'm excited to learn, and to reap the long term benefits, =). 


  You could also look at Dancer2 [3] as that be good fit too.

  ---> Thanks for the tip!

  Good luck,
  Dermot.

  ---> Many thanks for the page numbers I can flick to, and the links I can 
visit, =). Grateful!



  1) https://metacpan.org/pod/Catalyst::Model::File
  2) http://www.catalystframework.org/calendar/
  3) https://metacpan.org/pod/distribution/Dancer2/script/dancer2




  On 9 March 2016 at 13:26, Andrew <catalystgr...@unitedgames.co.uk> wrote:





  It sounds to me like you should treat these text files as the data model 

  ---> Are you suggesting I do something to them, or is this just a 
linguistic point about what to call or refer to the data as?
  I'm new to Catalyst and previously coded in procedural perl, where I 
always used a policy of: data - processing - layout.
  I equate that to Catalyst's Model - Controller - View. However, my data 
was always text files, my processing was cgi scripts, and my layout was always 
html templates.
  I now code with my processing as subroutines within *.pm files within 
Catalyst's Controller folder,
  however I haven't touched the View or Model folders - am still reading in 
html templates, substituting values, and spitting them out as the response to 
the browser - all within my controllers - it's processing after all.

  In short, I'm happy to call my text files the data model, where before I 
would have called them the data.
  However - are you suggesting I do anything?

  and yes, do not check it in to your repo.

  ---> I have no idea what repo is. Do you mean repository, for a 
versioning system? Atm, my versioning system is to download the lib folder from 
the dev server using Cyberduck, and put it in a folder on my computer hard 
drive - the folder having a version number. Then I can upload whatever version 
I want to the production server - normally the lib from the latest version 
folder created. 

   Rather create a model class to access it
  ---> I will have to research how to do this. My resources include google 
search, and the Definitive Guide to Catalyst book.

   and configure the path in you config file.
  ---> At present, I am reading the path in from a separate text file.

   When it comes to testing you are going to have to create a sample of 
those text files under the t/ directory.

  ---> Still learning Catalyst and haven't touched testing. I generally 
don't get it. Either a web app works, or is broken. I don't get 

Re: [Catalyst] From Development to Production.

2016-03-09 Thread Andrew



  It sounds to me like you should treat these text files as the data model 

  ---> Are you suggesting I do something to them, or is this just a linguistic 
point about what to call or refer to the data as?
  I'm new to Catalyst and previously coded in procedural perl, where I always 
used a policy of: data - processing - layout.
  I equate that to Catalyst's Model - Controller - View. However, my data was 
always text files, my processing was cgi scripts, and my layout was always html 
templates.
  I now code with my processing as subroutines within *.pm files within 
Catalyst's Controller folder,
  however I haven't touched the View or Model folders - am still reading in 
html templates, substituting values, and spitting them out as the response to 
the browser - all within my controllers - it's processing after all.

  In short, I'm happy to call my text files the data model, where before I 
would have called them the data.
  However - are you suggesting I do anything?

  and yes, do not check it in to your repo.

  ---> I have no idea what repo is. Do you mean repository, for a versioning 
system? Atm, my versioning system is to download the lib folder from the dev 
server using Cyberduck, and put it in a folder on my computer hard drive - the 
folder having a version number. Then I can upload whatever version I want to 
the production server - normally the lib from the latest version folder 
created. 

   Rather create a model class to access it
  ---> I will have to research how to do this. My resources include google 
search, and the Definitive Guide to Catalyst book.

   and configure the path in you config file.
  ---> At present, I am reading the path in from a separate text file.

   When it comes to testing you are going to have to create a sample of those 
text files under the t/ directory.

  ---> Still learning Catalyst and haven't touched testing. I generally don't 
get it. Either a web app works, or is broken. I don't get writing code to test 
if code works. Comes across as some sort of coding narcissism.

  Having said that, you should probably find a way to use a database. It sounds 
to me like your data would fit nicely into a database and your permissions 
problems to be less significant.

  ---> Yes, I've painless experience of connecting to a MySQL database. I just 
hoped I could use Catalyst whilst working in the same simple way I worked 
before, where turn around was very fast. I just have one small task to 
accomplish, and some files seemed the easiest quickest way to do it, and I've 
hit all these permission problems, and I just thought it must be such a common 
problem, someone is bound to have solved it - so I thought to ask the group.

  ---> Right now my solution is super simple - just use spew, and avoid using 
append.

  ---> If there's any advice or tutorials on how to sort out permissions, or 
how to use text files as your model in Catalyst, I'd appreciate it. 

  Hope that helps,

  ---> It was insightful, and has given me something to research. Right now I 
don't understand enough about how Catalyst works to know what creating a model 
class involves, and if it will solve the permissions problem, or if it was just 
mentioned as a way of putting the data folder's path into the config file. I 
shall look into it, and hopefully won't be ignorant for too much longer.

  ---> And thanks for getting back to me! =D

  ---> Yours,
  ---> Andrew.

  Dermot.









___
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] From Development to Production.

2016-03-08 Thread Andrew


Does anyone have any advice?
Looking for the best way to handle permissions.

My web app stores data to text files, in a directory.

While it makes sense to have a development server, and a production  
server, when it comes to updating the scripts in the lib folder it  
doesn't make much sense to duplicate the data folder with all the text  
files between development and production servers.
Mainly because users using the web app will be generating data that is  
saved there, so the production server's data folder will always be  
more relevant/populated - we don't want to overwrite user data all the  
time.


So, if data is stored in a data folder on the production server,
I need a system whereby

The Production Server can:
Read and write to a file it creates.
Read a file the Dev Server created.
Write to a file the Dev Server created.

and where...

The Development Server can:
Read and write to a file it creates.
Read a file the Production Server created.
Write to a file the Production Server created.

I was taught Path::Tiny is the best plugin to use in Catalyst for  
reading and writing to files (let me know if you recommend any others).


With that, I found:

path($datapath."test.txt")->spew_utf8($bitofdata);
worked, because spew creates a temporary file and then overwrites  
the old one. This means, after the Dev server writes to the file, it  
has ownership and group permissions of the Dev server, and after the  
Production server writes to the file, it has ownership and group  
permissions of the Production server.


path($datapath."test.txt")->append_utf8($newbitofdata);
...however, which attempts to open an existing file and add an extra  
line, results in an error - permission is denied.
I assume that's because the Prod user can't access files owned by the  
Dev user, and vice versa.


So should I use spew always, or is there a way to sort out the permissions?
So that both users on the server can read and write to files in the  
data directory?


Or is there a way for the Dev Server to interact with files using the  
Prod server's userid instead of the dev server userid?


I managed to find some lines on the internet saying how to create a  
group, add users to the group, and then set ownership and group of  
files and folders. Trouble is, any new files or folders I then create  
in my Perl script, are owned by the userid associated with the server  
that created them.


What's the best practice?
To give a prod and dev server, equal access to a directory on the  
production server?


Server is a shared hosting VPS, with multiple user directories. One of  
these user directories is the development server, the other is the  
live website. Server is Apache / CentOS.


Many thanks in advance,

Yours,
Andrew


___
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] Feasibility questions ref transition to Catalyst

2016-03-03 Thread Andrew

In the end, although it's off-topic from Catalyst,
I found what I was really after in apache was:

FallbackResource /path/to/catalystapp_fastcgi.pl/

...instead of the Alias to my catalyst app.

As in:

FastCgiExternalServer /home/username/public_html/myapp/script/myapp_fastcgi.pl 
-host www.mydomain.com:56000
FallbackResource /myapp/script/myapp_fastcgi.pl/


That would mean it would try and see if a file or directory of the same name as 
that being requested existed, and only if there was no such file or directory, 
would it pass the request on to my app.
I.e. all existing cgis and static content are served as they ever were, and any 
other requests gets dealt with by the catalyst app.

Things got complicated when the path and file weren't in the public_html folder 
however - as:
FallbackResource /somethinggoeshere
essentially translates to www.mydomain.com/somethinggoeshere
...so it becomes impossible to actually specify a folder outside of the public 
html directory.
(Unless because I'm new to apache, I'm missing something?)

When my Catalyst app wasn't in public_html, and was instead at 
/home/username/myapp/script/myapp_fastcgi.pl
I used:

FastCgiExternalServer /home/username/public_html/myapp_fastcgi.pl -host 
www.mydomain.com:56000
FallbackResource /myapp_fastcgi.pl/

I get away with the first line, because FastCgiExternalServer doesn't actually 
need the file mentioned to exist - only the path needs to be real.
However, the FallbackResource bit didn't actually work, until I put a file 
called myapp_fastcgi.pl in the public_html directory.
It didn't have to have anything in it - I used a blank text file, and renamed 
it.
Bit annoying though. Don't know if I'm missing something, and there's a way of 
feeding a path to FallbackResource that isn't public html.

  - Original Message - 
  From: Andrew 
  To: The elegant MVC web framework 
  Sent: Wednesday, March 02, 2016 6:14 PM
  Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


  I've just seen something similar on page 115 of The Definitive Guide to 
Catalyst.
  I will look into this further...

  'Cos atm, I've just got one directory working, but I pretty much want the 
entirety of public_html (all its files and subfolders, etc) back up as my 
static content, and I wonder if this is a way to do it...?
- Original Message - 
From: QE :: Felix Ostmann 
To: The elegant MVC web framework 
Sent: Wednesday, March 02, 2016 10:01 AM
Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


Uh, i guess in some old wiki is that already mentioned. We use this for our 
static content:


Alias /static/ /path/to/static/directory
Alias / /path/to/myapp_fastcgi.pl/


And in our app we use Static::Simple with the same directory. So while 
developing only with the buildin server all works fine and later apache serves 
the static content and all works fine :)


Mit freundlichen Grüßen
Felix Ostmann


_

QE GmbH & Co. KG
Martinistraße 3
49080 Osnabrück
Deutschland

Tel.: +49 (0) 541 / 40666 11
Fax: +49 (0) 541 / 40666 22
Email: i...@qe.de
Web: www.qe.de


Unsere Geschäftszeiten:

Montag bis Freitag von 8 bis 16 Uhr

Firmensitz: Osnabrück
AG Osnabrück - HRA 200252
Steuer-Nr.: 66/204/54104
Ust-IdNr.: DE814737310

Komplementärin:
QE24 GmbH
AG Osnabrück - HRB 200359
Geschäftsführer: Ansas Meyer
_


Die in dieser Email enthaltenen Informationen sind vertraulich
zu behandeln und ausschließlich für den Adressaten bestimmt.
Jegliche Veröffentlichung, Verteilung oder sonstige in diesem
Zusammenhang stehende Handlung wird ausdrücklich untersagt.


2016-03-02 8:39 GMT+01:00 Andrew <catalystgr...@unitedgames.co.uk>:

  Just discovered something else that's pretty cool.

  When setting up FastCGI in Apache,
  you have something like:

  
  FastCgiExternalServer
  /home/username/public_html/myapp/script/myapp_fastcgi.pl -host
  www.mydomain.com:55900
  Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/
  

  ...in your virtual host configuation.
  (Because I have CPanel on my Apache server, I'm not editing the httpd.conf
  file directly. Rather the httpd.conf file links to some include files, so 
I
  just edit the include files.)

  I realised the Alias bit, was making any URL from the domain name, go to 
the
  Catalyst Web App.
  However I had a few old CGIs I wanted to run.
  I played about a bit, trying to copy and paste the CGI code into a new
  Catalyst Controller... but I thought: "This is too much work".

  The CGIs I wanted to run were in a directory - let's pretend the directory
  was literally called "directory".
  I added a new Alias l

Re: [Catalyst] From Development to Production.

2016-03-02 Thread Andrew
and I don't want any "different versions
of dependencies" bugs wasting my time.

=)

https://www.youtube.com/watch?v=tHioEC9itTg


- Original Message -
From: "Trevor Leffler" <tleff...@uw.edu>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Wednesday, March 02, 2016 8:40 PM
Subject: Re: [Catalyst] From Development to Production.


+1 for Carton for managing perl application dependencies.

Also perlbrew or plenv for using your own perl / separating your app
from the system perl.

I agree whole-heartedly with James regarding being able to stabilize
your app's environment and being able to consistently reproduce it.
Whether I'm spinning up a new prod server or getting a new developer up
and running, I want a [near] push-button method for getting the app
running as quickly as possible, and I don't want any "different versions
of dependencies" bugs wasting my time.

--Trevor


On 03/02/2016 12:23 PM, James Leu wrote:
> It all comes down to the apps 'environment`.
>
> Do you remember when you started developing your catalyst app you had to
> install a bunch of perl modules?
>
> Those same modules (preferabbly the EXACT same versions as you installed
> on your development machine) need to be installed on your
> production machine.  Once you have the same 'environment'
> between dev and prod, then yeah, you can just 'copy' your
> app's source tree to prod, and it will "just work".
>
> The problem we run into is that CPAN is a moving target.
> Install Catalyst today might result in different versions
> of modules, then when you install catalyst to start you development.
> Those differences in versions of modules can result in complete
> failure of the app or small subtle changes in the way it runs, or even
> worse, exposes a new exploitable bug in your app.
>
> So consistency of you apps 'environment' between dev, production,
> and production a year from now, it one of the biggest challenges
> to your approach.
>
> You can look into things like Carton, PAR, FatPacker which will
> bundle up the perl environment for an App so you can
> deploy it.
>
> If you like to be 'ahead of the curve', start looking at using docker
> or atomic for each of you web apps.
>
> Best of luck
>
> On Wed, Mar 02, 2016 at 07:04:53PM -, Andrew wrote:
>> ---> Really looking to keep it simple stupid, to be fair.
>>
>> ---> Looks like a lot to learn atm, so am likely to just copy and paste
>> folders for the time being.
>>
>> ---> I got a bit confused here:
>>
>> As a baby-step prior to doing builds and auto deployment, you can
>> checkout your code from your production server(s).  While this is still
>> a manual step, it's probably better than copying folders and files.
>>
>> ---> If you're not doing an auto deployment, and you're not copying
folders
>> and files, how are you checking out your code from the production server?
>>
>> Grateful for all the insights,
>>
>> Yours,
>> Andrew.
>>
>>
>>
>> - Original Message -
>> From: "Trevor Leffler" <tleff...@uw.edu>
>> To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
>> Sent: Wednesday, March 02, 2016 6:54 PM
>> Subject: Re: [Catalyst] From Development to Production.
>>
>>
>> Yes, that.  But to be a tad verbose about it...
>>
>> Use version control and branches (or whatever your VCS prefers).  Cut a
>> new branch whenever you want to create a new "release" for production.
>> This will let you switch from one branch to the next (upgrade) or back
>> again if things blow up.
>>
>> As a baby-step prior to doing builds and auto deployment, you can
>> checkout your code from your production server(s).  While this is still
>> a manual step, it's probably better than copying folders and files.
>>
>> Once you're there, start looking into "builds."  Generally folks use
>> some kind of Continuous Integration (CI) software that polls your VCS
>> for recent commits and then "kicks off a build."  The simplest thing it
>> might do is checkout the latest code revision and tar it up.  This
>> tarfile is a "build artifact" ready for you to deploy (i.e. copy into
>> production and untar).  Your work after this point is to figure out what
>> else you'd like to happen during a build -- run tests? create
>> documentation? do code inspections? -- and research how your build
>> artifacts could be automatically deployed.
>>
>> I'll echo Toomas in that there's a lot to learn here and keep you busy
>> depending on how f

Re: [Catalyst] From Development to Production.

2016-03-02 Thread Andrew
Oooh...ta for this.

Atm, the development and production servers are the same server - it's a VPS
server.
Because I don't understand the jargon (Do I say it's one shared hosting
solution with multiple virtual hosts?) I'll just put it plainly - one ip
address with lots of folders, each for a different domain name, and the
development server is a folder not linked to any domain name, and the
production server is a folder tied to a domain name. They both work from the
same Perl installation - installed via Perlbrew to a shared opt/ folder that
all users can access.


- Original Message -
From: "James Leu" <j...@mindspring.com>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Wednesday, March 02, 2016 8:23 PM
Subject: Re: [Catalyst] From Development to Production.


It all comes down to the apps 'environment`.

Do you remember when you started developing your catalyst app you had to
install a bunch of perl modules?

Those same modules (preferabbly the EXACT same versions as you installed
on your development machine) need to be installed on your
production machine.  Once you have the same 'environment'
between dev and prod, then yeah, you can just 'copy' your
app's source tree to prod, and it will "just work".

The problem we run into is that CPAN is a moving target.
Install Catalyst today might result in different versions
of modules, then when you install catalyst to start you development.
Those differences in versions of modules can result in complete
failure of the app or small subtle changes in the way it runs, or even
worse, exposes a new exploitable bug in your app.

So consistency of you apps 'environment' between dev, production,
and production a year from now, it one of the biggest challenges
to your approach.

You can look into things like Carton, PAR, FatPacker which will
bundle up the perl environment for an App so you can
deploy it.

If you like to be 'ahead of the curve', start looking at using docker
or atomic for each of you web apps.

Best of luck

On Wed, Mar 02, 2016 at 07:04:53PM -, Andrew wrote:
> ---> Really looking to keep it simple stupid, to be fair.
>
> ---> Looks like a lot to learn atm, so am likely to just copy and paste
> folders for the time being.
>
> ---> I got a bit confused here:
>
> As a baby-step prior to doing builds and auto deployment, you can
> checkout your code from your production server(s).  While this is still
> a manual step, it's probably better than copying folders and files.
>
> ---> If you're not doing an auto deployment, and you're not copying
folders
> and files, how are you checking out your code from the production server?
>
> Grateful for all the insights,
>
> Yours,
> Andrew.
>
>
>
> - Original Message -
> From: "Trevor Leffler" <tleff...@uw.edu>
> To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
> Sent: Wednesday, March 02, 2016 6:54 PM
> Subject: Re: [Catalyst] From Development to Production.
>
>
> Yes, that.  But to be a tad verbose about it...
>
> Use version control and branches (or whatever your VCS prefers).  Cut a
> new branch whenever you want to create a new "release" for production.
> This will let you switch from one branch to the next (upgrade) or back
> again if things blow up.
>
> As a baby-step prior to doing builds and auto deployment, you can
> checkout your code from your production server(s).  While this is still
> a manual step, it's probably better than copying folders and files.
>
> Once you're there, start looking into "builds."  Generally folks use
> some kind of Continuous Integration (CI) software that polls your VCS
> for recent commits and then "kicks off a build."  The simplest thing it
> might do is checkout the latest code revision and tar it up.  This
> tarfile is a "build artifact" ready for you to deploy (i.e. copy into
> production and untar).  Your work after this point is to figure out what
> else you'd like to happen during a build -- run tests? create
> documentation? do code inspections? -- and research how your build
> artifacts could be automatically deployed.
>
> I'll echo Toomas in that there's a lot to learn here and keep you busy
> depending on how far you want/can take it.
>
> Cheers,
> --Trevor
>
>
> On 03/02/2016 10:32 AM, Toomas Pelberg wrote:
> > Go learn about version control and deployment automation, you can google
> > these keywords and will likely be busy for the next few weeks ;-) it's a
> > pretty wide and interesting reading
> > 
> > From: Andrew <mailto:catalystgr...@unitedgames.co.uk>
> > Sent: ‎3/‎2/‎2016 20:17
> > To: T

Re: [Catalyst] From Development to Production.

2016-03-02 Thread Andrew
---> Really looking to keep it simple stupid, to be fair.

---> Looks like a lot to learn atm, so am likely to just copy and paste
folders for the time being.

---> I got a bit confused here:

As a baby-step prior to doing builds and auto deployment, you can
checkout your code from your production server(s).  While this is still
a manual step, it's probably better than copying folders and files.

---> If you're not doing an auto deployment, and you're not copying folders
and files, how are you checking out your code from the production server?

Grateful for all the insights,

Yours,
Andrew.



- Original Message -
From: "Trevor Leffler" <tleff...@uw.edu>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Wednesday, March 02, 2016 6:54 PM
Subject: Re: [Catalyst] From Development to Production.


Yes, that.  But to be a tad verbose about it...

Use version control and branches (or whatever your VCS prefers).  Cut a
new branch whenever you want to create a new "release" for production.
This will let you switch from one branch to the next (upgrade) or back
again if things blow up.

As a baby-step prior to doing builds and auto deployment, you can
checkout your code from your production server(s).  While this is still
a manual step, it's probably better than copying folders and files.

Once you're there, start looking into "builds."  Generally folks use
some kind of Continuous Integration (CI) software that polls your VCS
for recent commits and then "kicks off a build."  The simplest thing it
might do is checkout the latest code revision and tar it up.  This
tarfile is a "build artifact" ready for you to deploy (i.e. copy into
production and untar).  Your work after this point is to figure out what
else you'd like to happen during a build -- run tests? create
documentation? do code inspections? -- and research how your build
artifacts could be automatically deployed.

I'll echo Toomas in that there's a lot to learn here and keep you busy
depending on how far you want/can take it.

Cheers,
--Trevor


On 03/02/2016 10:32 AM, Toomas Pelberg wrote:
> Go learn about version control and deployment automation, you can google
> these keywords and will likely be busy for the next few weeks ;-) it's a
> pretty wide and interesting reading
> 
> From: Andrew <mailto:catalystgr...@unitedgames.co.uk>
> Sent: ‎3/‎2/‎2016 20:17
> To: The elegant MVC web framework <mailto:catalyst@lists.scsys.co.uk>
> Subject: [Catalyst] From Development to Production.
>
> So, I'm trying to learn Modern Perl workflows,
> and I heard it's best to do all your development on a development server,
> rather than mess around with code live, on the production server.
> So let's say I've coded my Catalyst app on a dev server, and it's in a
> folder called MyApp
> Do I just copy the MyApp folder to the Production Server?
> [Am likely to copy and paste the folder using Cyberduck].
> I mean, assuming the production server is setup to run it, and so forth...
> Let's for example say, I'd already published Version 1.0 of my website
> on the production server.
> And it's running from a MyApp directory on the production server.
> Then I code a version 2.0 on my development server, in a folder called
> MyApp, and I want to publish that
> ...do I just again, copy MyApp from my development server, over to my
> production server?
> Obviously, new files would overwrite old ones.
> What about if version 2.0 saw me delete some old unused stuff, do I have
> to make a note of what they were,
> and go through the folder on the production server and delete them?
> Or is there some graceful way to sync the development and production
> versions of my code?
> What are other people doing?
> Grateful for any insights.
> Yours,
> Andrew.
>
>
> ___
> 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] Feasibility questions ref transition to Catalyst

2016-03-02 Thread Andrew
I've just seen something similar on page 115 of The Definitive Guide to 
Catalyst.
I will look into this further...

'Cos atm, I've just got one directory working, but I pretty much want the 
entirety of public_html (all its files and subfolders, etc) back up as my 
static content, and I wonder if this is a way to do it...?
  - Original Message - 
  From: QE :: Felix Ostmann 
  To: The elegant MVC web framework 
  Sent: Wednesday, March 02, 2016 10:01 AM
  Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


  Uh, i guess in some old wiki is that already mentioned. We use this for our 
static content:


  Alias /static/ /path/to/static/directory
  Alias / /path/to/myapp_fastcgi.pl/


  And in our app we use Static::Simple with the same directory. So while 
developing only with the buildin server all works fine and later apache serves 
the static content and all works fine :)


  Mit freundlichen Grüßen
  Felix Ostmann


  _

  QE GmbH & Co. KG
  Martinistraße 3
  49080 Osnabrück
  Deutschland

  Tel.: +49 (0) 541 / 40666 11
  Fax: +49 (0) 541 / 40666 22
  Email: i...@qe.de
  Web: www.qe.de


  Unsere Geschäftszeiten:

  Montag bis Freitag von 8 bis 16 Uhr

  Firmensitz: Osnabrück
  AG Osnabrück - HRA 200252
  Steuer-Nr.: 66/204/54104
  Ust-IdNr.: DE814737310

  Komplementärin:
  QE24 GmbH
  AG Osnabrück - HRB 200359
  Geschäftsführer: Ansas Meyer
  _


  Die in dieser Email enthaltenen Informationen sind vertraulich
  zu behandeln und ausschließlich für den Adressaten bestimmt.
  Jegliche Veröffentlichung, Verteilung oder sonstige in diesem
  Zusammenhang stehende Handlung wird ausdrücklich untersagt.


  2016-03-02 8:39 GMT+01:00 Andrew <catalystgr...@unitedgames.co.uk>:

Just discovered something else that's pretty cool.

When setting up FastCGI in Apache,
you have something like:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


...in your virtual host configuation.
(Because I have CPanel on my Apache server, I'm not editing the httpd.conf
file directly. Rather the httpd.conf file links to some include files, so I
just edit the include files.)

I realised the Alias bit, was making any URL from the domain name, go to the
Catalyst Web App.
However I had a few old CGIs I wanted to run.
I played about a bit, trying to copy and paste the CGI code into a new
Catalyst Controller... but I thought: "This is too much work".

The CGIs I wanted to run were in a directory - let's pretend the directory
was literally called "directory".
I added a new Alias line to this part of the Apache configuration:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias /directory /home/username/public_html/directory
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


.Now...if the url is www.mydomain.com/directory it goes to the directory
folder in my public_html folder, and serves it just as apache always did,
including running the index.pl file I had there - a cgi perl script no less!
Everything else starting with www.mydomain.com gets sent to my new Catalyst
Web App.

In short - you can setup apache aliases, to still run some CGIs in specific
places, while all other URLs run your new Catalyst Web App, =).

That means you can have old CGI scripts and your new Catalyst web app,
running at the same domain name.
As long as there's no conflict of names. I.e. any Catalyst subroutine
designed to be triggered by the 'directory' path, won't get triggered, as
you've redirected all such requests to your directory folder instead.

I simply added a one line alias to achieve this. If there are better ways to
run your old CGIs on the same server as your new Catalyst app, I'm happy to
hear suggestions, =).

One idea that popped into my head was to maybe setup a subdomain that isn't
setup with fastcgi, and have all your old CGIs at the sub domain, running as
they normally would, on what's a normal apache subdomain. And then have your
Catalyst web app running at the normal web domain.
So if your CGIs were part of your old website,
you could have your new catalyst website at http://www.mydomain.com and your
old cgi website at http://old.mydomain.com
Then you wouldn't have the conflict of names problem.
http://www.mydomain.com/directory
and
http://old.mydomain.com/directory
...could both give different responses.

Some food for thought, =).

Yours,
Andrew.




- Original Message -
From: "Tom Browder" <tom.brow...@gmail.

Re: [Catalyst] Feasibility questions ref transition to Catalyst

2016-03-02 Thread Andrew
I heard nginx is what I should be using,
yet having an apache server makes it difficult to setup!?

I gather if I ever ditch my CentOS & Apache server for Amazon's cloud hosting, 
it's easy enough to get Ubuntu and Nginx and stuff... (I'm speaking vaguely, as 
I have little idea what I'm talking about, ^_^. I'm a newbie to Catalyst, and 
all of this...which is why I was pleasantly surprised to find FastCGI and Plack 
allowed me to get a Catalyst web app going on my existing Apache server 
relatively easily).
  - Original Message - 
  From: Chris Welch 
  To: The elegant MVC web framework 
  Sent: Wednesday, March 02, 2016 10:33 AM
  Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


  I know you folks are talking about Apache, but I've used this for nginx for 
static content if it helps anyone (I think I'm an nginx convert now mainly 
because, it's extremely simple for a relative Linux newbie like me):


  location /robots.txt {
alias /path/to/robots.txt;
expires 30d;
  }


  On 2 March 2016 at 10:24, Andrew <catalystgr...@unitedgames.co.uk> wrote:

Cool, =D.

Thanks for that.

  - Original Message - 
  From: QE :: Felix Ostmann 
  To: The elegant MVC web framework 
  Sent: Wednesday, March 02, 2016 10:01 AM
  Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


  Uh, i guess in some old wiki is that already mentioned. We use this for 
our static content:


  Alias /static/ /path/to/static/directory
  Alias / /path/to/myapp_fastcgi.pl/


  And in our app we use Static::Simple with the same directory. So while 
developing only with the buildin server all works fine and later apache serves 
the static content and all works fine :)


  Mit freundlichen Grüßen
  Felix Ostmann


  _

  QE GmbH & Co. KG
  Martinistraße 3
  49080 Osnabrück
  Deutschland

  Tel.: +49 (0) 541 / 40666 11
  Fax: +49 (0) 541 / 40666 22
  Email: i...@qe.de
  Web: www.qe.de


  Unsere Geschäftszeiten:

  Montag bis Freitag von 8 bis 16 Uhr

  Firmensitz: Osnabrück
  AG Osnabrück - HRA 200252
  Steuer-Nr.: 66/204/54104
  Ust-IdNr.: DE814737310

  Komplementärin:
  QE24 GmbH
  AG Osnabrück - HRB 200359
  Geschäftsführer: Ansas Meyer
  _


  Die in dieser Email enthaltenen Informationen sind vertraulich
  zu behandeln und ausschließlich für den Adressaten bestimmt.
  Jegliche Veröffentlichung, Verteilung oder sonstige in diesem
  Zusammenhang stehende Handlung wird ausdrücklich untersagt.


  2016-03-02 8:39 GMT+01:00 Andrew <catalystgr...@unitedgames.co.uk>:

Just discovered something else that's pretty cool.

When setting up FastCGI in Apache,
you have something like:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


...in your virtual host configuation.
(Because I have CPanel on my Apache server, I'm not editing the 
httpd.conf
file directly. Rather the httpd.conf file links to some include files, 
so I
just edit the include files.)

I realised the Alias bit, was making any URL from the domain name, go 
to the
Catalyst Web App.
However I had a few old CGIs I wanted to run.
I played about a bit, trying to copy and paste the CGI code into a new
Catalyst Controller... but I thought: "This is too much work".

The CGIs I wanted to run were in a directory - let's pretend the 
directory
was literally called "directory".
I added a new Alias line to this part of the Apache configuration:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias /directory /home/username/public_html/directory
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


.Now...if the url is www.mydomain.com/directory it goes to the 
directory
folder in my public_html folder, and serves it just as apache always 
did,
including running the index.pl file I had there - a cgi perl script no 
less!
Everything else starting with www.mydomain.com gets sent to my new 
Catalyst
Web App.

In short - you can setup apache aliases, to still run some CGIs in 
specific
places, while all other URLs run your new Catalyst Web App, =).

That means you can have old CGI scripts and your new Catalyst web app,
running at the same domain name.
As long as there's no conflict of names. I.e. any Catalyst subroutine
designed to be trig

Re: [Catalyst] Feasibility questions ref transition to Catalyst

2016-03-02 Thread Andrew
Cool, =D.

Thanks for that.

  - Original Message - 
  From: QE :: Felix Ostmann 
  To: The elegant MVC web framework 
  Sent: Wednesday, March 02, 2016 10:01 AM
  Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


  Uh, i guess in some old wiki is that already mentioned. We use this for our 
static content:


  Alias /static/ /path/to/static/directory
  Alias / /path/to/myapp_fastcgi.pl/


  And in our app we use Static::Simple with the same directory. So while 
developing only with the buildin server all works fine and later apache serves 
the static content and all works fine :)


  Mit freundlichen Grüßen
  Felix Ostmann


  _

  QE GmbH & Co. KG
  Martinistraße 3
  49080 Osnabrück
  Deutschland

  Tel.: +49 (0) 541 / 40666 11
  Fax: +49 (0) 541 / 40666 22
  Email: i...@qe.de
  Web: www.qe.de


  Unsere Geschäftszeiten:

  Montag bis Freitag von 8 bis 16 Uhr

  Firmensitz: Osnabrück
  AG Osnabrück - HRA 200252
  Steuer-Nr.: 66/204/54104
  Ust-IdNr.: DE814737310

  Komplementärin:
  QE24 GmbH
  AG Osnabrück - HRB 200359
  Geschäftsführer: Ansas Meyer
  _


  Die in dieser Email enthaltenen Informationen sind vertraulich
  zu behandeln und ausschließlich für den Adressaten bestimmt.
  Jegliche Veröffentlichung, Verteilung oder sonstige in diesem
  Zusammenhang stehende Handlung wird ausdrücklich untersagt.


  2016-03-02 8:39 GMT+01:00 Andrew <catalystgr...@unitedgames.co.uk>:

Just discovered something else that's pretty cool.

When setting up FastCGI in Apache,
you have something like:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


...in your virtual host configuation.
(Because I have CPanel on my Apache server, I'm not editing the httpd.conf
file directly. Rather the httpd.conf file links to some include files, so I
just edit the include files.)

I realised the Alias bit, was making any URL from the domain name, go to the
Catalyst Web App.
However I had a few old CGIs I wanted to run.
I played about a bit, trying to copy and paste the CGI code into a new
Catalyst Controller... but I thought: "This is too much work".

The CGIs I wanted to run were in a directory - let's pretend the directory
was literally called "directory".
I added a new Alias line to this part of the Apache configuration:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias /directory /home/username/public_html/directory
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


.Now...if the url is www.mydomain.com/directory it goes to the directory
folder in my public_html folder, and serves it just as apache always did,
including running the index.pl file I had there - a cgi perl script no less!
Everything else starting with www.mydomain.com gets sent to my new Catalyst
Web App.

In short - you can setup apache aliases, to still run some CGIs in specific
places, while all other URLs run your new Catalyst Web App, =).

That means you can have old CGI scripts and your new Catalyst web app,
running at the same domain name.
As long as there's no conflict of names. I.e. any Catalyst subroutine
designed to be triggered by the 'directory' path, won't get triggered, as
you've redirected all such requests to your directory folder instead.

I simply added a one line alias to achieve this. If there are better ways to
run your old CGIs on the same server as your new Catalyst app, I'm happy to
hear suggestions, =).

One idea that popped into my head was to maybe setup a subdomain that isn't
setup with fastcgi, and have all your old CGIs at the sub domain, running as
they normally would, on what's a normal apache subdomain. And then have your
Catalyst web app running at the normal web domain.
So if your CGIs were part of your old website,
you could have your new catalyst website at http://www.mydomain.com and your
old cgi website at http://old.mydomain.com
Then you wouldn't have the conflict of names problem.
http://www.mydomain.com/directory
and
http://old.mydomain.com/directory
...could both give different responses.

Some food for thought, =).

Yours,
Andrew.




- Original Message -
From: "Tom Browder" <tom.brow...@gmail.com>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Wednesday, February 17, 2016 8:20 PM
Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


On Wed, Feb 17, 2016 at 10:03 AM, Andrew
<catalystgr...@unitedga

Re: [Catalyst] Feasibility questions ref transition to Catalyst

2016-03-01 Thread Andrew
Just discovered something else that's pretty cool.

When setting up FastCGI in Apache,
you have something like:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


...in your virtual host configuation.
(Because I have CPanel on my Apache server, I'm not editing the httpd.conf
file directly. Rather the httpd.conf file links to some include files, so I
just edit the include files.)

I realised the Alias bit, was making any URL from the domain name, go to the
Catalyst Web App.
However I had a few old CGIs I wanted to run.
I played about a bit, trying to copy and paste the CGI code into a new
Catalyst Controller... but I thought: "This is too much work".

The CGIs I wanted to run were in a directory - let's pretend the directory
was literally called "directory".
I added a new Alias line to this part of the Apache configuration:


FastCgiExternalServer
/home/username/public_html/myapp/script/myapp_fastcgi.pl -host
www.mydomain.com:55900
Alias /directory /home/username/public_html/directory
Alias / /home/username/public_html/myapp/script/myapp_fastcgi.pl/


.Now...if the url is www.mydomain.com/directory it goes to the directory
folder in my public_html folder, and serves it just as apache always did,
including running the index.pl file I had there - a cgi perl script no less!
Everything else starting with www.mydomain.com gets sent to my new Catalyst
Web App.

In short - you can setup apache aliases, to still run some CGIs in specific
places, while all other URLs run your new Catalyst Web App, =).

That means you can have old CGI scripts and your new Catalyst web app,
running at the same domain name.
As long as there's no conflict of names. I.e. any Catalyst subroutine
designed to be triggered by the 'directory' path, won't get triggered, as
you've redirected all such requests to your directory folder instead.

I simply added a one line alias to achieve this. If there are better ways to
run your old CGIs on the same server as your new Catalyst app, I'm happy to
hear suggestions, =).

One idea that popped into my head was to maybe setup a subdomain that isn't
setup with fastcgi, and have all your old CGIs at the sub domain, running as
they normally would, on what's a normal apache subdomain. And then have your
Catalyst web app running at the normal web domain.
So if your CGIs were part of your old website,
you could have your new catalyst website at http://www.mydomain.com and your
old cgi website at http://old.mydomain.com
Then you wouldn't have the conflict of names problem.
http://www.mydomain.com/directory
and
http://old.mydomain.com/directory
...could both give different responses.

Some food for thought, =).

Yours,
Andrew.



- Original Message -
From: "Tom Browder" <tom.brow...@gmail.com>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Wednesday, February 17, 2016 8:20 PM
Subject: Re: [Catalyst] Feasibility questions ref transition to Catalyst


On Wed, Feb 17, 2016 at 10:03 AM, Andrew
<catalystgr...@unitedgames.co.uk> wrote:
>
> 1.  Is possible to move to Catalyst incrementally?  In other words, can I
> start deploying Catalyst using at least some of my existing static code?
>
> ---> I'm new to Catalyst, and have found, although as a framework, it sets
> up a structure in terms of folders and where scripts are, I can pretty
much
...

Good information, Andrew--thanks!

> ---> As a n00b, forgive me for not being sure what you mean by virtual
> hosts. I've managed to get everything working on a VPS from a web hosting

What I meant was I run multiple hosts (known as virtual hosts) on a
single instance of Apache on a single server.  Your operation on a
shared host is similar, so your answer was helpful.

Thanks so much.

Best,

-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/


___
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] Feasibility questions ref transition to Catalyst

2016-02-17 Thread Andrew

1.  Is possible to move to Catalyst incrementally?  In other words, can I
start deploying Catalyst using at least some of my existing static code?

---> I'm new to Catalyst, and have found, although as a framework, it sets
up a structure in terms of folders and where scripts are, I can pretty much
copy and paste old code into a Catalyst Controller, and it usually works.
Basically, everything is still Perl 5. For example, I haven't put anything
in the Model or View folders. I'm still just reading in html templates,
doing a pattern-matched-based find-and-replace to throw in the dynamic data,
and then printing to the screen/browser, rather than using any of the
template toolkit stuff that's encouraged. From this, I get the impression,
you can use what you want from Catalyst, and ignore what you don't want to
use, ... maybe it's not best practice, but it certainly appears possible,
and thus may be a way of moving over incrementally.

2.  Another concern is how the virtual hosts are served by Catalyst. Can
there be multiple instances of Catalyst, or do I have to do some fancy
footwork to handle virtual hosts with one instance.

---> As a n00b, forgive me for not being sure what you mean by virtual
hosts. I've managed to get everything working on a VPS from a web hosting
company. So in that sense, it all works on shared hosting. I've also been
able to get one Catalyst app running at two URLs. I did have to fiddle with
some Virtual Host stuff for that, - all done at the time I setup FastCGI and
Plack and all of that gubbins, I've completely forgotten about after I got
it working, ^_^. All running on Apache 2 by the way, if that's relevant to
you, =).

3. I see the Catalyst book is several years old. Is it still reasonably
current for reference?

---> I had the book for ages and hoped to learn Catalyst from it, yet found
I never got round to learning from it. I found it much easier following the
stuff at www.catalystframework.org/calendar/ where you can access stuff by
year. Although I've just noticed 2015 isn't there, O_o...!? Anyway - I'd say
the book is your basic foundation, and the advent calendars bring you
up-to-date. However, I'd also say the book waffles on and on before getting
to the point, whereas the online articles are short and to the point with
example code and cool stuff to try, =). The book has stuff to try as you go
too, I just wish it was written as succinctly as Perl in Two Hours:
http://qntm.org/files/perl/perl.html

Thank you for your assistance and patience.

---> As a N00b, I don't give the best advice. Just sharing some thoughts.

---> Yours,
---> Andrew.


Best regards,
-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/


___
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] STDERR/Debug/Log File

2015-12-15 Thread Andrew
Worked a treat! Many thanks! =).

Yours,
Andrew.
  - Original Message - 
  From: Patrick Kilter 
  To: The elegant MVC web framework 
  Sent: Tuesday, December 15, 2015 8:35 AM
  Subject: Re: [Catalyst] STDERR/Debug/Log File


  Hi,


  did you tried "&> /tmp/logfile"? I tried it with my App and it redirected all 
the output in the given Textfile.


  Best Regards,


  Patrick


  Andrew <catalystgr...@unitedgames.co.uk> schrieb am Di., 15. Dez. 2015 um 
08:41 Uhr:

Couldn't find a clear answer via google, so am choosing to pick your brains 
on this

How does one get error information, for debugging, going into a text file 
instead of to the terminal window?

The context is a Catalyst App started via a Plackup command.
Do I add something to that command line command (does 2> work with 
plackup?),
or do I add something to the script in my Catalyst app?

Either way, I'd like STDERR to go to a specified text file, instead of to 
the terminal window.

It sounds stupidly simple, only a few google searches later, the answer is 
still surprisingly unclear, =S.

Grateful for any help.

If there's more than one way to do it, any advice on best practice also 
appreciated.

Yours,
Andrew.

___
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] Sending 3000 emails.

2015-12-11 Thread Andrew


I would pick up at least an email alias, that can be easibly
auto-generated and updated each time a new user joins.

---> While I understand the principles you are recommending, I'm not sure
exactly what is being suggested, as regards to implementation. Are we
talking exim, vexim, a custom perl script, sendgrid, mailshot, mailman, 
I get the principle - the Catalyst app just sends to one email address -
that email address sends a copy to all 3000 emails. How to setup that one
email though, I'm not sure.

This way you
are at least hiding the 3000+ receivers behind a single email, letting
the email software to do the stuff it has been built for.

---> Yes...and that's the question: What email software? ^_^

The next step would be to use a mailing list, internal or external.

---> Perhaps this is a clue - are you recommending mailing list software to
do the job?

The only reason I could see for looping thru every email address could
be to store in the database the result of the sending process, which
is in my opinion worthless.

---> Well, at the moment I'm looping through every email address to
construct a "To" line, to add to the email source, which then gets sent
using sendmail - as described in my last email to the group. Given I
mentioned 8 minutes of unresponsiveness when it comes to webpage requests
from a browser - this obviously isn't ideal, ^_^.




___
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] Sending 3000 emails.

2015-12-11 Thread Andrew

  - Original Message - 
  From: Len Jaffe 
  To: The elegant MVC web framework 
  Sent: Friday, December 04, 2015 10:14 PM
  Subject: Re: [Catalyst] Sending 3000 emails.






  On Fri, Dec 4, 2015 at 4:03 PM, Andrew <catalystgr...@unitedgames.co.uk> 
wrote:

Exim itself should be the queue and processor shouldn't it?


  exim is not the job processor and queue. It is the Mail Transfer Agent (MTA). 
The job 
  processor generates my email, and hands it off to exim for delivery.

  ---> Yes, that happens in your case. I was hoping I could get exim to be the 
thing running in the background that handles the mail, and my experiments 
showed it was able to be the queue for me. However, my Catalyst app, while no 
longer crashing, does fail to serve responses to a browser, until exim has 
everything in its queue, and as such, it seems I do indeed need a process, 
separate from my web app, to be passing those emails to the queue.






  -- 

  Len Jaffe - Information Technology Smoke Jumper - lenja...@jaffesystems.com 
  614-404-4214@LenJaffe  www.lenjaffe.com

  Host of Code Jam Columbus  - @CodeJamCMH
  Curator of Advent Planet - An Aggregation of Online Advent Calendars.




--


  ___
  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] Sending 3000 emails.

2015-12-04 Thread Andrew

  one does not send any email directly as the result of a browser interaction,
  but rather one notes that an email needs to be sent (queues a job request),
  and a demon or cron job (a queue processor) creates ands sends the mail.

  > So let's do this. How do we go about it?
  Scenario - users want to be alerted via email when a new job on a job board 
is posted.
  So we've a website that's a Catalyst app.
  At some point in the app, - when a new job post is being created - we note 
that emails need to be sent to everyone who wanted a head's up on this event.
  So what am I doing?
  Am I using Email::Stuffer to send via sendmail, which on my system appears to 
be handled by exim (which can be installed in place of sendmail)...? Or are you 
saying using Email::Stuffer doesn't queue a job request - it just sends 
instantly - in which case - how do you queue? Do I just write the source code 
for the email, and the mysql statement to get the user's emails, to a text file 
somewhere, in some directory, and let a Perl script running at set times via 
cron, read in the files, and process them later?
  Or should I be looking for certain CPAN mail queuing modules...?


___
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] Sending 3000 emails.

2015-12-04 Thread Andrew
Exim itself should be the queue and processor shouldn't it?

  - Original Message - 
  From: Len Jaffe 
  To: The elegant MVC web framework 
  Sent: Friday, December 04, 2015 8:48 PM
  Subject: Re: [Catalyst] Sending 3000 emails.






  On Fri, Dec 4, 2015 at 2:04 PM, Andrew <catalystgr...@unitedgames.co.uk> 
wrote:


  If you're handing off the mail to exim, you're fine.  Your implementation 
is correct for your use case

  ---> Of course, I'm guessing I'm handing off to exim - I should probably 
do something to check!
  Look for Email::Sender configuration.  It probably defaults to sendmail, 
which is what you want.




  if the sign up for your service,
  queue a "send them a welcome email" job,
  and let the web request request return.

  Then a separate process:
  sees that an email needs to be sent,
  generates the email,
  and hands it off to exim.

  > So what does the separate process have to be? A process apart from 
my Catalyst app - like an entirely different perl script that could be a cron 
job or something - or can I return a response to the browser within my catalyst 
subroutine, and then call a private catalyst subroutine to handle the email 
sending?
  What triggers the sending of the 3000? 


  I use a table as a queue, and I write a program that loops over the queue 
until no more work to do:

1..  read the least-recently-processed job from the queue that has work to 
do
  1.. determine work-to-do as unassigned.  (PID is null)
2.. mark it as assigned 
  1.. i keep a pid column and update the pid into the record
3.. do the work
  1.. the whole job of some slice
4.. if done, 
  1.. perform post job bookkeeping
5.. else
  1.. update in-progress status (num_complete)
  2.. update PID = NULL
1.. so the job processor can come back too it.


  I use this algorithm to send 500 emails at a time (in RoR). After 500, the 
job goes to the end of the queue, and the next job is processed. 


  My processor is a stand-alone script that is run from cron.
















  ---> And yes, after the quick fix, it wouldn't hurt to debug and see if 
there are memory issues.
  That's the fun part. 








___
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/







  -- 

  Len Jaffe - Information Technology Smoke Jumper - lenja...@jaffesystems.com 
  614-404-4214@LenJaffe  www.lenjaffe.com

  Host of Code Jam Columbus  - @CodeJamCMH
  Curator of Advent Planet - An Aggregation of Online Advent Calendars.




--


  ___
  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] Sending 3000 emails.

2015-12-04 Thread Andrew
Am reading some interesting stuff now.

There's an odq argument you can pass to sendmail, which adds stuff to the mail 
queue without waiting to send,
and there's a tutorial on Perl Maven for sending to multiple addresses using 
Email::Stuffer without wasting memory creating multiple objects...or so I 
gather from an initial skim read...


  - Original Message - 
  From: Andrew 
  To: The elegant MVC web framework 
  Sent: Friday, December 04, 2015 9:03 PM
  Subject: Re: [Catalyst] Sending 3000 emails.


  Exim itself should be the queue and processor shouldn't it?

- Original Message - 
From: Len Jaffe 
To: The elegant MVC web framework 
Sent: Friday, December 04, 2015 8:48 PM
Subject: Re: [Catalyst] Sending 3000 emails.






On Fri, Dec 4, 2015 at 2:04 PM, Andrew <catalystgr...@unitedgames.co.uk> 
wrote:


If you're handing off the mail to exim, you're fine.  Your 
implementation is correct for your use case

---> Of course, I'm guessing I'm handing off to exim - I should 
probably do something to check!
Look for Email::Sender configuration.  It probably defaults to sendmail, 
which is what you want.

 


if the sign up for your service,
queue a "send them a welcome email" job,
and let the web request request return.

Then a separate process:
sees that an email needs to be sent,
generates the email,
and hands it off to exim.

> So what does the separate process have to be? A process apart 
from my Catalyst app - like an entirely different perl script that could be a 
cron job or something - or can I return a response to the browser within my 
catalyst subroutine, and then call a private catalyst subroutine to handle the 
email sending?
What triggers the sending of the 3000? 


I use a table as a queue, and I write a program that loops over the queue 
until no more work to do:

  1..  read the least-recently-processed job from the queue that has work 
to do 
1.. determine work-to-do as unassigned.  (PID is null)
  2.. mark it as assigned  
1.. i keep a pid column and update the pid into the record
  3.. do the work 
1.. the whole job of some slice
  4.. if done,  
1.. perform post job bookkeeping
  5.. else 
1.. update in-progress status (num_complete) 
2.. update PID = NULL 
  1.. so the job processor can come back too it.


I use this algorithm to send 500 emails at a time (in RoR). After 500, the 
job goes to the end of the queue, and the next job is processed. 


My processor is a stand-alone script that is run from cron.
















---> And yes, after the quick fix, it wouldn't hurt to debug and see if 
there are memory issues.
That's the fun part. 








  ___
  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/







-- 

Len Jaffe - Information Technology Smoke Jumper - lenja...@jaffesystems.com 
614-404-4214@LenJaffe  www.lenjaffe.com

Host of Code Jam Columbus  - @CodeJamCMH
Curator of Advent Planet - An Aggregation of Online Advent Calendars. 







___
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] Sending 3000 emails.

2015-12-04 Thread Andrew

  If you're handing off the mail to exim, you're fine.  Your implementation is 
correct for your use case

  ---> Of course, I'm guessing I'm handing off to exim - I should probably do 
something to check!


  if the sign up for your service,
  queue a "send them a welcome email" job,
  and let the web request request return.

  Then a separate process:
  sees that an email needs to be sent,
  generates the email,
  and hands it off to exim.

  > So what does the separate process have to be? A process apart from my 
Catalyst app - like an entirely different perl script that could be a cron job 
or something - or can I return a response to the browser within my catalyst 
subroutine, and then call a private catalyst subroutine to handle the email 
sending?

  ---> And yes, after the quick fix, it wouldn't hurt to debug and see if there 
are memory issues. 
___
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] Sending 3000 emails.

2015-12-04 Thread Andrew
Or in simpler terms

my web app could just set a flag.
And I could have another perl script going as a cron job, that just checks the 
flag every hour, to see if it needs to send out the emails or not.

I'm curious in that case, how such a separate script gets bundled in with your 
Cataylst App, so you've got something you could move to another server easily 
if ever necessary.
Best to keep it simple for now of course, without complicating the matter.

Have never written a perl script to run as a cron job before.
I assume it's just like writing a perl cgi script - put your shebang at the 
top, and code like normal. The only difference is it's executed either as a 
cron job, or just whenever you fancy by typing the command line to run it.

Just thinking out loud.

Thoughts will eventually settle into a course of action, I'm sure, ^_^.

  - Original Message - 
  From: Andrew 
  To: The elegant MVC web framework 
  Sent: Friday, December 04, 2015 4:35 PM
  Subject: Re: [Catalyst] Sending 3000 emails.



one does not send any email directly as the result of a browser interaction,
but rather one notes that an email needs to be sent (queues a job request),
and a demon or cron job (a queue processor) creates ands sends the mail.

> So let's do this. How do we go about it?
Scenario - users want to be alerted via email when a new job on a job board 
is posted.
So we've a website that's a Catalyst app.
At some point in the app, - when a new job post is being created - we note 
that emails need to be sent to everyone who wanted a head's up on this event.
So what am I doing?
Am I using Email::Stuffer to send via sendmail, which on my system appears 
to be handled by exim (which can be installed in place of sendmail)...? Or are 
you saying using Email::Stuffer doesn't queue a job request - it just sends 
instantly - in which case - how do you queue? Do I just write the source code 
for the email, and the mysql statement to get the user's emails, to a text file 
somewhere, in some directory, and let a Perl script running at set times via 
cron, read in the files, and process them later?
Or should I be looking for certain CPAN mail queuing modules...?




--


  ___
  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] Sending 3000 emails.

2015-12-02 Thread Andrew
Hi Len and Darren,
Atm I'm using Email::Stuffer to send email from within a perl script, in the
Controller folder of my Catalyst app.
I'm assuming this results in it being queued to be sent by the local SMTP
server.
My VPS server has Cpanel, and uses Exim, which I'm guessing is what the
scripts are using to send the email.

As noted, it all works until about 1020 emails in, at which point the
Catalyst app crashes (although this has only happened once - I do not wish
to try again and risk another crash). I am using Email::Stuffer in a for
loop, iterating over an array of 3000 email addresses. For my next step I
will alter my code to only attempt to send to 500 email addresses at any one
time, since below 1000 everything seems to work fine.

You seem to be mentioning using a background process, Darren. Is Exim
already the background process that sends email?

If the long term solution is to use mailgun or sendgrid - before I delve
into all their documentation - do you lot have any tips I should consider,
on how to integrate them with a Catalyst app, or is it all pretty straight
forward once I read the documentation?





- Original Message -
From: "Darren Duncan" <dar...@darrenduncan.net>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Monday, November 30, 2015 11:41 PM
Subject: Re: [Catalyst] Sending 3000 emails.


On 2015-11-30 9:29 AM, Andrew wrote:
> ...given that my attempt to send 3000 emails with nothing but my own VPS
server,
> and Cpan's Email::Stuffer, only sent around 1000, before the
> plack/fastcgi/catalyst app crashed could I have been running into a
similar
> limitation? I'm now thinking of altering my code to split the attempts to
send
> email into six batches of 500 emails, as a short term fix, until I've had
time
> to research which transactional email partner to use, and how their APIs
work,
> or integrate with Catalyst apps.

If you are trying to send the emails directly from the process serving your
web
API, then this is absolutely the wrong approach, and you should give up
immediately on trying to do that.  Your API process should just queue the
messages to be sent by a separate background process, and then return
immediately such as with a message "3000 messages queued to be sent soon,
click
here to check queue progress" or such.  Sending in-process may be reasonable
for
a single email, eg email a copy of the form the user just submitted, but
that's
it. -- Darren Duncan


___
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] Sending 3000 emails.

2015-11-30 Thread Andrew
I also read on the sendgrid website that:

"With SMTP, 100 messages can be sent with each connection"
and
"Customers should utilize SMTPAPI if this is an option. As with SMTP, 100 
messages can be sent with each connection, but there can be 1000 recipients for 
each message."

...given that my attempt to send 3000 emails with nothing but my own VPS 
server, and Cpan's Email::Stuffer, only sent around 1000, before the 
plack/fastcgi/catalyst app crashed could I have been running into a similar 
limitation? I'm now thinking of altering my code to split the attempts to send 
email into six batches of 500 emails, as a short term fix, until I've had time 
to research which transactional email partner to use, and how their APIs work, 
or integrate with Catalyst apps.

  - Original Message - 
  From: Len Jaffe 
  To: The elegant MVC web framework 
  Sent: Sunday, November 29, 2015 1:31 AM
  Subject: Re: [Catalyst] Sending 3000 emails.


  I'll add that you should look into a transactional email partner like 
sendgrid, mailgun, etc.  They'll help you stay out of the  black lists by 
showing you what not to do, ans how to set up DKIM, etc. for authentication of 
your email.




  I use sendgrid professionally, with one of my cusotmers that sends a lot of 
email.


  If your volume is under 10k emails per month, sendgrid is free, and they have 
a templating feature which allows you to upload a template (parameterizable) 
and let them to the mail merge on their servers, for up to one thousand 
addresses per tx.


  So instead of generating 3000 emails and pushing them through your smtp 
server, you'd upload the template file, and push three 1000-name lists to to 
sendgrid and let them take care of delivery.  Something to think about.


  Len.




  On Thu, Nov 26, 2015 at 12:38 PM, Lasse Makholm <la...@unity3d.com> wrote:

Maybe not the answer you're looking for but I'd go with an email service 
such as sendgrid which takes most if not all of the pain out of sending emails. 
They have a simple REST API you can POST your email to and provides callbacks 
for delivery notifications etc as well...


I'm not advocating sendgrid over any other service (I'm sure there are 
plenty others) - it's just the one I have experience with... They apparently 
have a free tier as well



/L




On Thu, Nov 26, 2015 at 5:53 PM, Octavian Rasnita <orasn...@gmail.com> 
wrote:

  A queue in Perl is better when there is a need of sending thousand 
messages.
  Without a queue, if the Catalyst-based code just sends the messages 
directly and a browser is waiting for a page to load after the web app sent 
them, it may time-out. But otherwise it should work and not crash the web app.
  3000 messages should be sent pretty fast if they are sent to the local 
SMTP server, but not fast enough for a pleasant experience.

  Regarding the success of those messages... if you don't want them to 
reach in the spam folder, it helps to sign them by using SPF/DKIM. If you'll 
find this complicated, a better solution might be to create an account on a 
site like mailgun.com or mandrill.com and send the messages using their 
servers. They offer APIs that you can use in your app very easy. mailgun.com 
allows sending 10,000 messages/month for free and after that limit the prices 
are pretty cheap. You will have reports with the list of email messages that 
bounced that you can get programaticly, plus a few other helpful features.

  --Octavian

- Original Message - 
From: Andrew 
To: The elegant MVC web framework 
Sent: Thursday, November 26, 2015 5:32 PM
Subject: [Catalyst] Sending 3000 emails.


Hello,

You lot are all experts at Catalyst and Perl,
and because I'm using Perl to code a Catalyst program, I wanted to ask 
you about a problem I've encountered.

The Catalyst app I'm coding is to replace a PHP website, which 
presently allows an admin to manage sending out an email to all members. The 
site has 3000 odd members. From what I could tell, the PHP code was simply 
using the PHP mail function to send email (although it did in my experience 
typically take two days for everyone to receive an email sent with it).
I've also been asking other Perl programmers when I've had the chance - 
and the only concerns raised, were about IP blacklisting or emails bouncing 
back - not about actual code working.

So could sending 3000 emails be as simple as Matt's old CGI form mail?

I had a look on CPAN, and found the simple looking Email::Stuffer,
and wrote a script, sending an email to myself, and it worked.
I then modified the script to pick five email addresses from a MySQL 
database, and email them, and again - it worked.
Okay - one final change - throwing 3000 email addresses at it.
How does that do?
Starts to work - then th

[Catalyst] Sending 3000 emails.

2015-11-26 Thread Andrew
Hello,

You lot are all experts at Catalyst and Perl,
and because I'm using Perl to code a Catalyst program, I wanted to ask you 
about a problem I've encountered.

The Catalyst app I'm coding is to replace a PHP website, which presently allows 
an admin to manage sending out an email to all members. The site has 3000 odd 
members. From what I could tell, the PHP code was simply using the PHP mail 
function to send email (although it did in my experience typically take two 
days for everyone to receive an email sent with it).
I've also been asking other Perl programmers when I've had the chance - and the 
only concerns raised, were about IP blacklisting or emails bouncing back - not 
about actual code working.

So could sending 3000 emails be as simple as Matt's old CGI form mail?

I had a look on CPAN, and found the simple looking Email::Stuffer,
and wrote a script, sending an email to myself, and it worked.
I then modified the script to pick five email addresses from a MySQL database, 
and email them, and again - it worked.
Okay - one final change - throwing 3000 email addresses at it.
How does that do?
Starts to work - then throws up an Internal Server Error in the browser window,
and I find out my Fast CGI Plack Up server thingie isn't up, nor running my 
Catalyst app anymore.
I have to type plackup and my details, etc, again from the command prompt.
A log in to Web Host Manager (this is an apache2 VPS with CPanel) and a check 
of the "View Sent Summary" shows 1020 emails sent - 611 successful, 642 
deferrals and 329 failures...curious, as that adds up to more than 1020, =S. If 
I click through for more details, it shows 1582 records - some with green 
ticks, and others with amber or red exclamation marks, ^_^.
I can worry about IPs and failure rates later

I just want to know why the whole FastCGI Plack loaded Catalyst app came 
down half way through,
and how I can have a Perl script process sending 3000 emails without that 
happening every time, =S.

Do I need to use a queue within Perl? Or does the postfix/sendmail on the 
server, automatically queue everything for me? If so - why did my code crash 
the Catalyst app, and not send all the emails? >_<.

I'm guessing this is a common problem - how does a website email all its signed 
up members - and so there must surely be a common solution among Perl / 
Catalyst users?

Any help, appreciated!

Yours,
Andrew.

___
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] New Catalyst release (5.90102)

2015-10-29 Thread Andrew
Oooh-ooh...! Exciting, =D.


- Original Message -
From: "Marco Pessotto" 
To: 
Sent: Thursday, October 29, 2015 7:58 PM
Subject: [Catalyst] New Catalyst release (5.90102)



jnap has released some minutes ago a new Catalyst release. According to
him, this is probably the last release for 2015 unless major issues come
up.

This is the Changelog:

5.90102 - 2015-10-29

  - Better warnings when there's an error reading the psgi.input
(billmosley++)
  - Fixed spurious warnings in uri_for when using no arguments (melmothx++
and
paultcochrane++)
  - Documentation improvements (paultcochrane++)
  - Improvements to 'search_extra' configuration and tests around using
uri_for as a class method (cngarrison++)
  - Fix when Path() is set and not geting registered as action (grim8634++)
  - $c->state is now preserved over actions in a chain, and across begin,
auto, ->forward and ->detach.

--
Marco

___
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] Keep Plack -r working when commandline closed...?

2015-10-23 Thread Andrew

I've ended up using Plackup to start the catalyst app's psgi script (still
via fast cgi),
and I'm using -r to indicate it should watch for changes, and reload the
server when changes are detected.

It does this fine, as long as my commandline terminal is still open.
The moment I close it, the server continues to run, yet any watching for
changes, killing, and restarting no longer happens (as far as I can tell).

Is there any way to get Plack's scripts that watch and reload (i.e.
Restarter.pm, etc), to continue to run after I close OSX's terminal window /
end the SSH session?


Many thanks for any insights offered,

Yours,
Andrew.


___
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] Keep Plack -r working when commandline closed...?

2015-10-23 Thread Andrew
I didn't know about screen - so thanks! =)
Sounds like it could be a workaround!

Any other ways?


- Original Message -
From: "Trevor Leffler" <tleff...@uw.edu>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Friday, October 23, 2015 4:28 PM
Subject: Re: [Catalyst] Keep Plack -r working when commandline closed...?


What about wrapping your shell session with screen?

$ man screen

--Trevor

On 10/23/2015 08:21 AM, Andrew wrote:
>
> I've ended up using Plackup to start the catalyst app's psgi script (still
> via fast cgi),
> and I'm using -r to indicate it should watch for changes, and reload the
> server when changes are detected.
>
> It does this fine, as long as my commandline terminal is still open.
> The moment I close it, the server continues to run, yet any watching for
> changes, killing, and restarting no longer happens (as far as I can tell).
>
> Is there any way to get Plack's scripts that watch and reload (i.e.
> Restarter.pm, etc), to continue to run after I close OSX's terminal window
/
> end the SSH session?
>
>
> Many thanks for any insights offered,
>
> Yours,
> Andrew.
>
>
> ___
> 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] Keep Plack -r working when commandline closed...?

2015-10-23 Thread Andrew
Turns out it's super easy to run it in the background, =).

You just add "&" to the end of the commandline, =D.

^_^ Am learning these little server tricks, ;-).

[Tweeted Tatsuhiko Miyagawa of Plack fame, who was kind enough to promptly
respond, with this little gem, =D. Yay!]

Yours,
Andrew.


- Original Message -
From: "Trevor Leffler" <tleff...@uw.edu>
To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
Sent: Friday, October 23, 2015 4:28 PM
Subject: Re: [Catalyst] Keep Plack -r working when commandline closed...?


What about wrapping your shell session with screen?

$ man screen

--Trevor

On 10/23/2015 08:21 AM, Andrew wrote:
>
> I've ended up using Plackup to start the catalyst app's psgi script (still
> via fast cgi),
> and I'm using -r to indicate it should watch for changes, and reload the
> server when changes are detected.
>
> It does this fine, as long as my commandline terminal is still open.
> The moment I close it, the server continues to run, yet any watching for
> changes, killing, and restarting no longer happens (as far as I can tell).
>
> Is there any way to get Plack's scripts that watch and reload (i.e.
> Restarter.pm, etc), to continue to run after I close OSX's terminal window
/
> end the SSH session?
>
>
> Many thanks for any insights offered,
>
> Yours,
> Andrew.
>
>
> ___
> 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] Keep Plack -r working when commandline closed...?

2015-10-23 Thread Andrew

Why is it better to use these over using an "&"?

Or are you simply recommending them generally, due to their usefulness all 
round?

Yours,
Andrew.

  - Original Message - 
  From: Kieren Diment 
  To: The elegant MVC web framework 
  Sent: Friday, October 23, 2015 10:48 PM
  Subject: Re: [Catalyst] Keep Plack -r working when commandline closed...?


  Tmux is generally newer and easier to use than screen, highly recommended.



  On Sat, Oct 24, 2015 at 7:41 AM, Len Jaffe <lenja...@jaffesystems.com> wrote:

I'd still consider using screen or tmux...


On Fri, Oct 23, 2015 at 1:48 PM, Andrew <catalystgr...@unitedgames.co.uk> 
wrote:

  Turns out it's super easy to run it in the background, =).

  You just add "&" to the end of the commandline, =D.

  ^_^ Am learning these little server tricks, ;-).

  [Tweeted Tatsuhiko Miyagawa of Plack fame, who was kind enough to promptly
  respond, with this little gem, =D. Yay!]

  Yours,
  Andrew.


  - Original Message -
  From: "Trevor Leffler" <tleff...@uw.edu>
  To: "The elegant MVC web framework" <catalyst@lists.scsys.co.uk>
  Sent: Friday, October 23, 2015 4:28 PM
  Subject: Re: [Catalyst] Keep Plack -r working when commandline closed...?



  What about wrapping your shell session with screen?

  $ man screen

  --Trevor

  On 10/23/2015 08:21 AM, Andrew wrote:
  >
  > I've ended up using Plackup to start the catalyst app's psgi script 
(still
  > via fast cgi),
  > and I'm using -r to indicate it should watch for changes, and reload the
  > server when changes are detected.
  >
  > It does this fine, as long as my commandline terminal is still open.
  > The moment I close it, the server continues to run, yet any watching for
  > changes, killing, and restarting no longer happens (as far as I can 
tell).
  >
  > Is there any way to get Plack's scripts that watch and reload (i.e.
  > Restarter.pm, etc), to continue to run after I close OSX's terminal 
window
  /
  > end the SSH session?
  >
  >
  > Many thanks for any insights offered,
  >
  > Yours,
  > Andrew.
  >
  >
  > ___
  > 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/






-- 

Len Jaffe - Information Technology Smoke Jumper - lenja...@jaffesystems.com 
614-404-4214@LenJaffe  www.lenjaffe.com

Host of Code Jam Columbus  - @CodeJamCMH
Curator of Advent Planet - An Aggregation of Online Advent Calendars.



___
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] mod_fastcgi config for a Catalyst app.

2015-10-19 Thread Andrew
Many thanks on the advice as regards stopping and restarting, =).

I now gather your other bit of advice however, isn't quite the case
As per the Catalyst Wiki's documentation, the path has to be real, but the
file can be entirely fictional.

I just added lines to the includes file referenced within the virtual host
tag of a subdomain, to also load the same Catalyst app.

I.e. one domain name that runs the app in the browser,
and another domain name's subdomain also running the same app in the
browser.
Two urls running one app.

Yet the lines I added to the subdomain's virtual host tag includes file,
caused Apache to fail to restart, if they contained the
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl
path - simply because, the subdomain virtual host, didn't have access to
that path (that's my best guess at least).
So I followed the wiki's advice (must be to a directory that exists and is
readable by the user), and changed it simply to:
/tmp/gxcatalysttest_fastcgi.pl
...even though there is no gxcatalysttest_fastcgi.pl in that directory
("even though the path must exist, the file is essentially bogus").
And it worked, =).

Got a subdomain on one domain, and the root of another domain, both pointing
to the same web app, =).

Top banana! =)

If the name of the file really doesn't have to be accurate, I'm thinking
next, I might experiment changing .pl to .fcgi since the wiki also warned
Catalyst gets confused otherwise, =S.
http://wiki.catalystframework.org/wiki/deployment/apache_fastcgi#Configure_A
pache

- Original Message -
From: "Denny" <2...@denny.me>
To: "London Perl Mongers" <london...@groups.perlists.pm>; "Catalyst List"
<catalyst@lists.scsys.co.uk>
Sent: Sunday, October 18, 2015 5:25 PM
Subject: Re: [Catalyst] mod_fastcgi config for a Catalyst app.


On Sun, 2015-10-18 at 15:50 +0100, Andrew wrote:
> I still don't know if
> FastCgiExternalServer
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl
> ...is just a fictional filename that could be anything, or always has
> to literally point to your fastcgi script in the catalyst app's script
> folder.

Yes, it has to point to the fastcgi script for your application (which
Catalyst helpfully provides, as you've noted).

> Next thing I need to learn:
> If I've used:
> script/gxcatalysttest_fastcgi.pl -l www.game-extra.com:55900
> -p /tmp/myapp.pid
> ...to start the app.
> How does one stop or restart it?

This might not be the best way, but I just use top.  Enter u followed by
the relevant username to narrow down the process list, and look for the
one called perl-fcgi-pm rather than just perl-fcgi.  Then enter k
followed by the process number of the process you just found, and then
hit enter again to accept the default signal (15).

Regards,
Denny



___
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] Simple question about "use Catalyst"

2015-10-19 Thread Andrew

I ran catalyst.pl to create a new app (at least I think that's how I did it - 
it was a couple of days back now),
and when I opened the main pm file, near the top was:

use Catalyst::Runtime 5.80;

I'd just installed Catalyst 5.90101 via cpanm, so wasn't sure why 5.80 was 
written there (for compatibility reasons?),
so as I modify the script to suit my purposes, I've changed it to:

use Catalyst::Runtime 5.90101;

...does it do anything, or make any difference?
What was the significance of 5.80 being written there? 
Should I have left it as it was?


___
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] Fw: mod_fastcgi config for a Catalyst app.

2015-10-18 Thread Andrew

- Original Message -
From: "Andrew" <london...@unitedgames.co.uk>
To: <london...@groups.perlists.pm>
Sent: Sunday, October 18, 2015 3:55 PM
Subject: Re: mod_fastcgi config for a Catalyst app.


Thanks!

I was wondering what to replace: "shinycms_example.com" with, for my own
use,
when I suddenly noticed everything was already working! =O. Shock! =).

Just written a separate email about how I got FastCGI working on the first
attempt, ^_^.

Still sucks it took a day and a half of reading tutorials first. >_<.


- Original Message -
From: "Denny" <2...@denny.me>
To: <london...@groups.perlists.pm>
Sent: Sunday, October 18, 2015 3:08 PM
Subject: Re: mod_fastcgi config for a Catalyst app.


Hi Andrew,

There's a sample Apache config and external fastcgi launcher command in
ShinyCMS:
https://github.com/denny/ShinyCMS/blob/master/docs/sample-apache-conf/httpd.
conf
https://github.com/denny/ShinyCMS/blob/master/bin/external-fastcgi-server

Possibly having a look at those will help you figure out what to do with
your own environment.  Good luck!

Cheers,
Denny



On Sat, 2015-10-17 at 22:13 +0100, Andrew wrote:
> Could someone help me, with a bit of plain english please?
> Am finding the tutorials on getting mod_fastcgi installed and working
> a tad confusing.
>
> I have a VPS with Cpanel and WHM.
> Apache 2.2.24
> A number of different user directories,
> only one of which has to run a Catalyst app.
> [Although it would be nice to use one user as a dev server, and
> another user as a production server]
>
> I have downloaded http://fastcgi.com/dist/mod_fastcgi-current.tar.gz
> I extracted this on the hard drive of my MacBook Pro.
> This gave me the folder:
> mod_fastcgi-2.4.6
>
> On my VPS, my apache appeared to be installed at /usr/local/apache
> ...so I opened up Makefile.AP2 within the mod_fastcgi-2.4.6 folder on
> my laptop, using a text editor, and changed:
> top_dir= /usr/local/apache2
> to the following:
> top_dir= /usr/local/apache
> ...so that the top directory path would be correct.
>
> I then uploaded the entire mod_fastcgi-2.4.6 folder to the root of my
> VPS.
>
> I opened a terminal window and logged in as root, using SSH.
> I changed directory to the folder I'd just uploaded:
> cd mod_fastcgi-2.4.6
> Then I entered the three command lines in the installation
> instructions, one after each other:
> cp Makefile.AP2 Makefile
> make
> make install
>
> I then browsed to the folder:
> /usr/local/apache/modules/
> ...and saw the file:
> mod_fastcgi.so
> ... was now in there, so assumed that's mod_fastcgi installed! =D
> Hooray!
>
> So now I believe I need to:
> Configure Apache.
> Restart Apache.
> Run my Catalyst App.
> and this is where I'm having trouble.
>
> Here are my problems:
>
> PROBLEM ONE:
>
> Tutorials imply the following line should be added to the httpd.conf
> file:
> LoadModule fastcgi_module modules/mod_fastcgi.so
> ...with modules being the folder mod_fastcgi.so is in on my VPS.
>
> So - my first question - where in httpd.conf do I put it?
> At the very start?
> In between the  tags for the domain name I want the
> Catalyst App to be at?
> In the include conf files, for my domain name (the includes are in the
> last line before the virtual host tag closes)?
> Or do I forget about httpd.conf entirely, and shove it in a .htaccess
> file, in my app's directory?
>
> From what I gather, External (aka Standalone Server Mode, aka as just
> Server) is the best mode to run the app under.
> This brings us nicely to
>
> PROBLEM TWO:
>
http://wiki.catalystframework.org/wiki/deployment/apache_fastcgi#Configure_A
pache
> ...gets pretty confusing here.
> It gives the example of:
> 
>   FastCgiExternalServer /tmp/myapp.fcgi -host myhost:8081
>   Alias /myapp//tmp/myapp.fcgi/
> 
> I need to know how to customise this for my purposes.
> My server does have a /tmp/ directory, and I understand myapp.fcgi is
> totally fictional and shouldn't exist.
> Now - what about the rest of the first line? -host myhost:8081
> Documentation says we should change hostname and port as appropriate.
> What throws me is that the next bullet point says that if the catalyst
> app is actually on our apache server, that we should use "-socket
> " instead of "-port "  this is odd, because in the
> example, there is no "-port " used anywhere. It then goes on to say
> using "-host" will still work... then says we should use "localhost"
> as the hostname... before then saying we could use "user -port"
> instead, O_o.
> So should the line be:
>   FastCgiExternalServer /tmp/myapp.fcgi -host

[Catalyst] Fw: Fw: mod_fastcgi config for a Catalyst app.

2015-10-18 Thread Andrew

- Original Message - 
From: Andrew 
To: london...@groups.perlists.pm 
Sent: Sunday, October 18, 2015 3:50 PM
Subject: Re: Fw: mod_fastcgi config for a Catalyst app.


Amazingly it worked on my first attempt!

=D

WHAT I DID:

Here's what I did:

Placed the following in the includes file, which is called from between the 
virtual hosts tags, in my httpd.conf:

LoadModule fastcgi_module modules/mod_fastcgi.so

FastCgiExternalServer 
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl 
-host www.game-extra.com:55900
Alias / 
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl/


Then at the command line, I ran:
script/gxcatalysttest_fastcgi.pl -l www.game-extra.com:55900 -p /tmp/myapp.pid

..and it worked!

SOME NOTES:

At first, I had the Alias line as:
Alias /myapp/ 
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl/
...and what that did was give the impression nothing had worked, since 
www.game-extra.com didn't show the catalyst app running.
However, www.game-extra.com/myapp/ did show the catalyst app running. So 
whatever you put at the start of that alias is pretty much the path in the URL 
you want your catalyst app to run at, =), which was cool to learn.

I still don't know if 
FastCgiExternalServer 
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl
...is just a fictional filename that could be anything, or always has to 
literally point to your fastcgi script in the catalyst app's script folder.

And I still don't know why:
-host www.game-extra.com:55900
has 55900 at the end. I guess that's the port to talk on. Can it be any 
number, or is there some significance to it being 55900...?

Finally, how come the tutorial at:
http://wiki.catalystframework.org/wiki/deployment/apache_fastcgi#Configure_Apache
...says you should use socket for less overhead if the app is actually on the 
apache server.
Yet:
http://www.catalystframework.org/calendar/2006/16
...advises we use a TCP connection instead.
I'm guessing the Calendar article advises us to have more flexibility, whereas 
the wiki article advises us to use less overhead, and that whether you want 
flexibility or less overhead, should determine which approach you choose.

STILL NEED TO LEARN:

Next thing I need to learn:
If I've used:
script/gxcatalysttest_fastcgi.pl -l www.game-extra.com:55900 -p /tmp/myapp.pid
...to start the app.
How does one stop or restart it?
I shall have a google.
Any tips appreciated!





WHAT I DID / LEARNT:

What have I learnt?

You put your apache configuration between the virtualhosts tags.

You can either do that directly within the httpd.conf file, after which you 
will have to run:
/usr/local/cpanel/bin/apache_conf_distiller --update
...to have your changes retained  (otherwise CPanel will revert it to whatever 
it wants - but this is all explained in the text at the top of httpd.conf 
anyway).

Or you can use separate includes files.
For example, at the end of the virtualhosts tags was the following:
# To customize this VirtualHost use an include file at the following location
# Include 
"usr/local/apache/conf/userdata/std/2_2/gamextra/game-extra.com/*.conf"
...so I removed the "#" from the second line, so it was no longer commented 
out, i.e.:
Include "usr/local/apache/conf/userdata/std/2_2/gamextra/game-extra.com/*.conf"
I then saved the httpd.conf file.
Then I went to the command line and entered:
/usr/local/cpanel/bin/apache_conf_distiller --update
to retain the changes I just made.
Then I browsed to usr/local/apache/conf/userdata/std/2_2/
and created the folder gamextra
and then the folder game-extra.com
and then I made a file called try.conf

Inside try.conf, I put the following:

LoadModule fastcgi_module modules/mod_fastcgi.so

FastCgiExternalServer 
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl 
-host www.game-extra.com:55900
Alias / 
/home/gamextra/public_html/GXCatalystTest/script/gxcatalysttest_fastcgi.pl/


Then I saved it.

Then I went to WHM (WebHostManager) and navigated to the restart services 
section,
and restarted http (apache), clicking the big blue YES button, =).

Then I went back to the command line, logged in as gamextra,
kept changing directory until I was in my catalyst application's folder
and entered the command line:
script/gxcatalysttest_fastcgi.pl -l www.game-extra.com:55900 -p /tmp/myapp.pid

Hang on.
That's what I did.
Not what I learnt. ^_^.
Oh nevermind.


___
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-19 Thread Andrew Baxter

On 18/07/12 18:10, Tomas Doran wrote:

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.



Thanks - it's running nicely now. :-)

___
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] catalyst install fails on View::Component::SubInclude

2012-07-18 Thread Andrew Baxter

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.


I've followed the instructions here:
http://www.arlocarreon.com/blog/git/gitalist-install/
(for installing gitalist in its own subdirectory using cpanm).

The relevant section from ~/.cpanm/build.log is pasted below.

I tried installing it with --prompt, and asking it to force installing 
that module, and it does kind of run, but Lynx is reporting bad html, 
and Chrome just shows a very bare subset of what the full page should be 
like, with some text missing and no layout or colours. The server is 
showing a run-time error when I request a page:


[error] Caught exception in engine Attribute (_writer) does not pass 
the type constraint because: Validation failed for 
'Catalyst::Engine::Types::Writer' with value undef at writer 
Catalyst::Response::_set_writer of attribute _writer (defined at 
/home/andy/gitalist/lib/perl5/Catalyst/Response.pm line 21) line 8.
Catalyst::Response::_set_writer('Catalyst::Response=HASH(0xc2490b8)', 
undef) called at /home/andy/gitalist/lib/perl5/Catalyst/Response.pm line 89
Catalyst::Response::finalize_headers('Catalyst::Response=HASH(0xc2490b8)') 
called at /home/andy/gitalist/lib/perl5/Catalyst.pm line 1901
Catalyst::finalize_headers('Gitalist=HASH(0xbd69078)') called at 
/home/andy/gitalist/lib/perl5/Catalyst/Plugin/Unicode/Encoding.pm line 74
Catalyst::Plugin::Unicode::Encoding::finalize_headers('Gitalist=HASH(0xbd69078)') 
called at /home/andy/gitalist/lib/perl5/Catalyst.pm line 1791

[..snip..]

Can anyone help with this?

andrew baxter.


 ~/.cpanm/build.log 

Building and testing Catalyst-View-Component-SubInclude-0.10
cp lib/Catalyst/View/Component/SubInclude/SubRequest.pm 
blib/lib/Catalyst/View/Component/SubInclude/SubRequest.pm
cp lib/Catalyst/View/Component/SubInclude/SSI.pm 
blib/lib/Catalyst/View/Component/SubInclude/SSI.pm
cp lib/Catalyst/View/Component/SubInclude/Visit.pm 
blib/lib/Catalyst/View/Component/SubInclude/Visit.pm
cp lib/Catalyst/View/Component/SubInclude/ESI.pm 
blib/lib/Catalyst/View/Component/SubInclude/ESI.pm
cp lib/Catalyst/View/Component/SubInclude/HTTP.pm 
blib/lib/Catalyst/View/Component/SubInclude/HTTP.pm
cp lib/Catalyst/View/Component/SubInclude.pm 
blib/lib/Catalyst/View/Component/SubInclude.pm

Manifying blib/man3/Catalyst::View::Component::SubInclude::SubRequest.3pm
Manifying blib/man3/Catalyst::View::Component::SubInclude::Visit.3pm
Manifying blib/man3/Catalyst::View::Component::SubInclude::SSI.3pm
Manifying blib/man3/Catalyst::View::Component::SubInclude::ESI.3pm
Manifying blib/man3/Catalyst::View::Component::SubInclude::HTTP.3pm
Manifying blib/man3/Catalyst::View::Component::SubInclude.3pm
PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e 
test_harness(0, 'inc', 'blib/lib', 'blib/arch') t/00-load.t t/01-app.t
# Testing Catalyst::View::Component::SubInclude 0.1, Perl 5.010001, 
/usr/bin/perl

t/00-load.t .. ok

#   Failed test at t/01-app.t line 9.
#   'SubInclude test: will include /time_include using 
default plugin Catalyst::View::Component::SubInclude::Visitbr/

# Current time is: Wed Jul 18 08:26:09 2012 -- | foo = bar |
# br/
# Current time is: Wed Jul 18 08:26:09 2012 -- Capture Arg: test| baz = 
quux |

# br/
#
# br/br/
# Test subinclude using specific plugins:br/
# Current time is: Wed Jul 18 08:26:09 2012 --
# br/
# Current time is: Wed Jul 18 08:26:09 2012 -- | plugin = Visit |
# br/
# !--esi esi:include src=/time?plugin=ESI / --br/
# !--#include virtual=/time?plugin=SSI --br/
#
# br/br/
#
#
# Test CaptureArgs and Args interaction (SubRequest):br/br/
#
# Current time is: Wed Jul 18 08:26:09 2012 -- Capture Arg: 
capture_argtest Action Arg: regular_arg

# br/
# (using: 
http://localhost/capture_argtest/time/regular_arg?query_arg=val)br/

# br/
#
# Current time is: Wed Jul 18 08:26:09 2012 --  Action Arg: regular_arg
# br/
# (using: http://localhost/time/regular_arg?query_arg=val)br/
#
# br/br/
#
# Test CaptureArgs and Args interaction (Visit):br/br/
#
# Current time is: Wed Jul 18 08:26:09 2012 -- Capture Arg: 
capture_argtest | query_arg = val |  Action Arg: regular_arg

# br/
# (using: 
http://localhost/capture_argtest/time/regular_arg?query_arg=val)br/

# br/
#
# Current time is: Wed Jul 18 08:26:09 2012 --  | query_arg = val |  
Action Arg: regular_arg

# br/
# (using: http://localhost/time/regular_arg?query_arg=val)br/
#
# br/br/
#
# Test CaptureArgs and Args interaction (ESI):br/br/
#
# !--esi esi:include 
src=/capture_argtest/time/regular_arg?query_arg=val / --br/
# (using: 
http://localhost/capture_argtest/time/regular_arg?query_arg=val)br/

# br/
#
# !--esi esi:include src=/time/regular_arg?query_arg=val / --br/
# (using: http://localhost/time/regular_arg?query_arg=val)br/
#
# br/br/
#
# Test CaptureArgs and Args interaction (SSI):br/br/
#
# !--#include virtual=/capture_argtest/time/regular_arg?query_arg=val

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

2012-07-18 Thread Andrew Baxter

On 18/07/12 18:10, Tomas Doran wrote:



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



Thanks for the info. Gitalist looks pretty nice, so it would be good to 
be able to use it.


andy

___
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 URL for /search/parameters: bad idea?

2011-09-26 Thread Andrew Rodland
On Mon, Sep 26, 2011 at 5:29 PM, Marius Olsthoorn olst...@gmail.com wrote:

 Hi,

 Consider using the query part of the URI to represent the search.
 Browsers are very good at bookmarking these :)


What in the world is that supposed to mean? Are browsers *bad* at saving
bookmarks for other kinds of URLs?
___
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: Multiple applications (some cat based) on the same server

2011-08-28 Thread Andrew Rodland
There's a Plack::App::FCGIDispatcher that will let you mount an external
FastCGI app as part of a Plack app, and it's possible to run PHP as an
external FastCGI app using php5-fcgi and spawn-fcgi. Maybe not the easiest
thing in the world, but totally doable. Or you could just set up a PHP app
in Apache on a high port and then point a Plack::App::Proxy at that.

On Sat, Aug 27, 2011 at 3:37 AM, Peter Edwards pe...@dragonstaff.co.ukwrote:


 On 27 August 2011 08:07, Aristotle Pagaltzis pagalt...@gmx.de wrote:

 If they all have Plack integration it’s trivially easy, something
 like

use Plack::Builder;
builder {
mount '/cat'   = $cat_app;
mount '/mouse' = $other_cat_app;
mount '/foo'   = $ledgersmb_app;
mount '/'  = $shinycms_app;
}


 Can you integrate PHP apps with Plack?

 Regards, Peter

 ___
 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] Configuring Apache for mod_perl Catalyst and php via mod_proxy

2011-07-29 Thread Andrew Rodland
Another solution, less ugly (IMO) than mod_proxy, is removing mod_php by
setting up PHP behind mod_fastcgi. In fact, if you remove mod_perl as well
by putting your Catalyst apps behind mod_fastcgi, you can have all the
threading you desire.

On Fri, Jul 29, 2011 at 8:15 AM, Tomas Doran bobtf...@bobtfish.net wrote:


 On 29 Jul 2011, at 12:25, matthew couchman (JIC) wrote:

  Thanks for your reply. Perhaps it was too sweeping a statement but I can
 only say that for my setup mod_perl works fine through Apache alone as does
 php but when I combine them it crashes with memory corruption errors.


 (At a guess), don't use the threaded MPM.

 Use prefork and everything will be fine.


 Cheers
 t0m


 __**_
 List: Catalyst@lists.scsys.co.uk
 Listinfo: 
 http://lists.scsys.co.uk/cgi-**bin/mailman/listinfo/catalysthttp://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/**
 catalyst@lists.scsys.co.uk/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] error while starting my dev enviroment

2011-07-10 Thread Andrew Rodland
On Sunday, July 10, 2011 01:36:55 AM Charlie Gonzalez wrote:
 Hello,
 
 I am receiving the following error message while starting my dev server
 enviroment:
 
 
 cgonzalez@cgonzalez-laptop:~/Addressit/script$ perl Addressit_server.pl -r
 The alias and excludes options for role application have been renamed
 -alias and -excludes (CatalystX::Component::Traits is consuming
 MooseX::Traits::Pluggable - do you need to upgrade
 CatalystX::Component::Traits?) at

CatalystX::Component::Traits is consuming MooseX::Traits::Pluggable - do you 
need to update CatalystX::Component::Traits?

___
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] DBI Models Question.

2011-06-11 Thread Andrew Rodland
On Saturday, June 11, 2011 07:54:46 PM John Karr wrote:
 The mistake in my  code brings up the other  question (which applies to ORM
 models as well): How to get the model to take its parameters from
 appname.conf instead of having to input them directly in the model.

Do absolutely nothing. It already works that way. That's what Catalyst::Model 
(really Catalyst::Component) provides.

___
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] living without Apache 'deflate'

2011-04-04 Thread Andrew Rodland
On Monday, April 04, 2011 06:11:39 PM John M. Dlugosz wrote:
 Since fastcgi doesn't get along with the deflate module, I've turned it
 off, per the installation instructions and Catalyst tutorials.
 
 But I'm wondering about SVG images.  Can I pre-compress the files on disk
 and have the browser see the same thing as the deflate wrapper around the
 actual content type?  That's certainly better for the server anyway,
 instead of deflating it on every request.

For starters: you don't need to do without mod_deflate. Just install a non-
broken version of mod_fastcgi (version SNAP-0811090952, from 2008, or newer).

But if somehow that's not an option, you can load 
Catalyst::Plugin::Compress::Deflate (of course you'd also need to use 
Catalyst::Plugin::Static::Simple as well, instead of allowing apache to serve 
those files directly).

Precompressing the files on disk *is* possible but there's a difficulty 
involved with the headers, since you can't send a deflated body without an 
appropriate Content-Transfer-Encoding, and you can't do it at all unless the 
client has sent an appropriate Accept header. Doing this right is a matter of 
a bit of programming, unless you can find a module that already does it for 
you.

Andrew

___
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] Encoding UTF8 ?

2011-03-28 Thread Andrew Rodland
On Monday, March 28, 2011 12:50:00 PM John M. Dlugosz wrote:
 I don't understand why
 
 |Catalyst::Plugin::Unicode::Encoding|
 
 is necessary, based on the writup: it takes request arguments and converts
 them from whatever they came in to Perl's native encoding, and likewise
 for the response.
 
 But Perl is using UTF-8 in its strings anyway.  So what's it have to do
 with the engine error I noticed before?

What engine error you noticed before? You broke threading.

___
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] Requesting example code for postfix and Email::Sender

2011-03-21 Thread Andrew Rodland
On Monday, March 21, 2011 08:56:55 PM John M. Dlugosz wrote:
 On 3/21/2011 1:37 PM, will trillich will.trillich-at-serensoft.com
 |Catalyst/Allow to
 
 home| wrote:
  $c-stash-{*email*} = {
  
   from   =  $c-config-{email_from},
   'reply-to' =  $c-user-email_name,
   to =  $c-user-email_name,
   cc =  join(',', @cc),
   subject=  $subj,
   body   =  $message,
  
  };
  $c-forward( $c-view('Email') );
 
 I didn't like that one (the mail view) because I don't follow: if your
 function sends email instead of generating a web page, what happens to the
 UA on the other end of the network who triggered that URL?

There doesn't need to be any instead of. The email view doesn't set any 
response body, so the default view will still run later on by whatever means 
usually runs it (i.e. RenderView).

Andrew

___
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] Requesting example code for postfix and Email::Sender

2011-03-21 Thread Andrew Rodland
On Monday, March 21, 2011 09:12:52 PM John M. Dlugosz wrote:
 On 3/21/2011 4:46 PM, Dave Rolsky autarch-at-urth.org |Catalyst/Allow to 
home| wrote:
  Usually, this will be implemented as something that just writes a file to
  the server's mail queue, without relying on the server actually running.
  The server will pick it up when it runs, and will handle it from there.
  
  TL;DR - Use Email::Sender::Transport::Sendmail unless you have a really
  good reason to use something else.
 
 Ah, that's very good to know.
 
 However, I don't seem to have a program called 'sendmail' on the path.
 I had installed Postfix via the Debian package.

The postfix debian package installs sendmail as /usr/sbin/sendmail which isn't 
on the path for non-root users by default. Not sure why, exactly.

Andrew

___
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] Quick question on forward porting versus retaining existing code

2011-03-17 Thread Andrew Rodland
On Thursday, March 17, 2011 02:51:59 PM Joe Landman wrote:
 Hi folks
 
We have a Catalyst app we've developed since about 2005 or so.  We
 put it aside in late 2008, and haven't touched it until now.
 
I wanted to see if it would still work (as it turns out, we can reuse
 this for a new project).
 
Before we get into this in depth, are there any pointers/blog
 posts/articles about forward porting an application (this was
 pre-Moose), or whether or not the app would work without forward porting?
 
Basically we don't want to have to redevelop everything we put into
 that (login/authentication, views, etc.), and simply add to the existing
 app with a limited set of changes to make it current would be ideal.
 
Thanks!
 
 Joe

It's the intention of the Catalyst dev team that new releases don't break 
existing apps. The 5.7 to 5.8 transition broke that promise *slightly* more 
than most releases (mostly due to the C3 MRO), but a great many apps written 
for 5.7 will still run without any changes on 5.8, and of the remainder, 99% 
will only need very small changes. Rewriting your code to make explicit use of 
Moose is *not* required. Just deploy the app with the current version of 
Catalyst and current versions of any plugins it uses, and if there are any 
errors or warnings on startup, use them as guidance. If you run into a nut you 
can't crack, please feel free to come back for advice, but you should start 
out by just trying to run the app.

Andrew

___
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

2011-03-15 Thread Andrew Rodland
Run package-stash-conflicts, it will probably tell you that you need to 
upgrade namespace::clean. Do that. :)

Andrew

___
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] Unicode::Encoding - utf8 \xBA does not map to Unicode

2011-03-12 Thread Andrew Rodland
On Friday, March 11, 2011 05:50:22 PM ryan lauterbach wrote:
 Hi,
 
 I've read some threads about unicode, utf8 and query parameters but I
 don't understand it enough to fix on my own, so apologies for beating
 a dead horse.
 
 When a URL contains a utf8 character in the query string such as
 ?first_name=K%E9vyn  (where %E9 is é, latin small e with acute),
 Unicode::Encoding barfs with  utf8 \xE9 does not map to Unicode.

%E9 is not a UTF-8 character. A properly encoded UTF-8 URL representation of 
'first_name=Kévyn' would be 'first_name=K%C3%A9vyn', which C::P::U::E will 
accept.

$ perl -MURI::Escape -Mutf8 -le 'my $str = K\xe9vyn; utf8::encode($str); 
print uri_escape($str)'
K%C3%A9vyn

Andrew

___
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 get uri_for something with a fragment?

2011-03-06 Thread Andrew Rodland
On Sunday, March 06, 2011 05:07:25 AM John M. Dlugosz wrote:
   How do I call uri_for_action and pass it the '#id' part?  It's not an arg
 and it's not part of the query string.  This is called the fragment
 identifier in the final URL.

uri_for returns a URI object, so you can always

my $uri = $c-uri_for_action(...);
$uri-fragment('id');
# Use $uri

Or, since you know that what it generates *doesn't* have a fragment you could 
always just $c-uri_for_action(...) . '#id' which will be perfectly valid 
(although no longer a URI object).

Andrew

___
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: Opinions on static::simple - with caching

2011-02-01 Thread Andrew Rodland
On Tuesday, February 01, 2011 08:06:08 PM Toby Corkindale wrote:
 How do you find Plack at serving static files (via Middleware::Static
 / App::Static)? Compared to Static::Simple, and compared to native
 HTTPD. I guess it sits in between the two in terms of performance, but
 wondered how much of an improvement it was?
 
All of them will give perfectly acceptable throughput -- even Static::Simple 
isn't *slow*. The real concern is that with Static::Simple or with 
Plack::App::File, you're tying up one of your webapp processes to serve the 
file -- and your webapp processes are usually fairly limited in number, and 
fairly memory-hungry (which prevents you from just making more). On the other 
hand, if you let the frontend httpd serve the file, the cost of serving a 
static file ranges from one lightweight httpd thread (for a threaded model) to 
nearly nothing at all (with an async model). Either way, it's not tying up a 
process that could be running Catalyst.

If you're serving up a fairly small number of fairly small files, then this 
probably doesn't make any difference to you, but if you're serving a larger 
number of larger files (that will take several seconds or more to transfer) 
then you should probably be thinking about ways to do it outside of your 
webapp process.

Andrew

___
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] [ANNOUNCE] Catalyst-Runtime-5.89000-TRIAL PSGI Catalyst - first development release.

2011-01-24 Thread Andrew Rodland
On Monday, January 24, 2011 05:12:58 PM Tomas Doran wrote:
 Hi
 
 It gives me great pleasure to announce the first development release
 of the next major version of Catalyst.
 
 This is a development release, and we need people to start trying to
 use it _NOW_, and to tell us about the issues you find with your real
 world applications. Otherwise we're going to be unable to fix those
 issues before a final release.
 
 There are still some known problems with the current release, and the
 upgrading documentation is at this stage anything but complete.
 However, we have been working hard to keep this release as compatible
 as possible with previous versions, and the documentation for
 upgrading will greatly improve before the final version..
 
 Known issues:
   * -l argument to myapp_fastcgi.pl script is broken (this is already
 fixed in subversion)

Actually *all* arguments to the _fastcgi script are broken in 5.89000-TRIAL 
(incl. -l/--listen, -n/--nproc, -d/--detach, -e/--keeperr, and -M/--manager). 
If you need to launch with the _fastcgi script, you will need to wait for the 
next trial release, or build from svn (Catalyst-Runtime/5.80/branches/psgi) or 
at least get Catalyst::Script::FastCGI from there.

You can still test with _server.pl though, or with your own choice of Plack 
server and .psgi file, or test apps with Catalyst::Test and TWMC.

If you maintain any modules that interface with Catalyst, give them a quick 
check to make sure that they don't assume the existence of 
Catalyst::Engine::CGI -- if they do, they will break with the removal of 
Catalyst::Engine::* !

Thanks,

Andrew

___
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] FastCgiServer: redefinition of a previously defined FastCGI server error when adding SSL VHost

2010-12-13 Thread Andrew Rodland
On Sunday, December 12, 2010 09:55:33 pm Eric Berg wrote:
 This may be more of a FCGI question, but since it's happening with my
 Catalyst app, I'll ask you folks.
 
 I got my SSL cert installed and generally am configured for Apache 2.2
 to serve up my site via SSL, but when I enable the FCGI config for the
 SSL site, I get the following error:
 
 FastCgiServer: redefinition of a previously defined FastCGI server error
 when adding SSL VHost
 
[snip] 
 I would think that the different VHosts had different contexts for FCGI,
 but when this config appears in both ssl and non-ssl vhosts, I get that
 error.
 
 Anyone have any solutions for this?

No, FastCgiServer declarations are global, and the namespace for the mount 
points is global. Apache lets you place the config lines inside of a vhost, 
but that doesn't actually do anything different than if you'd placed them 
outside of a vhost.

The good thing is that now that you know this, you probably don't have to do 
anything besides remove one of the conflicting lines. I find that the best 
organization is to have three different stanzas in three included files (in 
the sites-available/ directory of a debian-based config in my case, but you 
can adjust to taste): a file called sitename-run-fcgi only contains the 
FastCgiServer, FastCgiOptions, or any other config relevant to making the 
FastCGI available; a file called sitename contains the nonsecure vhost, and 
a file called sitename-secure contains the SSL vhost. Both of the latter 
files use the FastCGI mountpoint set up by the first file.

Andrew

___
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] Transferring control via root/auto

2010-12-08 Thread Andrew Rodland
On Wednesday, December 08, 2010 07:31:42 am Tomas Doran wrote:
 On 7 Dec 2010, at 16:11, Ben van Staveren wrote:
  You want to $c-detach('end') -- unless that's the default these
  days. I use this pattern a lot and the only difference I see is that
 
  I do:
 The end action will _always_ be run, there is no need to detach to the
 end action.
 
 However I'm not sure what doing $c-detach in auto will do (I guess
 the same as returning 0 - i.e. stop further actions from running), but
 I'm not sure - you should probably return 0 (to stop further dispatch)
 rather than detaching in the auto action..

Since auto is internally just another step in _DISPATCH (Catalyst gets to it 
by calling forward and everything) detaching from it behaves as you'd expect 
-- the action you detach to is run, and so is end, and the current dispatch 
(including the rest of auto and running $c-action) is abandoned. So, possibly 
there are *cleaner* ways to deal with situations like that (often involving 
Chained), but if you want to do it, it shouldn't break on you.

Andrew

___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Andrew Rodland
On Tuesday, September 21, 2010 02:52:52 am Octavian Rasnita wrote:
 The problem appears when the array should have just a single item, because
 in that case Config::General reports it as a scalar value.
 
 I don't know if there is a better way of defining a single-item array with
 Config::General, but I found a workaround that may work. We can use
 something like:

With Config::General = 2.47 and Config::Any = 0.20, you can use the syntax 
foo [ bar ] or foo = [ bar ] to set the key foo to an arrayref 
containing the single value bar. The latest version of 
Catalyst::Plugin::ConfigLoader will ensure that you're up to date.

Andrew

___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Andrew Rodland
On Tuesday, September 21, 2010 08:30:43 am Pavel A. Karoukin wrote:
 On Tue, Sep 21, 2010 at 8:06 AM, Emanuele Zeppieri ema...@gmail.com wrote:
  On Tue, Sep 21, 2010 at 2:14 PM, Octavian Rasnita
  my $conf = Config::General-new( -ConfigFile = 'config.conf',
  -ForceArray = 1 );
 
 How I can pass this -ForceArray to Config::General in my catalyst app?
 
By having the current version of Config::Any installed, like I said in the 
first place. :)

Andrew

___
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] Instruction for SSL configuration for Apache and fastcgi

2010-08-06 Thread Andrew Rodland
On Thursday, August 05, 2010 04:26:52 pm Kutbuddin Doctor wrote:
 Can someone provide apache config scripts for this situation? Do I need
 Port 443 for the FastCgiServer command in Apache? Will these 2 VH's use
 separate Session FastMmap files? Log files?

No, No, and only if you ask for it.

Really there's nothing to it, just do it. Write one virtualhost with

VirtualHost *:80
ServerName foo
[ ... other crap ...]
Alias / /path/to/fcgi/
/VirtualHost

and one with

VirtualHost *:443
ServerName foo
SSLEngine On
[... other crap ...]
Alias / /path/to/fcgi/
/VirtualHost

___
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] Question on Perl versions with Catalyst

2010-07-07 Thread Andrew Rodland
On Wednesday, July 07, 2010 06:07:39 am Joe Landman wrote:
 Hi folks
 
We are redoing one of our applications, and I wanted a quick sync
 against which Perl versions are currently blessed.  I remember that
 5.10.0 did not work due to a bug in the Perl base.  Are there any issues
 we need to be aware of for 5.12.0 or should we stick with 5.10.x (x
 greater than or equal to 1)?

5.12.x are all great and very solid, and 5.10.1 is fine too. Many of the 
versions of 5.10.0 that vendors build are also patched to remove the horrible 
bugs, but you should run 5.10.1+ anyway because it's better. :)

Andrew

___
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] Alternatives to DBIx?

2010-04-18 Thread Andrew Rodland
On Saturday, April 17, 2010 06:04:58 pm John Karr wrote:
 In my own analysis the Time and Effort to learn DBIx is greater than the
 Time wasted writing repetitious DBI code, the time I've already invested
 on DBIx has shown that there is a better way than DBI, but for me it isn't
 DBIx.

In my own analysis the fact that you still think that there is a thing called 
DBIx proves that the time and effort you've spent learning _DBIC_ is zero.

___
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] Alternatives to DBIx?

2010-04-18 Thread Andrew Rodland
On Sunday, April 18, 2010 12:14:55 am Eden Cardim wrote:
 On Sat, Apr 17, 2010 at 8:04 PM, John Karr brain...@brainbuz.org wrote:
  Both Fey and SQLDB are a nativist approach to SQL (much like TT is to
  html)
 
 TT isn't a native approach to html, by far. In fact, it has quite a
 few things going against it's use to generate html. Besides what
 jshirley already said, it doesn't produce streamable output and once
 your documents get complex, it's not very easy to produce nicely
 indented code with it. For a native approach to html, try
 HTML::Zoom.

Very true. In fact, ignoring the fact that it ships with a couple default 
plugins that know how to do HTML-compatible string encoding, TT doesn't 
actually know anything about HTML. It's not actually an HTML tool at all; it's 
a tool for pasting strings together. It's entirely possible for those strings 
to be HTML tags, but since TT is agnostic, it's equally good at producing 
completely mangled, invalid HTML as it is at producing useful HTML (note: not 
a value judgment, just a simple fact!) If that's what nativist means, and 
you're looking for a tool that takes a string-schlepping approach to *SQL*, 
then you need look no further than a hundred thousand shitty PHP apps ;)

Andrew

___
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] Outcome of the Security issue with hashed passwords in C:P:A:Password?

2010-04-10 Thread Andrew Rodland
On Friday 09 April 2010 09:49:24 am Evan Carroll wrote:
 The vulnerability was never against salted_hash. I've since learned
 what Crypt::SaltedHash is I just don't believe I have a reason to use
 it. Why would I want to use something that serializes the hash and
 password into one database column when I can simply store them
 separately?

Why would you want the complexity of storing them separately when you could do 
it the way every other system on the planet does it? Why would you add 
duplicate functionality that's inferior to what it duplicates?

___
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] Outcome of the Security issue with hashed passwords in C:P:A:Password?

2010-04-10 Thread Andrew Rodland
On Saturday 10 April 2010 11:21:27 am Evan Carroll wrote:

 Also, I should point out that Crypt::SaltedHash permits the same
 stupid idea of a static, non-random salt set up in the constructor.
 This makes it slightly more fishy: why would you ever want to use this
 module to do what I just did without it?
 
 # salt: You can specify your on salt. You can either specify it as a
 sequence of charactres or as a hex encoded string of the form
 HEX{...}. If the argument is missing, a random seed is provided for
 you (recommended).

That's not why that argument exists, that's not how it gets used, and that's 
not how C::A::Cred::Password uses it. If you'd thought for half a second, it 
might have occurred to you that that calling convention actually exists to 
support exactly what you're asking for -- storing the hash and salt separately 
for some bizarre reason despite that each is entirely useless without the 
other.

___
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] Outcome of the Security issue with hashed passwords in C:P:A:Password?

2010-04-10 Thread Andrew Rodland
Please, make some more public insults. I would be even further entertained if 
you would make more sweeping declarations about modules you didn't even read 
the documentation for and have never used in your life, and submitted some 
more patches that duplicate functionality poorly. 

You can put on a show all you like for these people. If you keep it up, you 
can even get me to quit just to avoid your toxic presence. But I know you far 
too well. You'll never convince me that you're doing anything but trolling.

On that topic, when did you stop being banned on this list? I'm guessing 
never.

___
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] Outcome of the Security issue with hashed passwords in C:P:A:Password?

2010-04-08 Thread Andrew Rodland
   * In what circumstances was an attack possible?
 ie. What combination of modules, options, auth methods.

* You use Catalyst::Authentication::Credential::Password.
* With the hashed password_type.
* And your database is compromised.

   * Which versions were vulnerable, and if any, at what version were
 they fixed, if any?

All versions. hashed shouldn't be used except by those who have broken and 
stupid user databases; fixing it isn't possible. What we perhaps *should* do 
is warn when it's used, and do a better job of marking it as unsuitable for 
use in the perldoc.

   * What mitigating factors can be applied to existing systems to reduce
 their vulnerability to the attack?
 

* Use password_type = salted_hash to get salted hashes.
* Or use password_type = self_check and a store that provides secure 
password handling via the user object, e.g. 
Catalyst::Authentication::Store::DBIx::Class w/ DBIx::Class::EncodedColumn on 
the user table, or Catalyst::Authentication::Store::LDAP (plus a suitable 
configuration on your LDAP server; some of them will allow you to do stupid 
things like plaintext passwords, but we can't help that).
* If you have a user database that uses plain hashed passwords, start figuring 
out how to change over to a proper method and how to force all of your users 
to reset their passwords.

___
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: Outcome of the Security issue with hashed passwords in C:P:A:Password?

2010-04-08 Thread Andrew Rodland
On Thursday 08 April 2010 08:12:24 pm Toby Corkindale wrote:
 On 08/04/10 22:49, Daniel Pittman wrote:
  ...but your lost database *also* exposed user account/password pairs,
  which can now be tried against other services, since people usually use
  the same weak password and username all over the place.
 
 .. if they are using sufficiently weak passwords, such that they're
 present in a rainbow table? (Or do such rainbow tables contain every
 single possible SHA-1 value, ie. from random-looking strings that happen
 to correspond to the same sha-1 as the actual password?)

Or weak enough to brute-force. Not using salt reduces the difficulty of brute-
forcing passwords by an order of magnitude (well, some number of orders of 
magnitude depending on the number of users you have) because you can make a 
single cracking run against *all users' passwords in parallel* rather than 
attacking each account individually.

Andrew

___
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] Security issue with hashed passwords in C:P:A:Password

2010-03-24 Thread Andrew Rodland
On Tuesday 23 March 2010 03:17:17 pm Evan Carroll wrote:
 This is broken implementation.

It would be if anything you said were true; fortunately it's not, and both 
available methods of doing salted passwords with 
Catalyst::Plugin::Authentication do salt entirely the correct way.

Your unncecessary and condescending lectures are, however, greatly appreciated 
as usual.

Andrew

___
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] KiokuDB, MongoDB and the NoSQL thing

2010-03-02 Thread Andrew Rodland
On Tuesday 02 March 2010 12:07:23 am S.A. Kiehn wrote:
 I have a couple of production Catalyst/DBIx::Class sites on Debian stable,
 and then on my personal hobby site I use local::lib to try out new
 things.  Recently I split out my users for this site into a separate model
 and I thought it a good exercise to learn and use KiokuDB.  It was just a
 couple of simple objects, users  roles, but I believe I have a better
 understanding of how a schema-less data model would work.  All I do are
 lookups based on ID or indexed object values, but doing any type of
 ordering by dates or titles is a mystery.  It seems that the Search::GIN
 is to provide this sort of functionality, but it is under-documented and
 has not had an update for awhile.
 
 I do
  not see many posts
  regarding uses of KiokuDB within Catalyst so I was curious about the
 opinion of the community in regards to its usage.  Is it still to early
 within development?
 
 Also, I have been reading more about the increase in the NoSQL interest,
 with a particular interest in the MongoDB database (it seems to be similar
 in some respects to KiokuDB), but I do not find Perl people in the
 discussion as much as others (Ruby, PHP).  Are there developers in the
 Catalyst community who lean toward NoSQL concepts over traditional RDMS's,
 or is best to view as a tool to use at times?
 
 How about MongoDB?  Am I being suckered by another bandwagon?
 
Kioku is a really beautiful idea. I was hoping to use it on a recent project 
but unfortunately it wasn't the right fit -- one of the most common access 
patterns I would have to support for this app was unduly difficult in Kioku at 
this time so I decided to put it off. So, no real first-hand advice from me.

Might I suggest hitting #catalyst and #kiokudb on irc.perl.org? I know that 
there's at least one person using MongoDB with Catalyst on #catalyst, so you 
can probably get some words of wisdom.

Andrew

___
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] FastCGI deployment - slow to complete request

2010-02-15 Thread Andrew Rodland
On Monday 15 February 2010 10:47:45 am Steve Rippl wrote:
 Andrew Rodland wrote:
  Fix: Use a current snapshot version of mod_fastcgi. Source tarballs can
  be found in http://www.fastcgi.com/dist/ or if you'd like a deb, I've
  built
  http://cleverdomain.org/libapache2-mod-fastcgi_2.4.6.99~snap20081109_i38
  6.deb (for Debian 5.0 i386).
  
  Andrew
 
 Thanks for providing this, but when I install it and restart apache I get
 
 wsdsis:~# /etc/init.d/apache2 start
 Starting web server: apache2apache2: Syntax error on line 185 of
 /etc/apache2/apache2.conf: Syntax error on line 1 of
 /etc/apache2/mods-enabled/fastcgi.load: Cannot load
 /usr/lib/apache2/modules/mod_fastcgi.so into server:
 /usr/lib/apache2/modules/mod_fastcgi.so: wrong ELF class: ELFCLASS64
  failed!
 
 and I'm on a 32bit kernel (in case that's what ELFCLASS64 is referring to?)

Apologies, somehow I had uploaded a bad build -- it says i386 in the filename 
but it was actually amd64. Fixed one is uploaded (at the same address, so just 
pull it again and install it again).

Andrew

___
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] FastCGI deployment - slow to complete request

2010-02-14 Thread Andrew Rodland
On Sunday 14 February 2010 10:59:54 pm Steve Rippl wrote:
 If I switch this back to the built in server then the page is
 completed faster than I can notice and the page renders correctly
 immediately.  Back on FastCGI and even a simple page request is taking
 ~10 seconds to complete (again, that html arrives straight away, but
 then the browser keeps spinning as if it's still waiting on something).

It's a bug in mod_fastcgi that mangles the Content-Length header when it's 
used together with output filters (almost always mod_deflate), and there are a 
couple of ways to deal with it.

Workaround: Disable mod_deflate, or at least prevent it from activating on 
anything that might come from mod_fastcgi.

Fix: Use a current snapshot version of mod_fastcgi. Source tarballs can be 
found in http://www.fastcgi.com/dist/ or if you'd like a deb, I've built 
http://cleverdomain.org/libapache2-mod-fastcgi_2.4.6.99~snap20081109_i386.deb 
(for Debian 5.0 i386).

Andrew

___
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] myapp_fastcgi.pl does not run in background

2010-01-05 Thread Andrew Rodland
On Tuesday 05 January 2010 06:28:36 am Emmanuel Quevillon wrote:
 On 01/05/2010 12:51 PM, Андрей П. Ковбович wrote:
  Hi,
 
  try this option: --detach
 
 Hi,
 
 That solved my problem. But it could be good to change it from the help
 message which is still :
 

The correct option is --daemon; this is a bug in 5.80016. It's been fixed in 
svn (r12387) but not released yet.

Andrew

___
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] Accessing $self in a plugin?

2009-12-23 Thread Andrew Rodland
On Wednesday 23 December 2009 03:40:37 am Octavian Râşniţă wrote:
 Hi,
 
 I use Catalyst::Controller::HTML::FormFu but in some actions I don't want
  to use the FormConfig attribute because it would automaticly generate and
  process a form, which takes much time. I want to do that only if the
  already generated template and data was not found in the cache.
 [...]

  First, is this correct? (or it might appear some issues). I know that the
 plugins are not recommended, but it is not a Catalyst plugin for public
  use, but only one for my app.

Maybe you should extend C::C::HTML::FormFu to have the caching behavior you 
want, and then just use *that* as a controller base class?


 And if it is ok, is it possible to get $self in the plugin in order to do
 $self-form?
 
 Or I will need to send it explicitly using:
 
 $ff($self, 'path/to/config_file');
 

When running an action, the '$self' is the Controller. Outside of the action, 
you can get the controller for the dispatched action with $c-controller() (no 
argument).

Andrew

___
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] Help with weird client: POST without Content-Type

2009-12-18 Thread Andrew Rodland
On Friday 18 December 2009 05:11:56 am Alex Povolotsky wrote:
 Hello!
 
 I'm (still) working with weird client-weird server-weird DB system, and
 I need some more help from community.
 
 Weird self-written client sends POST request without setting
 Content-Type at all.
 
 Client will be fixed, but until then I have to force Catalyst to parse
 that request as if it's type was application/x-www-form-urlencoded.
 
 How do I do that?
 
Here's a suggestion -- not sure if it's the best one, but it should work. In 
your app class (MyApp.pm or whatever) do:

before 'prepare_body' = sub {
my $c = shift;
if ($c-req-method eq 'POST'  !defined $c-req-content_type) {
$c-req-content_type('application/x-www-form-urlencoded');
}
};

The actual decision on how to parse the body is done by HTTP::Body, not by 
Catalyst, so it can't easily be overridden, but using this trick we hook into 
Catalyst after the headers are parsed but before HTTP::Body is invoked, and 
fool it into thinking that the Content-Type actually is what you want it to 
be.

Andrew

___
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] does detach cancel forward

2009-11-08 Thread Andrew Rodland
On Saturday 07 November 2009 05:30:27 pm Andrew Rodland wrote:
  out, detach throws an extension that unwinds that whole stack.

Being tired makes me type words that *sound* similar to the one I meant. 
Exception. Not extension. Exception. :)

Andrew

___
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] does detach cancel forward

2009-11-07 Thread Andrew Rodland
On Saturday 07 November 2009 01:08:33 pm Steve Rippl wrote:
 it's just that I had started thinking
 in terms of nested flow control because that's what I wanted (wishful
 thinking...).  I thought perhaps each forward created a separate
 nest/level I could detach out of and previous forwards were
 remembered, but obviously this isn't the case.

No, this *is* the case, 100%. Forward is nothing more than a function call, so 
you can nest it and you get a call stack. It's just that, as I pointed out, 
detach throws an extension that unwinds that whole stack.

Andrew

___
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] auto method never triggered

2009-11-01 Thread Andrew Rodland
On Sunday 01 November 2009 08:07:32 pm Julien Sobrier wrote:
 Thank you
 
 Shoudl It put __PACKAGE__-config-{namespace} = ''root;, or simply remove
 this line?
 
You should leave it how it is in the root controller, and remove it in the 
admin controller.

___
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] Debian recommendation

2009-10-27 Thread Andrew Rodland
On Tuesday 27 October 2009 05:18:32 pm Evan Carroll wrote:
 I simply disapprove of taking
 something knowingly breaking it, and publishing it as if nothing
 happened.

Then I suppose it's a good thing that no such thing happens.

___
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::Test configuration questions

2009-10-26 Thread Andrew Rodland
On Monday 26 October 2009 04:51:57 pm Evan Carroll wrote:
 My latest project, a Craigslist posting tool, is configured through
 the applications yaml conf file. I'm looking for a way to test based
 the conf file with Catalyst::Test. Any idea of how to accomplish this?
 
You're gonna need some 
http://dl.getdropbox.com/u/129905/specialized-hardware.jpg for that.

Andrew

___
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: Catalyst benchmark 5.7 VS 5.8

2009-09-28 Thread Andrew Rodland
On Monday 28 September 2009 09:31:13 pm Fayland Lam wrote:
 Toby Corkindale wrote:
  Fayland, I was looking at the benchmarks that you linked, and was just
  wondering which version of Perl you're running against?
 
  (CentOS 5 was one of the operating systems that came with the
  badly-patched Perl with the slow bless performance.. although I'm sure
  it's been patched by now?
  ie. http://blog.vipul.net/2008/08/24/redhat-perl-what-a-tragedy/
  )

 Thanks for your update. but it doesn't help on the benchmark since they
 are run on the same condition. so 5.7 is really better than 5.8 under
 siege.

That doesn't follow. If your perl is broken and very slow at doing something 
that 5.8 does much more often, then 5.8 can be slower for you without being 
slower for everyone else.

I have a real app and a suitable test system at hand -- I'll run some benches 
of my own and at least add a few more data points to the mix.

Andrew

___
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] FastMmap.pm error while writing sessions file to shared file system

2009-08-05 Thread Andrew Rodland
On Wednesday 05 August 2009 01:27:11 am gutta wrote:
 could anyone let me know what the problem here?

The problem is that what you're trying to do is impossible. You can't mmap a 
file on a non-local fs, so Cache::FastMmap won't work. I wouldn't expect any 
other file-based cache (or SQLite) to be consistent either. If you need to 
distribute your session store across multiple backend machines you want a DB 
store or memcached.

Andrew


___
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] passwordless LDAP authentication

2009-07-27 Thread Andrew Rodland
On Monday 27 July 2009 04:38:35 am Rodrigo wrote:
 Hi all,
 I'm using Catalyst::Authentication::Store::LDAP to authenticate users, but
 now I need to allow some of them to single-signon without a password, like
 this:
 [...]
  I'm looking at the authentication internals and it seems to be missing a
 per-user flag to disable password checking. Only a global realm-based
 password_type='none' exists. Am I correct?

That's not auth in general, it's Credential::Password. You can write your own 
credential that implements your own policy and have it do whatever you like.

 To make matters worse, LDAP::User::check_password also checks user roles
 since it needs the password to bind to the ldap server. That could make it
 more difficult to implement a passwordless flag at any level on the
 authenticate chain.

Store::LDAP has an option for whether or not to rebind as the given user when 
doing role searches. If it's off, and if your LDAP permissions are set 
appropriately, you shouldn't need the user's password at any phase.

Andrew


___
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] More up-to-date version of Perl 5.10 ...

2009-07-20 Thread Andrew Rodland
On Monday 20 July 2009 02:42:51 pm Kiffin Gish wrote:
 Hi there.

 Installed Catalyst and at the end it said that because of a bug in Perl
 5.10 I need to update to a newer version. Which version do you recommend
 that is the most stable for Catalyst?

If you build your own perl, then take 5.10.0 and patch it for RT#488088 before 
you compile. If you get perl from a vendor, then you should hope that they 
patched their version a year ago, and if not you should start yelling loudly 
at them.

Either way, 5.10.0 (until 5.10.1 arrives).

Andrew





___
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] more description for FAST CGI deployment in catalyst cookbook?

2009-07-15 Thread Andrew Rodland
On Wednesday 15 July 2009 06:23:24 pm kakim...@tpg.com.au wrote:

 Again, my question is, where do I put the configuration above in?
 apache.conf ? httpd.conf? Doesn't say :(

Wherever it needs to be for your setup; apache configurations differ quite a 
bit by vendor, and this is the Catalyst cookbook, not the Apache instructions.

Andrew


___
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 implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Andrew Rodland
On Monday 06 July 2009 05:37:49 pm kakim...@tpg.com.au wrote:
  Did you even look for this in the manual?
 
  http://search.cpan.org/~ribasushi/DBIx-Class-0.08107/lib/DBIx/Class/
  Storage.pm#txn_do
 
  If not, why not. If so, how is this not clear?

 Well, it's really clear now . I suppose someone has updated the
 documentation since I posted this thread up.

That's the same version of the same doc as you mentioned in the first post of 
the thread :)

Andrew

___
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] Potential query string pollution vulnerability?

2009-06-16 Thread Andrew Rodland
On Tuesday 16 June 2009 04:11:19 am Tobias Kremer wrote:
 To me, this never looked like a potential security threat because
 $c-req-param('name') is correctly inserted/quoted via bind
 parameters, right? Well, let's see what happens, if we pollute the
 query string a bit:

 /crashme?name=Fooname=Bar

Using $c-req-param for this kind of purpose (or, if you ask certain people, 
for any purpose) is discouraged, and has been discouraged as long as I can 
remember, for this reason. Use $c-req-params and validate your input. 
(Incidentally, if you'd used $c-req-params-{name} the behavior you would 
have gotten would have been WHERE name='Foo' OR name='Bar' which can be a 
really useful behavior straight out of the box -- but the point stands that 
you have to know what your data is, know what your data needs to be, and make 
sure that the two are reconcileable before you do anything :)

Andrew



___
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] Notes on installing lighttpd and FastCGI for Catalyst

2009-06-06 Thread Andrew Rodland
On Saturday 06 June 2009 04:04:08 am kakim...@tpg.com.au wrote:
 hi guys,

  I'm facing some problems with
 http://dev.catalyst.perl.org/wiki/deployment/lighttpd_fastcgi.

This message looks oddly familiar.

Andrew



___
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: error when using Authentication::Store::Minimal

2009-06-02 Thread Andrew Rodland
You shouldn't be using the login method to begin with, you want authenticate. 
Pay less attention to the book (which has very little to do with anything) and 
more to the docs.

Andrew


___
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] Looking for a working example using DBIC and Authentication

2009-05-28 Thread Andrew Rodland
On Thursday 28 May 2009 07:36:29 pm Simon Baird wrote:
  Thanks for the advice. I might start fresh and see if I can pinpoint
  where things went wrong.

 Ok, so just now I have:

 * Googled and ended up here:
 http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7000/lib/Catalyst/Manua
l/Tutorial/Authentication.pod

Google is not to be trusted: that's 3 years old. Its advice was reasonably 
good three years ago, but not so much today.

The current version is at http://search.cpan.org/~hkclark/Catalyst-
Manual-5.8000/lib/Catalyst/Manual/Tutorial/05_Authentication.pod .

Andrew



___
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] Mason + DBI + Catalyst?

2009-05-25 Thread Andrew Rodland
On Monday 25 May 2009 05:35:45 pm Daniel Carrera wrote:
 Is there any good documentation for Catalyst that is based on Mason?

Catalyst is Perl. Catalyst apps are Perl apps. All the docs you need on Mason 
are in perldoc Mason and all the docs you need on DBI are in perldoc DBI. The 
info you need on how things get glued together is in perldoc 
Catalyst::View::Mason and perldoc Catalyst::Model::DBI.

And incidentally, you're wrong about DBIC. As soon as you get into queries for 
related tables, DBIC will be reducing the amount of code you need to write 
(and the number of potential screwups) tenfold. Then throw in bonus features 
like txn_do and the deployment goodies... it ends up being worthwhile pretty 
often ;)

Andrew


___
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] Strange RenderView error

2009-05-24 Thread Andrew Rodland
On Sunday 24 May 2009 03:51:47 pm Ivan Wills wrote:
 If I understand it correctly the :Arg attribute takes extra path parameters
 and converts them to method parameters so I can't see why the problem would
 occur.

1. That happens by default.
2. :Args(0) says that there are _no_ extra args on the path and the dispatcher 
shouldn't match them.
3. :Arg(0) does nothing (at least, it should do nothing) because it's not 
:Args(0).

Andrew


___
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] Who wants to be rid of the Unknown Error w/attributes bug on 5.10?

2009-05-11 Thread Andrew Rodland
On Monday 11 May 2009 05:45:01 pm Jonathan Rockway wrote:
 Or, you can use Debian, which fixed this bug in its Perl a while ago:

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488088

Not everyone uses Debian, and I, for one, would much rather be able to tell 
people get 5.10.1 than to have to explain what patch is or try to convince 
them to switch their operating system. A fix from upstream is long overdue. :)

Andrew


___
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] Forward to view question

2009-05-06 Thread Andrew Rodland
On Wednesday 06 May 2009 09:01:43 am Dennis Daupert wrote:
 On Tue, May 5, 2009 at 7:24 PM, Tomas Doran bobtf...@bobtfish.net wrote:
  my $output = delete $c-res-{body};
  opem(FH, file) or die;
  print FH $output;
  close(FH);
 
  will do what you want...

 There are some things that aren't so obvious to me. Where would I place the
 code represented in your snippet?  I can't just hang it out in the main
 body of package hde::View::TTprint, 

In that example you don't *have* a View::TTprint. Or if you do, it's just 
another subclas of C::V::TT with a different config and search path. No 
overloading, no OUTPUT. You forward to the view, it writes into $c-res-body 
like it always does. You take the data out of $c-res-body and write it to a 
file, then null out $c-res-body so that RenderView will fill it in later 
using your default_view.

Andrew


___
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::Engine::HTTP taking very long

2009-04-20 Thread Andrew Rodland
On Monday 20 April 2009 04:35:05 am Terence Monteiro wrote:
 I'm getting very high times when running my Catalyst application in
 standalone mode. I used Devel::NYTProf and zeroed in on a few subs in
 Catalyst::Engine::HTTP which take long:


The times for accept are because accept is the function that waits for a new 
incoming connection -- not a bug, 100% expected. The time spent in inet_ntoa 
is your system DNS resolver choking while trying to reverse-lookup the source 
IP address of the request. Most likely situation: you're using RFC1918 
addresses and your network is set up improperly to do DNS for these. If you 
can't fix this, hosts file entries might alleviate the problem.

Andrew


___
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   >