Commit | Line | Data |
b8a92065 |
1 | package stemmaweb; |
2 | use Moose; |
3 | use namespace::autoclean; |
4 | |
5 | use Catalyst::Runtime 5.80; |
6 | |
16562d80 |
7 | use Search::GIN::Extract::Class; |
8 | use Search::GIN::Extract::Attributes; |
9 | use Search::GIN::Extract::Multiplex; |
10 | |
b8a92065 |
11 | # Set flags and add plugins for the application. |
12 | # |
13 | # Note that ORDERING IS IMPORTANT here as plugins are initialized in order, |
14 | # therefore you almost certainly want to keep ConfigLoader at the head of the |
15 | # list if you're using it. |
16 | # |
17 | # -Debug: activates the debug mode for very useful log messages |
18 | # ConfigLoader: will load the configuration from a Config::General file in the |
19 | # application's home directory |
20 | # Static::Simple: will serve static files from the application's root |
21 | # directory |
22 | |
23 | use Catalyst qw/ |
b8a92065 |
24 | ConfigLoader |
25 | Static::Simple |
26 | Unicode::Encoding |
16562d80 |
27 | Authentication |
28 | Session |
29 | Session::Store::File |
30 | Session::State::Cookie |
19262e3d |
31 | StatusMessage |
12566320 |
32 | StackTrace |
b8a92065 |
33 | /; |
34 | |
35 | extends 'Catalyst'; |
36 | |
37 | our $VERSION = '0.01'; |
38 | |
39 | # Configure the application. |
40 | # |
41 | # Note that settings in stemmaweb.conf (or other external |
42 | # configuration file that you set up manually) take precedence |
43 | # over this when using ConfigLoader. Thus configuration |
44 | # details given here can function as a default configuration, |
45 | # with an external configuration file acting as an override for |
46 | # local deployment. |
47 | |
48 | __PACKAGE__->config( |
49 | name => 'stemmaweb', |
50 | # Disable deprecated behavior needed by old applications |
51 | disable_component_resolution_regex_fallback => 1, |
52 | default_view => 'TT', |
53 | 'View::JSON' => { |
54 | expose_stash => 'result', |
55 | }, |
43ad4ba4 |
56 | 'View::TT' => { |
57 | INCLUDE_PATH => [ |
58 | stemmaweb->path_to( 'root', 'src' ), |
59 | ], |
60 | }, |
16562d80 |
61 | ## kiokudb auth store testing |
62 | 'Plugin::Authentication' => { |
63 | default => { |
64 | credential => { |
65 | class => 'Password', |
66 | password_field => 'password', |
67 | password_type => 'self_check', |
68 | }, |
69 | store => { |
70 | class => 'Model::KiokuDB', |
5a9859b7 |
71 | model_name => 'Directory', |
16562d80 |
72 | }, |
19262e3d |
73 | }, |
74 | openid => { |
75 | credential => { |
76 | class => 'OpenID', |
51cece70 |
77 | extensions => ['http://openid.net/srv/ax/1.0' => |
78 | { |
79 | ns => 'ax', |
80 | uri => 'http://openid.net/srv/ax/1.0', |
81 | mode => 'fetch_request', |
82 | required => 'email', |
bafbd9ae |
83 | 'type.email' => 'http://axschema.org/contact/email', |
84 | # type => { |
85 | # email => 'http://axschema.org/contact/email' |
86 | # } |
51cece70 |
87 | } |
88 | ], |
19262e3d |
89 | }, |
90 | store => { |
91 | class => 'Model::KiokuDB', |
1412c8fc |
92 | model_name => 'Directory', |
19262e3d |
93 | }, |
94 | auto_create_user => 1, |
95 | }, |
96 | }, |
97 | ## Auth with CatalystX::Controller::Auth |
98 | 'Controller::Users' => { |
99 | model => 'User', |
100 | login_id_field => 'username', |
101 | login_db_field => 'username', |
102 | action_after_login => '/index', |
1041768e |
103 | action_after_register => '/index', |
b600c671 |
104 | realm => 'default', |
75daf982 |
105 | login_fields => { openid => [qw/openid_identifier/], |
b600c671 |
106 | default => [qw/username password remember/], |
19262e3d |
107 | }, |
16562d80 |
108 | }, |
b8a92065 |
109 | ); |
110 | |
111 | # Start the application |
112 | __PACKAGE__->setup(); |
113 | |
114 | |
115 | =head1 NAME |
116 | |
117 | stemmaweb - Catalyst based application |
118 | |
119 | =head1 SYNOPSIS |
120 | |
121 | script/stemmaweb_server.pl |
122 | |
123 | =head1 DESCRIPTION |
124 | |
125 | [enter your description here] |
126 | |
127 | =head1 SEE ALSO |
128 | |
129 | L<stemmaweb::Controller::Root>, L<Catalyst> |
130 | |
131 | =head1 AUTHOR |
132 | |
133 | Tara L Andrews |
134 | |
135 | =head1 LICENSE |
136 | |
137 | This library is free software. You can redistribute it and/or modify |
138 | it under the same terms as Perl itself. |
139 | |
140 | =cut |
141 | |
142 | 1; |