move var -> share
This commit is contained in:
parent
894385396c
commit
e4792fe9d9
11 changed files with 6 additions and 6 deletions
BIN
share/default.ttf
Normal file
BIN
share/default.ttf
Normal file
Binary file not shown.
60
share/site.psgi
Normal file
60
share/site.psgi
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
use strict;
|
||||
use Plack::Builder;
|
||||
use Plack::App::File;
|
||||
use WebGUI;
|
||||
|
||||
builder {
|
||||
my $wg = WebGUI->new( config => $ENV{WEBGUI_CONFIG} );
|
||||
my $config = $wg->config;
|
||||
|
||||
enable 'Log4perl', category => $config->getFilename, conf => WebGUI::Paths->logConfig;
|
||||
enable 'SimpleContentFilter', filter => sub {
|
||||
if ( utf8::is_utf8($_) ) {
|
||||
utf8::encode($_);
|
||||
}
|
||||
};
|
||||
|
||||
# Reproduce URL handler functionality with middleware
|
||||
enable '+WebGUI::Middleware::Snoop';
|
||||
enable 'Status', path => qr{^/uploads/dictionaries}, status => 401;
|
||||
|
||||
# For PassThru, use Plack::Builder::mount
|
||||
|
||||
# Extras fallback (you should be using something else to serve static files in production)
|
||||
my ( $extrasURL, $extrasPath ) = ( $config->get('extrasURL'), $config->get('extrasPath') );
|
||||
enable 'Static', root => "$extrasPath/", path => sub {s{^\Q$extrasURL/}{}};
|
||||
|
||||
# Open/close the WebGUI::Session at the outer-most onion layer
|
||||
enable '+WebGUI::Middleware::Session', config => $config;
|
||||
|
||||
enable '+WebGUI::Middleware::HTTPExceptions';
|
||||
|
||||
enable 'ErrorDocument', 503 => $config->get('maintenancePage');
|
||||
enable_if { ! $_[0]->{'webgui.debug'} } 'ErrorDocument', 500 => $config->get('maintenancePage');
|
||||
|
||||
enable '+WebGUI::Middleware::Maintenance';
|
||||
|
||||
enable_if { $_[0]->{'webgui.debug'} } 'StackTrace';
|
||||
enable_if { $_[0]->{'webgui.debug'} } 'Debug', panels => [
|
||||
'Environment',
|
||||
'Response',
|
||||
'Timer',
|
||||
'Memory',
|
||||
'Session',
|
||||
'PerlConfig',
|
||||
[ 'MySQLTrace', skip_packages => qr/\AWebGUI::SQL(?:\z|::)/ ],
|
||||
'Response',
|
||||
'Logger',
|
||||
];
|
||||
enable_if { $_[0]->{'webgui.debug'} } '+WebGUI::Middleware::Debug::Performance';
|
||||
|
||||
# This one uses the Session object, so it comes after WebGUI::Middleware::Session
|
||||
mount $config->get('uploadsURL') => builder {
|
||||
enable '+WebGUI::Middleware::WGAccess';
|
||||
Plack::App::File->new(root => $config->get('uploadsPath'));
|
||||
};
|
||||
|
||||
# Return the app
|
||||
mount '/' => $wg->to_app;
|
||||
};
|
||||
|
||||
14
share/upgrades/7.9.8-8.0.0/addMaintenancePageToConfig.pl
Normal file
14
share/upgrades/7.9.8-8.0.0/addMaintenancePageToConfig.pl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
|
||||
use File::Basename;
|
||||
use Cwd qw(realpath);
|
||||
use File::Spec::Functions;
|
||||
use WebGUI::Paths;
|
||||
|
||||
start_step "Moving preload files";
|
||||
|
||||
my $webgui_root = realpath( catdir( dirname( $INC{'WebGUI/Upgrade/Script.pm'} ), (updir) x 3 ) );
|
||||
|
||||
config->set('maintenancePage', catfile( $webgui_root, 'www', 'maintenance.html' );
|
||||
|
||||
done;
|
||||
36
share/upgrades/7.9.8-8.0.0/migrateToNewCache.pl
Normal file
36
share/upgrades/7.9.8-8.0.0/migrateToNewCache.pl
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
use Module::Find;
|
||||
|
||||
start_step "Migrating to new cache";
|
||||
|
||||
rm_lib
|
||||
findallmod('WebGUI::Cache'),
|
||||
'WebGUI::Workflow::Activity::CleanDatabaseCache',
|
||||
'WebGUI::Workflow::Activity::CleanFileCache',
|
||||
;
|
||||
|
||||
config->set("cache", {
|
||||
'driver' => 'FastMmap',
|
||||
'expires_variance' => '0.10',
|
||||
'root_dir' => '/tmp/WebGUICache',
|
||||
});
|
||||
|
||||
config->set('hotSessionFlushToDb', 600);
|
||||
config->delete('disableCache');
|
||||
config->delete('cacheType');
|
||||
config->delete('fileCacheRoot');
|
||||
config->deleteFromArray('workflowActivities/None', 'WebGUI::Workflow::Activity::CleanDatabaseCache');
|
||||
config->deleteFromArray('workflowActivities/None', 'WebGUI::Workflow::Activity::CleanFileCache');
|
||||
|
||||
sql 'DROP TABLE IF EXISTS cache';
|
||||
sql 'DELETE FROM WorkflowActivity WHERE className in (?,?)',
|
||||
'WebGUI::Workflow::Activity::CleanDatabaseCache',
|
||||
'WebGUI::Workflow::Activity::CleanFileCache',
|
||||
;
|
||||
sql 'DELETE FROM WorkflowActivityData WHERE activityId IN (?,?)',
|
||||
'pbwfactivity0000000002',
|
||||
'pbwfactivity0000000022',
|
||||
;
|
||||
|
||||
done;
|
||||
|
||||
20
share/upgrades/7.9.8-8.0.0/moveFileLocations.pl
Normal file
20
share/upgrades/7.9.8-8.0.0/moveFileLocations.pl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
|
||||
use File::Basename;
|
||||
use Cwd qw(realpath);
|
||||
use File::Spec::Functions;
|
||||
use WebGUI::Paths;
|
||||
|
||||
start_step "Moving preload files";
|
||||
|
||||
my $webgui_root = realpath( catdir( dirname( $INC{'WebGUI/Upgrade/Script.pm'} ), (updir) x 3 ) );
|
||||
|
||||
unlink catfile($webgui_root, 'lib', 'default.ttf');
|
||||
|
||||
unlink catfile($webgui_root, 'sbin', 'preload.custom.example');
|
||||
unlink catfile($webgui_root, 'sbin', 'preload.exclude.example');
|
||||
|
||||
rename catfile($webgui_root, 'sbin', 'preload.custom'), WebGUI::Paths->preloadCustom;
|
||||
rename catfile($webgui_root, 'sbin', 'preload.exclude'), WebGUI::Paths->preloadExclusions;
|
||||
|
||||
done;
|
||||
13
share/upgrades/7.9.8-8.0.0/moveMaintenance.pl
Normal file
13
share/upgrades/7.9.8-8.0.0/moveMaintenance.pl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
|
||||
use File::Spec::Functions;
|
||||
use File::Basename;
|
||||
use Cwd qw(realpath);
|
||||
|
||||
my $webgui_root = realpath( catdir( dirname( $INC{'WebGUI/Upgrade/Script.pm'} ), (updir) x 3 ) );
|
||||
|
||||
start_step "Moving maintenance file";
|
||||
|
||||
unlink catfile($webgui_root, 'docs', 'maintenance.html');
|
||||
|
||||
done;
|
||||
25
share/upgrades/_upgrade.skeleton
Normal file
25
share/upgrades/_upgrade.skeleton
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
|
||||
report "\tRunning an upgrade step...";
|
||||
|
||||
# if (! quiet) { ... }
|
||||
|
||||
# clear_cache;
|
||||
|
||||
# my $session = session;
|
||||
# my $config = config;
|
||||
# my $dbh = dbh;
|
||||
# sql 'CREATE TABLE ...';
|
||||
# version_tag "Doing asset work";
|
||||
|
||||
# rm_lib 'WebGUI::Old::Module';
|
||||
|
||||
# my $asset = asset('assetId');
|
||||
# my $asset = asset('asset/url');
|
||||
# my $asset = import_node->addChild( ... );
|
||||
# my $assets = root_asset->getLineage( ... );
|
||||
|
||||
# my $file = collateral->file('filename');
|
||||
# import_package 'some_files.wgpkg';
|
||||
|
||||
done;
|
||||
3734
share/upgrades/convert-db-to-innodb.sql
Normal file
3734
share/upgrades/convert-db-to-innodb.sql
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue