3 use namespace::autoclean;
5 use Catalyst::Runtime 5.80;
7 # Set flags and add plugins for the application
9 # -Debug: activates the debug mode for very useful log messages
10 # ConfigLoader: will load the configuration from a Config::General file in the
11 # application's home directory
12 # Static::Simple: will serve static files from the application's root
15 use parent qw/Catalyst/;
23 Authentication::Store::NDWeb
24 Authentication::Credential::Password
29 Session::DynamicExpiry
32 Session::State::Cookie
43 our $VERSION = '0.01';
44 $VERSION = eval $VERSION;
47 system 'killall','-USR1', 'ndbot.pl';
50 #$SIG{__WARN__} = sub { NDWeb->log->warn(@_); };
52 # Configure the application.
54 # Note that settings in ndweb.conf (or other external
55 # configuration file that you set up manually) take precedence
56 # over this when using ConfigLoader. Thus configuration
57 # details given here can function as a default configuration,
58 # with an external configuration file acting as an override for
63 # Disable deprecated behavior needed by old applications
64 disable_component_resolution_regex_fallback => 1,
66 __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
67 __PACKAGE__->config(session => {
68 storage => "/tmp/ndweb-$>/session",
69 directory_umask => 077,
73 __PACKAGE__->config( "Plugin::Cache" => {
75 class => "Cache::FileCache",
76 cache_root => "/tmp/ndweb-$>",
78 default_expires_in => 3600,
79 directory_umask => 077,
83 __PACKAGE__->config( page_cache => {
84 set_http_headers => 1,
88 __PACKAGE__->config( default_model => 'Model');
89 # Start the application
92 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
93 __PACKAGE__->deny_access_unless('/alliances',[qw/alliances/]);
94 __PACKAGE__->deny_access_unless('/alliances/resources',[qw/alliances_resources/]);
95 __PACKAGE__->deny_access_unless('/graphs/alliancevsintel',[qw/graphs_intel/]);
96 __PACKAGE__->deny_access_unless('/graphs/avgalliancevsintel',[qw/graphs_intel/]);
97 __PACKAGE__->deny_access_unless('/members',[qw/members/]);
98 __PACKAGE__->deny_access_unless('/members/defenders',[qw/members_defenders/]);
99 __PACKAGE__->deny_access_unless('/covop',[qw/covop/]);
100 __PACKAGE__->deny_access_unless('/calls',[qw/calls_edit/]);
101 __PACKAGE__->allow_access_if('/calls/index',[qw/calls_list/]);
102 __PACKAGE__->allow_access_if('/calls/list',[qw/calls_list/]);
103 __PACKAGE__->allow_access_if('/calls/edit',[qw/members/]);
104 __PACKAGE__->allow_access_if('/calls/findCall',[qw/members/]);
105 __PACKAGE__->deny_access_unless('/raids',[qw/raids_edit/]);
106 __PACKAGE__->allow_access_if('/raids/index',[qw//]);
107 __PACKAGE__->allow_access_if('/raids/view',[qw//]);
108 __PACKAGE__->allow_access_if('/raids/targetcalc',[qw//]);
109 __PACKAGE__->allow_access_if('/raids/fleetcalc',[qw//]);
110 __PACKAGE__->allow_access_if('/raids/calcredir',[qw//]);
111 __PACKAGE__->allow_access_if('/raids/findRaid',[qw//]);
112 __PACKAGE__->allow_access_if('/raids/log',[qw//]);
113 __PACKAGE__->deny_access_unless('/intel',[qw/intel/]);
114 __PACKAGE__->deny_access_unless('/intel/members',[qw/intel_members/]);
115 __PACKAGE__->deny_access_unless('/intel/member',[qw/intel_member/]);
116 __PACKAGE__->deny_access_unless('/intel/naps',[qw/intel_naps/]);
117 __PACKAGE__->deny_access_unless('/jsrpc',[qw//]);
118 __PACKAGE__->allow_access_if('/jsrpc/end',1);
119 __PACKAGE__->deny_access_unless('/forum/allUnread',[qw//]);
120 __PACKAGE__->deny_access_unless('/forum/privmsg',[qw//]);
121 __PACKAGE__->deny_access_unless('/settings',[qw//]);
122 __PACKAGE__->deny_access_unless('/textexport/alliance',[qw/textexport_alliance/]);
126 NDWeb - Catalyst based application
130 script/ndweb_server.pl
134 [enter your description here]
138 L<NDWeb::Controller::Root>, L<Catalyst>
146 This library is free software. You can redistribute it and/or modify
147 it under the same terms as Perl itself.