4 SGN - Catalyst-based application to run the SGN website.
12 This is the main class for the Sol Genomics Network main website.
18 use namespace
::autoclean
;
22 use Catalyst
::Runtime
5.80;
26 Does the roles L<SGN::Role::Site::Config>,
27 L<SGN::Role::Site::DBConnector>, L<SGN::Role::Site::DBIC>,
28 L<SGN::Role::Site::Exceptions>, L<SGN::Role::Site::Files>,
29 L<SGN::Role::Site::Mason>, L<SGN::Role::Site::SiteFeatures>,
30 L<SGN::Role::Site::TestMode>
38 +SGN
::Authentication
::Store
40 +SGN
::Role
::Site
::Config
41 +SGN
::Role
::Site
::DBConnector
42 +SGN
::Role
::Site
::DBIC
43 +SGN
::Role
::Site
::Exceptions
44 +SGN
::Role
::Site
::Files
45 +SGN
::Role
::Site
::Mason
46 +SGN
::Role
::Site
::SiteFeatures
47 +SGN
::Role
::Site
::TestMode
56 # configure catalyst-related things. in general, things should not be
57 # added here. add them to SGN.conf, with comments.
63 disable_component_resolution_regex_fallback
=> 1,
65 default_view
=> 'Mason',
67 # Static::Simple configuration
69 dirs
=> [qw
[ s static img documents static_content data
]],
72 'Plugin::ConfigLoader' => {
75 USERNAME
=> sub { (getpwuid($>))[0] },
77 GROUPNAME
=> sub { (getgrgid($)))[0] },
81 # configure SGN::Role::Site::TestMode. These are the
82 # configuration keys that it will change so that they point into
84 'Plugin::TestMode' => {
85 test_data_dir
=> __PACKAGE__
->path_to('t','data'),
90 cluster_shared_tempdir
95 intron_finder_database
104 'Plugin::Authentication' => {
105 default_realm
=> 'default',
109 class => '+SGN::Authentication::Credentials',
113 class => "+SGN::Authentication::Store",
114 user_class
=> "+SGN::Authentication::User",
115 ### role_column => 'roles',
123 # on startup, do some dynamic configuration
124 after
'setup_finalize' => sub {
128 $ENV{PROJECT_NAME
} = $self->config->{name
};
129 $self->config->{basepath
} = $self->config->{home
};
131 # all files written by web server should be group-writable
134 # update the symlinks used to serve static files
135 $self->_update_static_symlinks;
140 sub _update_static_symlinks
{
143 # symlink the static_datasets and
144 # static_content in the root dir so that
145 # Catalyst::Plugin::Static::Simple can serve them. in production,
146 # these will be served directly by Apache
148 # make symlinks for static_content and static_datasets
150 map [ $self->config->{$_.'_path'} =>
151 $self->path_to( $self->config->{root
}, $self->config->{$_.'_url'} )
153 qw( static_content static_datasets );
155 for my $link (@links) {
157 my $l1_rel = $link->[1]->relative( $self->path_to );
158 $self->log->debug("symlinking static dir '$link->[0]' -> '$l1_rel'") if $self->debug;
161 symlink( $link->[0], $link->[1] )
162 or die "$! symlinking $link->[0] => $link->[1]";
168 L<SGN::Controller::Root>, L<Catalyst>
176 This library is free software. You can redistribute it and/or modify
177 it under the same terms as Perl itself.