]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb.pm
Update to be compatible with newer Catalyst.
[ndwebbie.git] / lib / NDWeb.pm
index 6cb6d67415fa0646dbd329cb0fc0adb0671cacd6..63708aaa847df6a96dc7afbad1983d8ab373b5cb 100644 (file)
@@ -1,7 +1,6 @@
 package NDWeb;
-
-use strict;
-use warnings;
+use Moose;
+use namespace::autoclean;
 
 use Catalyst::Runtime 5.80;
 
@@ -14,11 +13,12 @@ use Catalyst::Runtime 5.80;
 #                 directory
 
 use parent qw/Catalyst/;
+
 use Catalyst qw/
        -Debug
        ConfigLoader
        Static::Simple
-       Unicode
+       Unicode::Encoding
 
        Authentication
        Authentication::Store::NDWeb
@@ -32,29 +32,35 @@ use Catalyst qw/
        Session::Store::File
        Session::State::Cookie
 
-       Compress::Gzip
-       Compress::Deflate
-
        Cache
        PageCache
 /;
 
+extends 'Catalyst';
+
 our $VERSION = '0.01';
+$VERSION = eval $VERSION;
 
 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 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",
@@ -62,7 +68,7 @@ __PACKAGE__->config(session => {
        expires => 300,
        verify_address => 1,
 });
-__PACKAGE__->config( cache => {
+__PACKAGE__->config( "Plugin::Cache" => {
        backend => {
                class => "Cache::FileCache",
                cache_root => "/tmp/ndweb-$>",
@@ -78,6 +84,7 @@ __PACKAGE__->config( page_cache => {
 });
 
 __PACKAGE__->config( default_model => 'Model');
+__PACKAGE__->config( encoding => 'UTF-8');
 # Start the application
 __PACKAGE__->setup();
 
@@ -98,6 +105,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/]);