Re: [Mojolicious] Problem calling Mojolicious::Guides::Tutorial 'group' example

2016-06-28 Thread Stefan Adams
On Tue, Jun 28, 2016 at 5:06 PM, Randall Sindlinger 
wrote:

> I didn't know about this feature - where is it documented that I can find
> more info on it,


http://mojolicious.org/perldoc/Mojolicious/Command/routes


> and other (useful) arguments to pass to a Mojolicious app like this?


http://mojolicious.org/perldoc/Mojolicious/Commands

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Problem calling Mojolicious::Guides::Tutorial 'group' example

2016-06-28 Thread Randall Sindlinger

On Saturday, June 25, 2016 at 5:23:56 PM UTC-4, Stefan Adams wrote:
>
>
> $ perl group.pl routes
>
> Try your curl once again using one of those two routes.
>

I didn't know about this feature - where is it documented that I can find 
more info on it, and other (useful) arguments to pass to a Mojolicious app 
like this?

Thanks,
-Randall

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Re: Secrets Question

2016-06-28 Thread James Bearden

I do use "NeoCaddy" in both places and haven't touch those parts of the 
code for a long time. I only started getting the warning when I upgraded to 
a newer version of mojolicious (6.15). I used MyApp in the original post 
basically for giggles. 

So at this point it seems as though nobody can really tell my why I am 
getting the warning, so when I have some free time I will dig into it more 
and post back if I find anything. Thanks everybody for the effort.

James

On Tuesday, June 28, 2016 at 9:45:08 AM UTC-5, Stefan Adams wrote:
>
>
> On Tue, Jun 28, 2016 at 8:23 AM, James Bearden  > wrote:
>
>> It does match. The name of my app is NeoCaddy, and here is the top of the 
>> associated package:
>
>
> FWIW, this does not produce the unwanted behavior of "Your secret 
> passphrase needs to be changed":
>
> $ cat /tmp/secrets.pl
> use Mojolicious::Commands;
>
> # Start command line interface for application
> Mojolicious::Commands->start_app('NeoCaddy');
>
> package NeoCaddy;
> use Mojo::Base 'Mojolicious';
>
> sub startup {
>   my $Self = shift;
>   
>   # Set name for the mojolicious cookie. Maximum cookie size is 4096 bytes.
>   $Self->sessions->cookie_name('MyApp');
>
>   # Key to encode client cookie, which stores some session information.
>   
> $Self->secrets(['uBLR8eIgsIQ7MmZ0nfyd5UOdd48VlnUGrjYyS9regRX72qEO2b0UlQ738a',
>   '30J0SEIIF3UQzLYZNrgD2sh9Zm3DgYjzaN9RRmi8k1Gs0SBNk7tzd2dPg']);
>
>   *$Self->routes->get('/')->to(cb=>sub{shift->render(text => scalar 
> localtime)});*
> }
>
> $ perl /tmp/secrets.pl daemon
> [Tue Jun 28 09:39:37 2016] [info] Listening at "http://*:3000";
> Server available at http://127.0.0.1:3000
> ^C
>
> $ perl /tmp/secrets.pl get /
> [Tue Jun 28 09:39:41 2016] [debug] GET "/"
> [Tue Jun 28 09:39:41 2016] [debug] Routing to a callback
> [Tue Jun 28 09:39:41 2016] [debug] 200 OK (0.000403s, 2481.390/s)
> *Tue Jun 28 09:39:41 2016*
>
> Note in your original post you stated "I use 
> "Mojolicious::Commands->start_app('*MyApp*')" in a script to start my 
> server" but I used "Mojolicious::Commands->start_app('*NeoCaddy*')"
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Re: Secrets Question

2016-06-28 Thread Stefan Adams
On Tue, Jun 28, 2016 at 8:23 AM, James Bearden 
wrote:

> It does match. The name of my app is NeoCaddy, and here is the top of the
> associated package:


