my $loglv = $cnf->{level};
if (grep { $loglv eq $_ } qw(debug info warn error fatal)) {
$app->log->level($loglv);
+ $app->log->info("set log level to $loglv");
}
else {
$app->log->warn('invalid log level given in config file');
$app->plugin('Newslash::Plugin::Model', { bypass_startup => $maintenance_mode });
# use Easy Cache ($app->ezcache)
- $app->plugin('Newslash::Plugin::EasyCache');
+ #$app->plugin('Newslash::Plugin::EasyCache');
+
+ # use CompositeCache Cache ($app->ccache)
+ $app->plugin('Newslash::Plugin::CompositeCache');
# use Template::Toolkit 2 render
$app->plugin('Newslash::Plugin::TT2Renderer');
# ReCaptcha control
$app->plugin('Newslash::Plugin::ReCaptcha');
+ # Post Filter
+ $app->plugin('Newslash::Plugin::PostFilter');
+
# set canocal (for test.srad.jp)
$app->plugin('Newslash::Plugin::Canonical');
# Event Que
$app->plugin('Newslash::Plugin::EventQue');
- # Statics Logger
- $app->plugin('Newslash::Plugin::Statics');
+ # Stats Logger
+ $app->plugin('Newslash::Plugin::Stats');
# Request Body based routing condition
$app->plugin('Newslash::Plugin::RequestBodyCondition');
# HTTP Compression
$app->plugin('Newslash::Plugin::HttpCompression');
+ # Users helper
+ $app->plugin('Newslash::Plugin::Users');
+
+ # Stories helper
+ $app->plugin('Newslash::Plugin::Stories');
+
+ # Sendmail helper
+ $app->plugin('Newslash::Plugin::Sendmail');
+
+ # Wiki contents reader helper
+ $app->plugin('Newslash::Plugin::WikiContentsReader');
############################################################
#
$r->get('/submissions')->to('timeline#submissions');
$r->get('/polls')->to('timeline#polls');
+ # RSS
+ $r->get('/:rss_type' => [format => ['rss', 'xml']])->to('rss#stories');
+ $r->get('/journals/rss')->to('rss#journals');
+
# Banned page
$r->get('/banned')->to('index#banned', noindex => 1);
$r->post('/login')->to('login#login');
$r->get('/logout')->to('login#logout');
- # User Register
- $r->get('/my/newuser')->to('login#newuser');
- $r->post('/my/newuser')->to('login#newuser', captcha_check => 1);
-
# story page
$r->get('/story/:sid/' => [sid => qr|\d\d/\d\d/\d\d/\d+|])
->to('story#single');
$r->get('/comment/:cid/')->to('comment#single');
# journal page
+ # also see user page settings for /~username/journal/
$r->get('/journal/new')->to('journal#create', seclev => 1);
$r->get('/journal/:id/')->to('journal#single');
$r->get('/submission/:year/:month/')->to('archive#submission');
$r->get('/submission/')->to('archive#submission');
+ $r->get('/comment/:year/:month/:day/')->to('archive#comment');
+ $r->get('/comment/:year/:month/')->to('archive#comment');
+ $r->get('/comment/')->to('archive#comment');
+
$r->get('/poll/:year/:month/')->to('archive#poll');
$r->get('/poll/')->to('archive#poll');
$r->get('/my/messages')->to('my#messages', seclev => 1);
$r->get('/my/')->to('user#home', seclev => 1);
+ # User Register
+ $r->get('/my/newuser')->to('login#newuser');
+ $r->post('/my/newuser')->to('login#newuser', captcha_check => 1);
+ $r->get('/my/activation')->to('login#activation');
+ $r->get('/my/resetpassword')->to('login#reset_password');
+ $r->post('/my/resetpassword')->to('login#reset_password', captcha_check => 1);
+
+ # Change Email
+ $r->get('/my/change_email')->to('my#change_email', seclev => 1);
+
# search page
$r->get('/search')->to('search#search');
+ # about
+ $r->get('/about')->to('about#about');
+
+ #faq
+ $r->get('/faq/editorial')->to('faq#editorial');
+ $r->get('/faq/UI')->to('faq#UI');
+ $r->get('/faq/firehose')->to('faq#firehose');
+ $r->get('/faq/com-mod')->to('faq#com_mod');
+ $r->get('/faq/metamod')->to('faq#metamod');
+ $r->get('/faq/accounts')->to('faq#accounts');
+ $r->get('/faq/friends')->to('faq#friends');
+ $r->get('/faq/tech')->to('faq#tech');
+ $r->get('/faq/')->to('faq#faq');
+
# Admin
# pages under /admin needs seclev equal or greater than 10000;
my $admin = $r->under('/admin' => sub { my $c = shift; $c->stash(seclev => 10000); return 1; });
$admin->get('/sidebar')->to('admin-sidebar#index');
$admin->get('/feed')->to('admin-feed#index');
+ $admin->get('/filter')->to('admin-filter#index');
$admin->get('/blocking')->to('admin-blocking#index');
$admin->get('/ad')->to('admin-ads#index');
# Admin API
# pages under /api/v1/admin needs seclev equal or greater than 10000;
my $admin_api = $r->under('/api/v1/admin' => sub { my $c = shift; $c->stash(seclev => 10000); return 1; });
+
$admin_api->get('/feed')->to('API::Admin::Feed#get');
$admin_api->post('/feed')->to('API::Admin::Feed#post');
+ $admin_api->get('/filter')->to('API::Admin::Filter#get');
+ $admin_api->post('/filter')->to('API::Admin::Filter#post');
$admin_api->get('/blocking')->to('API::Admin::Blocking#get');
$admin_api->post('/blocking')->to('API::Admin::Blocking#post');
my $api = $r->under('/api/v1');
$api->post('/login')->to('API::Login#login');
+ $api->post('/newuser/validate')->to('API::User#validate_new_user');
+ $api->post('/newuser/create')->to('API::User#create_new_user');
+ $api->post('/newuser/password')->to('API::User#newuser_password');
+
$api->get('/sidebar/item')->to('API::SidebarItem#get', seclev => 1);
$api->get('/comment')->to('API::Comment#get');
$api->get('/story')->to('API::Story#get');
$api->post('/story')->to('API::Story#post');
+ $api->get('/timeline')->to('API::Timeline#get');
+
$api->get('/poll')->to('API::Poll#get');
$api->post('/poll')->to('API::Poll#post');
$api->post('/vote')->to('API::Poll#vote', csrf_check_id => 'vote');
# user page
# warning: these pathes uses regexp matching, so must write in tail of route definitions.
- my $user = $r->under('/:nickname');
- $user->get('/' => [nickname => qr/~.*/])->to('user#home');
- $user->get('/journals' => [nickname => qr/~.*/])->to('user#journals');
- $user->get('/journal' => [nickname => qr/~.*/])->to('user#journals'); # for compatibility
- $user->get('/comments' => [nickname => qr/~.*/])->to('user#comments');
- $user->get('/submissions' => [nickname => qr/~.*/])->to('user#submissions');
- $user->get('/friends' => [nickname => qr/~.*/])->to('user#friends');
- $user->get('/foes' => [nickname => qr/~.*/])->to('user#foes');
- $user->get('/fans' => [nickname => qr/~.*/])->to('user#fans');
- $user->get('/freaks' => [nickname => qr/~.*/])->to('user#freaks');
- $user->get('/achievements' => [nickname => qr/~.*/])->to('user#achievements');
- #$r->get('/:user_name/journal' => [user_name => qr/~.*/])->to('journal#user_journals');
+ my $user = $r->under('/~:nickname');
+ $user->get('/' => [nickname => qr/.*/])->to('user#home');
+ $user->get('/journal/:id' => [nickname => qr/.*/])->to('journal#single');
+ $user->get('/journals' => [nickname => qr/.*/])->to('user#journals');
+ $user->get('/journal' => [nickname => qr/.*/])->to('user#journals'); # for compatibility
+ $user->get('/comments' => [nickname => qr/.*/])->to('user#comments');
+ $user->get('/submissions' => [nickname => qr/.*/])->to('user#submissions');
+ $user->get('/friends' => [nickname => qr/.*/])->to('user#friends');
+ $user->get('/foes' => [nickname => qr/.*/])->to('user#foes');
+ $user->get('/fans' => [nickname => qr/.*/])->to('user#fans');
+ $user->get('/freaks' => [nickname => qr/.*/])->to('user#freaks');
+ $user->get('/achievements' => [nickname => qr/.*/])->to('user#achievements');
}