Commit | Line | Data |
5c9ecf66 |
1 | package stemmaweb; |
dbcf12a6 |
2 | use Moose; |
3 | use namespace::autoclean; |
4 | |
5 | use Catalyst::Runtime 5.80; |
6 | |
d1ba091f |
7 | use Search::GIN::Extract::Class; |
8 | use Search::GIN::Extract::Attributes; |
9 | use Search::GIN::Extract::Multiplex; |
10 | |
dbcf12a6 |
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/ |
dbcf12a6 |
24 | ConfigLoader |
25 | Static::Simple |
26 | Unicode::Encoding |
d1ba091f |
27 | Authentication |
28 | Session |
29 | Session::Store::File |
30 | Session::State::Cookie |
4dbd098b |
31 | StatusMessage |
dbcf12a6 |
32 | /; |
33 | |
34 | extends 'Catalyst'; |
35 | |
36 | our $VERSION = '0.01'; |
37 | |
38 | # Configure the application. |
39 | # |
5c9ecf66 |
40 | # Note that settings in stemmaweb.conf (or other external |
dbcf12a6 |
41 | # configuration file that you set up manually) take precedence |
42 | # over this when using ConfigLoader. Thus configuration |
43 | # details given here can function as a default configuration, |
44 | # with an external configuration file acting as an override for |
45 | # local deployment. |
46 | |
47 | __PACKAGE__->config( |
5c9ecf66 |
48 | name => 'stemmaweb', |
dbcf12a6 |
49 | # Disable deprecated behavior needed by old applications |
50 | disable_component_resolution_regex_fallback => 1, |
c4a4fb1b |
51 | default_view => 'TT', |
b90c84a0 |
52 | 'View::JSON' => { |
53 | expose_stash => 'result', |
54 | }, |
350a6cdc |
55 | 'View::TT' => { |
56 | INCLUDE_PATH => [ |
57 | stemmaweb->path_to( 'root', 'src' ), |
58 | ], |
59 | }, |
d1ba091f |
60 | ## kiokudb auth store testing |
61 | 'Plugin::Authentication' => { |
62 | default => { |
63 | credential => { |
64 | class => 'Password', |
65 | password_field => 'password', |
66 | password_type => 'self_check', |
67 | }, |
68 | store => { |
69 | class => 'Model::KiokuDB', |
77be2fb4 |
70 | model_name => 'Directory', |
d1ba091f |
71 | }, |
4dbd098b |
72 | }, |
73 | openid => { |
74 | credential => { |
75 | class => 'OpenID', |
6fadc28b |
76 | extensions => ['http://openid.net/srv/ax/1.0' => |
77 | { |
78 | ns => 'ax', |
79 | uri => 'http://openid.net/srv/ax/1.0', |
80 | mode => 'fetch_request', |
81 | required => 'email', |
82 | type => { |
83 | email => 'http://axschema.org/contact/email' |
84 | } |
85 | } |
86 | ], |
4dbd098b |
87 | }, |
88 | store => { |
89 | class => 'Model::KiokuDB', |
90 | model_name => 'User', |
91 | }, |
92 | auto_create_user => 1, |
93 | }, |
94 | }, |
95 | ## Auth with CatalystX::Controller::Auth |
96 | 'Controller::Users' => { |
97 | model => 'User', |
98 | login_id_field => 'username', |
99 | login_db_field => 'username', |
100 | action_after_login => '/index', |
101 | send_register_email => 0, |
102 | realm => 'openid', |
7d244e7d |
103 | login_fields => { openid => [qw/openid_identifier/], |
4dbd098b |
104 | default => [qw/username password/], |
105 | }, |
d1ba091f |
106 | }, |
dbcf12a6 |
107 | ); |
108 | |
109 | # Start the application |
110 | __PACKAGE__->setup(); |
111 | |
112 | |
113 | =head1 NAME |
114 | |
5c9ecf66 |
115 | stemmaweb - Catalyst based application |
dbcf12a6 |
116 | |
117 | =head1 SYNOPSIS |
118 | |
5c9ecf66 |
119 | script/stemmaweb_server.pl |
dbcf12a6 |
120 | |
121 | =head1 DESCRIPTION |
122 | |
123 | [enter your description here] |
124 | |
125 | =head1 SEE ALSO |
126 | |
5c9ecf66 |
127 | L<stemmaweb::Controller::Root>, L<Catalyst> |
dbcf12a6 |
128 | |
129 | =head1 AUTHOR |
130 | |
131 | Tara L Andrews |
132 | |
133 | =head1 LICENSE |
134 | |
135 | This library is free software. You can redistribute it and/or modify |
136 | it under the same terms as Perl itself. |
137 | |
138 | =cut |
139 | |
140 | 1; |