FWIW, this does not produce the unwanted behavior of "Your secret
passphrase needs to be changed":

$ cat /tmp/secrets.pl
use Mojolicious::Commands;

# Start command line interface for application
Mojolicious::Commands->start_app('NeoCaddy');

package NeoCaddy;
use Mojo::Base 'Mojolicious';

sub startup {
  my $Self = shift;

  # Set name for the mojolicious cookie. Maximum cookie size is 4096 bytes.
  $Self->sessions->cookie_name('MyApp');

  # Key to encode client cookie, which stores some session information.

$Self->secrets(['uBLR8eIgsIQ7MmZ0nfyd5UOdd48VlnUGrjYyS9regRX72qEO2b0UlQ738a',
  '30J0SEIIF3UQzLYZNrgD2sh9Zm3DgYjzaN9RRmi8k1Gs0SBNk7tzd2dPg']);

  *$Self->routes->get('/')->to(cb=>sub{shift->render(text => scalar
localtime)});*
}

$ perl /tmp/secrets.pl daemon
[Tue Jun 28 09:39:37 2016] [info] Listening at "http://*:3000";
Server available at http://127.0.0.1:3000
^C

$ perl /tmp/secrets.pl get /
[Tue Jun 28 09:39:41 2016] [debug] GET "/"
[Tue Jun 28 09:39:41 2016] [debug] Routing to a callback
[Tue Jun 28 09:39:41 2016] [debug] 200 OK (0.000403s, 2481.390/s)
*Tue Jun 28 09:39:41 2016*

Note in your original post you stated "I use "Mojolicious::Commands->start_
app('*MyApp*')" in a script to start my server" but I used
"Mojolicious::Commands->start_app('*NeoCaddy*')"

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Re: Secrets Question

2016-06-28 Thread James Bearden
It does match. The name of my app is NeoCaddy, and here is the top of the 
associated package:


package NeoCaddy;

use strict;
use DBI;
use Cache::Memcached::Fast;
use Config::Simple;
use File::Find::Rule;
use IO::Compress::Gzip 'gzip';
use Mojo::Base 'Mojolicious';
use Mojo::Home;
use Mojolicious::Static;
use Sys::Hostname;



