X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb.pm;h=b72d765a9e971d0b3e99545a195b7245af2fd415;hb=95cfd7bb5173581eda52b1d920840da10fa3a333;hp=313ba3369911b6c2adc235e7908d0329ad19fe7c;hpb=4f142aefe97e62d8510e8f4c69e18cdad8766d13;p=ndwebbie.git diff --git a/lib/NDWeb.pm b/lib/NDWeb.pm index 313ba33..b72d765 100644 --- a/lib/NDWeb.pm +++ b/lib/NDWeb.pm @@ -1,32 +1,68 @@ package NDWeb; +use Moose; +use namespace::autoclean; -use strict; -use warnings; - -use Catalyst::Runtime '5.70'; +use Catalyst::Runtime 5.80; # Set flags and add plugins for the application # # -Debug: activates the debug mode for very useful log messages -# ConfigLoader: will load the configuration from a YAML file in the +# ConfigLoader: will load the configuration from a Config::General file in the # application's home directory -# Static::Simple: will serve static files from the application's root +# Static::Simple: will serve static files from the application's root # directory use parent qw/Catalyst/; +use Catalyst qw/ + -Debug + ConfigLoader + Static::Simple + Unicode + + Authentication + Authentication::Store::NDWeb + Authentication::Credential::Password + + Authorization::Roles + Authorization::ACL + + Session::DynamicExpiry + Session + Session::Store::File + Session::State::Cookie + + Compress::Gzip + Compress::Deflate + + Cache + PageCache +/; + +extends 'Catalyst'; our $VERSION = '0.01'; +$VERSION = eval $VERSION; -# Configure the application. +sub signal_bots { + system 'killall','-USR1', 'ndbot.pl'; +} + +#$SIG{__WARN__} = sub { NDWeb->log->warn(@_); }; + +# Configure the application. # -# Note that settings in ndweb.yml (or other external +# Note that settings in ndweb.conf (or other external # configuration file that you set up manually) take precedence # over this when using ConfigLoader. Thus configuration # details given here can function as a default configuration, -# with a external configuration file acting as an override for +# with an external configuration file acting as an override for # local deployment. -__PACKAGE__->config( name => 'NDWeb' ); +__PACKAGE__->config( + name => 'NDWeb', + # Disable deprecated behavior needed by old applications + disable_component_resolution_regex_fallback => 1, +); __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1; __PACKAGE__->config(session => { storage => "/tmp/ndweb-$>/session", @@ -34,7 +70,7 @@ __PACKAGE__->config(session => { expires => 300, verify_address => 1, }); -__PACKAGE__->config( cache => { +__PACKAGE__->config( "Plugin::Cache" => { backend => { class => "Cache::FileCache", cache_root => "/tmp/ndweb-$>", @@ -51,31 +87,7 @@ __PACKAGE__->config( page_cache => { __PACKAGE__->config( default_model => 'Model'); # Start the application -__PACKAGE__->setup(qw/ - -Debug - ConfigLoader - Static::Simple - Unicode - - Authentication - Authentication::Store::NDWeb - Authentication::Credential::Password - - Authorization::Roles - Authorization::ACL - - Session::DynamicExpiry - Session - Session::Store::File - Session::State::Cookie - - Compress::Gzip - Compress::Deflate - - Cache - PageCache - /); - +__PACKAGE__->setup(); __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]); __PACKAGE__->deny_access_unless('/alliances',[qw/alliances/]); @@ -94,6 +106,8 @@ __PACKAGE__->deny_access_unless('/raids',[qw/raids_edit/]); __PACKAGE__->allow_access_if('/raids/index',[qw//]); __PACKAGE__->allow_access_if('/raids/view',[qw//]); __PACKAGE__->allow_access_if('/raids/targetcalc',[qw//]); +__PACKAGE__->allow_access_if('/raids/fleetcalc',[qw//]); +__PACKAGE__->allow_access_if('/raids/calcredir',[qw//]); __PACKAGE__->allow_access_if('/raids/findRaid',[qw//]); __PACKAGE__->allow_access_if('/raids/log',[qw//]); __PACKAGE__->deny_access_unless('/intel',[qw/intel/]); @@ -129,7 +143,7 @@ Catalyst developer =head1 LICENSE -This library is free software, you can redistribute it and/or modify +This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut