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 |
16562d80 |
26 | Authentication |
27 | Session |
28 | Session::Store::File |
29 | Session::State::Cookie |
19262e3d |
30 | StatusMessage |
12566320 |
31 | StackTrace |
e490a3d8 |
32 | Cache |
b8a92065 |
33 | /; |
34 | |
35 | extends 'Catalyst'; |
36 | |
e490a3d8 |
37 | use Cache::FileCache; |
83ed6665 |
38 | use stemmaweb::Authentication::FormHandler; |
39 | |
b8a92065 |
40 | our $VERSION = '0.01'; |
41 | |
42 | # Configure the application. |
43 | # |
44 | # Note that settings in stemmaweb.conf (or other external |
45 | # configuration file that you set up manually) take precedence |
46 | # over this when using ConfigLoader. Thus configuration |
47 | # details given here can function as a default configuration, |
48 | # with an external configuration file acting as an override for |
49 | # local deployment. |
50 | |
51 | __PACKAGE__->config( |
52 | name => 'stemmaweb', |
53 | # Disable deprecated behavior needed by old applications |
54 | disable_component_resolution_regex_fallback => 1, |
532cc23b |
55 | # Set Unicode as the default |
56 | encoding => 'UTF-8', |
b8a92065 |
57 | default_view => 'TT', |
58 | 'View::JSON' => { |
59 | expose_stash => 'result', |
60 | }, |
43ad4ba4 |
61 | 'View::TT' => { |
62 | INCLUDE_PATH => [ |
63 | stemmaweb->path_to( 'root', 'src' ), |
64 | ], |
65 | }, |
e490a3d8 |
66 | |
67 | 'Plugin::Cache' => { |
68 | backend => { |
69 | class => 'Cache::FileCache', |
70 | namespace => 'cache', |
71 | default_expires_in => 86400, |
72 | }, |
73 | }, |
74 | |
16562d80 |
75 | ## kiokudb auth store testing |
76 | 'Plugin::Authentication' => { |
77 | default => { |
78 | credential => { |
79 | class => 'Password', |
80 | password_field => 'password', |
81 | password_type => 'self_check', |
82 | }, |
83 | store => { |
84 | class => 'Model::KiokuDB', |
5a9859b7 |
85 | model_name => 'Directory', |
16562d80 |
86 | }, |
19262e3d |
87 | }, |
88 | openid => { |
89 | credential => { |
90 | class => 'OpenID', |
51cece70 |
91 | extensions => ['http://openid.net/srv/ax/1.0' => |
92 | { |
93 | ns => 'ax', |
94 | uri => 'http://openid.net/srv/ax/1.0', |
95 | mode => 'fetch_request', |
96 | required => 'email', |
bafbd9ae |
97 | 'type.email' => 'http://axschema.org/contact/email', |
98 | # type => { |
99 | # email => 'http://axschema.org/contact/email' |
100 | # } |
51cece70 |
101 | } |
102 | ], |
19262e3d |
103 | }, |
104 | store => { |
105 | class => 'Model::KiokuDB', |
1412c8fc |
106 | model_name => 'Directory', |
19262e3d |
107 | }, |
108 | auto_create_user => 1, |
109 | }, |
85990daf |
110 | google => { |
111 | credential => { |
112 | class => '+stemmaweb::Authentication::Credential::Google', |
113 | }, |
114 | store => { |
115 | class => 'Model::KiokuDB', |
116 | model_name => 'Directory', |
c2ab3497 |
117 | }, |
118 | auto_create_user => 1, |
85990daf |
119 | }, |
19262e3d |
120 | }, |
121 | ## Auth with CatalystX::Controller::Auth |
122 | 'Controller::Users' => { |
83ed6665 |
123 | form_handler => 'stemmaweb::Authentication::FormHandler', |
19262e3d |
124 | model => 'User', |
125 | login_id_field => 'username', |
126 | login_db_field => 'username', |
eb38afbc |
127 | action_after_login => '/users/success', |
128 | action_after_register => '/users/success', |
bec03a85 |
129 | enable_sending_register_email => 0, |
eb38afbc |
130 | register_email_from => '"Stemmaweb" <stemmaweb@byzantini.st>', |
b13cb1e8 |
131 | register_email_subject => 'Registration to stemmaweb', |
132 | register_email_template_plain => 'register-plain.tt', |
b600c671 |
133 | realm => 'default', |
75daf982 |
134 | login_fields => { openid => [qw/openid_identifier/], |
b600c671 |
135 | default => [qw/username password remember/], |
b1d9ab02 |
136 | google => [qw/email id_token/], |
19262e3d |
137 | }, |
16562d80 |
138 | }, |
b13cb1e8 |
139 | 'View::Email::Template' => { |
140 | stash_key => 'email_template', |
141 | }, |
b74843e5 |
142 | |
143 | recaptcha => { |
eb38afbc |
144 | pub_key => '6LfR19MSAAAAACy2meHvLfZGRn3PM2rRYIAfh665', |
145 | priv_key => '6LfR19MSAAAAAMlQb8BdyecWNRE1bAL2YSgz2sah', |
b74843e5 |
146 | }, |
b8a92065 |
147 | ); |
148 | |
149 | # Start the application |
150 | __PACKAGE__->setup(); |
151 | |
152 | |
153 | =head1 NAME |
154 | |
155 | stemmaweb - Catalyst based application |
156 | |
157 | =head1 SYNOPSIS |
158 | |
159 | script/stemmaweb_server.pl |
160 | |
161 | =head1 DESCRIPTION |
162 | |
163 | [enter your description here] |
164 | |
165 | =head1 SEE ALSO |
166 | |
167 | L<stemmaweb::Controller::Root>, L<Catalyst> |
168 | |
169 | =head1 AUTHOR |
170 | |
171 | Tara L Andrews |
172 | |
173 | =head1 LICENSE |
174 | |
175 | This library is free software. You can redistribute it and/or modify |
176 | it under the same terms as Perl itself. |
177 | |
178 | =cut |
179 | |
180 | 1; |