On Tuesday, June 28, 2016 at 8:16:43 AM UTC-5, Jan Henning Thorsen wrote:
>
> How does the start of that package look like? Do you have this:
>
>   package MyApp;
>   use Mojo::Base "Mojolicious";
>
> The string after "package" need to match whatever you pass on 
> to start_app().
>
> Another thing: I would not run my code as "root". If you want to listen to 
> port 80, I would advice using 
> https://metacpan.org/pod/Mojolicious::Plugin::SetUserGroup to make sure 
> that the requests run as different user.
>
>
> On Monday, June 27, 2016 at 5:49:05 PM UTC+2, James Bearden wrote:
>>
>> Sure, below is the top of my startup routine. I get the "passphrase needs 
>> to be changed" warning before this code is executed.
>>
>> # This method will run once at server start
>> sub startup {
>>   my $Self = shift;
>>   
>>   if ($Self->app->mode eq 'development') {
>> $Self->app->log->level('info'); # debug, (info), warn, error, or fatal
>>   } elsif (getpwuid($>) eq 'root') {
>> $Self->app->log->info("Server starting!");
>> $Self->app->log->level('warn');
>>   } else {
>> NeoUtil::LogThis("Must be run as root!");
>> return;
>>   }
>>
>>   # Set name for the mojolicious cookie. Maximum cookie size is 4096 
>> bytes.
>>   $Self->sessions->cookie_name('MyApp');
>>
>>   # Key to encode client cookie, which stores some session information.
>>   
>> $Self->secrets(['uBLR8eIgsIQ7MmZ0nfyd5UOdd48VlnUGrjYyS9regRX72qEO2b0UlQ738a',
>>   '30J0SEIIF3UQzLYZNrgD2sh9Zm3DgYjzaN9RRmi8k1Gs0SBNk7tzd2dPg']);
>>
>>
>>
>> And the output I am getting is:
>>
>> Server available at http://127.0.0.1:3000
>> [Mon Jun 27 10:47:32 2016] [debug] Your secret passphrase needs to be 
>> changed
>>
>>
>>
>>
>> On Monday, June 27, 2016 at 10:44:06 AM UTC-5, Pavel K wrote:
>>>
>>> Can you show me this part of code?
>>> 27 июня 2016 г. 17:55 пользователь "James Bearden"  
>>> написал:
>>>
 That is unfortunately exactly what I have been doing, and I still get 
 the warning upon startup.

 On Sunday, June 26, 2016 at 2:24:57 PM UTC-5, Pavel K wrote:
>
> I think something like this must be to work fine
>
> sub startup {
> my $self = shift;
> $self->secrets(['stu15684ffy','tea5$6ching']);
> ...
>
> }
>
> -- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "Mojolicious" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/mojolicious/EYWg8GEPg9Y/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 mojolicious...@googlegroups.com.
 To post to this group, send email to mojol...@googlegroups.com.
 Visit this group at https://groups.google.com/group/mojolicious.
 For more options, visit https://groups.google.com/d/optout.

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Re: Secrets Question

2016-06-28 Thread Jan Henning Thorsen
How does the start of that package look like? Do you have this:

  package MyApp;
  use Mojo::Base "Mojolicious";

The string after "package" need to match whatever you pass on 
to start_app().

Another thing: I would not run my code as "root". If you want to listen to 
port 80, I would advice using 
https://metacpan.org/pod/Mojolicious::Plugin::SetUserGroup to make sure 
that the requests run as different user.


On Monday, June 27, 2016 at 5:49:05 PM UTC+2, James Bearden wrote:
>
> Sure, below is the top of my startup routine. I get the "passphrase needs 
> to be changed" warning before this code is executed.
>
> # This method will run once at server start
> sub startup {
>   my $Self = shift;
>   
>   if ($Self->app->mode eq 'development') {
> $Self->app->log->level('info'); # debug, (info), warn, error, or fatal
>   } elsif (getpwuid($>) eq 'root') {
> $Self->app->log->info("Server starting!");
> $Self->app->log->level('warn');
>   } else {
> NeoUtil::LogThis("Must be run as root!");
> return;
>   }
>
>   # Set name for the mojolicious cookie. Maximum cookie size is 4096 bytes.
>   $Self->sessions->cookie_name('MyApp');
>
>   # Key to encode client cookie, which stores some session information.
>   
> $Self->secrets(['uBLR8eIgsIQ7MmZ0nfyd5UOdd48VlnUGrjYyS9regRX72qEO2b0UlQ738a',
>   '30J0SEIIF3UQzLYZNrgD2sh9Zm3DgYjzaN9RRmi8k1Gs0SBNk7tzd2dPg']);
>
>
>
> And the output I am getting is:
>
> Server available at http://127.0.0.1:3000
> [Mon Jun 27 10:47:32 2016] [debug] Your secret passphrase needs to be 
> changed
>
>
>
>
> On Monday, June 27, 2016 at 10:44:06 AM UTC-5, Pavel K wrote:
>>
>> Can you show me this part of code?
>> 27 июня 2016 г. 17:55 пользователь "James Bearden"  
>> написал:
>>
>>> That is unfortunately exactly what I have been doing, and I still get 
>>> the warning upon startup.
>>>
>>> On Sunday, June 26, 2016 at 2:24:57 PM UTC-5, Pavel K wrote:

 I think something like this must be to work fine

 sub startup {
 my $self = shift;
 $self->secrets(['stu15684ffy','tea5$6ching']);
 ...

 }

 -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Mojolicious" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/mojolicious/EYWg8GEPg9Y/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> mojolicious...@googlegroups.com.
>>> To post to this group, send email to mojol...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/mojolicious.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.