]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb.pm
Top members converted
[ndwebbie.git] / lib / NDWeb.pm
1 package NDWeb;
2
3 use strict;
4 use warnings;
5
6 use Catalyst::Runtime '5.70';
7
8 # Set flags and add plugins for the application
9 #
10 #         -Debug: activates the debug mode for very useful log messages
11 #   ConfigLoader: will load the configuration from a YAML file in the
12 #                 application's home directory
13 # Static::Simple: will serve static files from the application's root 
14 #                 directory
15
16 use parent qw/Catalyst/;
17
18 our $VERSION = '0.01';
19
20 # Configure the application. 
21 #
22 # Note that settings in ndweb.yml (or other external
23 # configuration file that you set up manually) take precedence
24 # over this when using ConfigLoader. Thus configuration
25 # details given here can function as a default configuration,
26 # with a external configuration file acting as an override for
27 # local deployment.
28
29 __PACKAGE__->config( name => 'NDWeb' );
30 __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
31 __PACKAGE__->config(session => {
32         storage => "/tmp/ndweb-$>/sesession",
33         directory_umask => 077,
34 });
35 __PACKAGE__->config( cache => {
36         backend => {
37                 class => "Cache::FileCache",
38                 cache_root => "/tmp/ndweb-$>",
39                 directory_umask => 077,
40         },
41 });
42
43 __PACKAGE__->config( page_cache => {
44         set_http_headers => 1,
45 });
46
47
48 # Start the application
49 __PACKAGE__->setup(qw/
50         -Debug
51         ConfigLoader
52         Static::Simple
53
54         Authentication
55         Authentication::Store::NDWeb
56         Authentication::Credential::Password
57
58         Authorization::Roles
59         Authorization::ACL
60         
61         Session
62         Session::Store::File
63         Session::State::Cookie
64
65         Cache
66         PageCache
67         /);
68
69
70 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
71 __PACKAGE__->deny_access_unless('/alliances/resources',[qw/alliances_resources/]);
72 __PACKAGE__->deny_access_unless('/graphs/alliancevsintel',[qw/graphs_intel/]);
73 __PACKAGE__->deny_access_unless('/graphs/avgalliancevsintel',[qw/graphs_intel/]);
74 __PACKAGE__->deny_access_unless('/members',[qw/members/]);
75
76 =head1 NAME
77
78 NDWeb - Catalyst based application
79
80 =head1 SYNOPSIS
81
82     script/ndweb_server.pl
83
84 =head1 DESCRIPTION
85
86 [enter your description here]
87
88 =head1 SEE ALSO
89
90 L<NDWeb::Controller::Root>, L<Catalyst>
91
92 =head1 AUTHOR
93
94 Catalyst developer
95
96 =head1 LICENSE
97
98 This library is free software, you can redistribute it and/or modify
99 it under the same terms as Perl itself.
100
101 =cut
102
103 1;