|
|
@ -10,6 +10,13 @@ sub startup { |
|
|
|
|
|
|
|
|
|
|
|
$self->plugin('CMTD::Helpers'); |
|
|
|
$self->plugin('CMTD::Helpers'); |
|
|
|
$self->plugin(Config => {file => 'cmtd.conf'}); |
|
|
|
$self->plugin(Config => {file => 'cmtd.conf'}); |
|
|
|
|
|
|
|
if (my $s = $self->app->config->{secret}) { |
|
|
|
|
|
|
|
$self->app->secrets([ $s ]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
my $s = sprintf "%08X%08X%08X", time(), rand(), rand(); |
|
|
|
|
|
|
|
$self->app->log->warn("!!! You should set a sign key for cookies in config !!!"); |
|
|
|
|
|
|
|
$self->app->secrets([ $s ]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$self->app->attr(captcha => sub { |
|
|
|
$self->app->attr(captcha => sub { |
|
|
|
my $config = $self->app->config->{captcha}; |
|
|
|
my $config = $self->app->config->{captcha}; |
|
|
|