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