# HG changeset patch # User cin # Date 1394829273 -14400 # Node ID aac1085b256d424b951b3679be22952148f87d82 initial commit diff -r 000000000000 -r aac1085b256d .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,3 @@ +syntax: glob +config/ +mysql-data/ diff -r 000000000000 -r aac1085b256d .includepath --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.includepath Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r aac1085b256d .project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.project Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,17 @@ + + + implab + + + + + + org.epic.perleditor.perlbuilder + + + + + + org.epic.perleditor.perlnature + + diff -r 000000000000 -r aac1085b256d deploy.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy.pl Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,11 @@ +#!/usr/bin/perl -w +use strict; + +my @dirs = qw( + doxygen-data + mysql-data +); + +mkdir $_ foreach grep not(-e $_), @dirs; + +`mysql_install_db --datadir=./mysql-data`; \ No newline at end of file diff -r 000000000000 -r aac1085b256d httpd.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/httpd.conf Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,92 @@ + +LoadModule ldap_module /usr/lib64/apache2-prefork/mod_ldap.so +LoadModule authnz_ldap_module /usr/lib64/apache2-prefork/mod_authnz_ldap.so +LoadModule actions_module /usr/lib64/apache2-prefork/mod_actions.so +LoadModule alias_module /usr/lib64/apache2-prefork/mod_alias.so +LoadModule auth_basic_module /usr/lib64/apache2-prefork/mod_auth_basic.so +LoadModule authz_host_module /usr/lib64/apache2-prefork/mod_authz_host.so +LoadModule authz_core_module /usr/lib64/apache2-prefork/mod_authz_core.so +LoadModule authz_user_module /usr/lib64/apache2-prefork/mod_authz_user.so +LoadModule cgi_module /usr/lib64/apache2-prefork/mod_cgi.so +LoadModule dir_module /usr/lib64/apache2-prefork/mod_dir.so +LoadModule env_module /usr/lib64/apache2-prefork/mod_env.so +LoadModule expires_module /usr/lib64/apache2-prefork/mod_expires.so +LoadModule log_config_module /usr/lib64/apache2-prefork/mod_log_config.so +LoadModule mime_module /usr/lib64/apache2-prefork/mod_mime.so +LoadModule negotiation_module /usr/lib64/apache2-prefork/mod_negotiation.so +LoadModule setenvif_module /usr/lib64/apache2-prefork/mod_setenvif.so +LoadModule rewrite_module /usr/lib64/apache2-prefork/mod_rewrite.so +LoadModule perl_module /usr/lib64/apache2/mod_perl.so + +ServerName 127.0.0.1 +DocumentRoot public_html +Listen 2077 +PidFile httpd.pid + +ErrorLog httpd.log +CustomLog httpd.log "%h %l %u %t \"%r\" %>s %b" + +PerlSwitches -T + + + use Cwd qw(cwd); + use File::Spec(); + + my ($base) = (cwd() =~ m/(.*)/); + $IMPL::Config::AppBase = $base; + $IMPL::Config::ConfigBase = File::Spec->catdir($base, 'config'); + + push @INC, File::Spec->catdir($base,'lib'); + push @INC, File::Spec->catdir($base,'../Impl/Lib'); + + require Benzin::Apache::CookieAuth; + require Benzin::Web::Application; + + +Alias /favicon.ico public_html/favicon.ico +Alias /js/ public_html/js/ +Alias /css/ public_html/css/ +Alias /static/ public_html/static/ +Alias /images/ public_html/images/ + +Alias / public_html/cgi-bin/handler.pl/ + + + AllowOverride none + Require all granted + + + + #SetHandler perl-script + #PerlHandler Benzin::Web::Application + + SetHandler cgi-script + Options +ExecCGI + + + + #AuthName "Your collab account" + #AuthType benzin + #PerlAuthenHandler Benzin::Apache::CookieAuth + + #Require valid-user + + + + Require all granted + + + Require all granted + + + Require all granted + + + Require all granted + + + Require all granted + + + Require all granted + diff -r 000000000000 -r aac1085b256d lib/Implab/Web/Resources/Root.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/Implab/Web/Resources/Root.pm Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,26 @@ +package Implab::Web::Resources::Root; +use strict; + +use IMPL::declare { + require => { + LibraryResource => '-Benzin::Web::Resources::Doxygen::Library', + UserResource => '-Benzin::Web::Resources::UserResource' + }, + base => [ + 'IMPL::Web::Application::Resource' => '@_' + ] +}; + +sub children { + return { + library => { + class => LibraryResource + }, + user => { + class => UserResource, + components => [qw(login logout passwd edit)] + } + }; +} + +1; \ No newline at end of file diff -r 000000000000 -r aac1085b256d my.cnf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/my.cnf Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,5 @@ + +[server] + +datadir = "./mysql-data" +socket = "/tmp/mysql-implab.sock" diff -r 000000000000 -r aac1085b256d public_html/cgi-bin/_config.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public_html/cgi-bin/_config.pm Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,43 @@ +use strict; +use warnings; + +use File::Spec; +use Carp; + +my @dirs; + +BEGIN { + $Carp::Verbose = 0; # set this to 1 to enable carp traces + my $cwd = (File::Spec->splitpath($ENV{SCRIPT_FILENAME} || $0))[1]; + @dirs = File::Spec->splitdir($cwd); + + #go two dirs up + pop @dirs unless pop @dirs; # remove empty dir in case of trailing / + pop @dirs; + + push @INC, File::Spec->catdir(@dirs,'lib'); + + package IMPL::Config; + + our $AppBase = File::Spec->catdir(@dirs); + our $ConfigBase = File::Spec->catdir(@dirs,'config'); + + package IMPL::Web::Application::ControllerUnit; + + our @schemaInc; + + push @schemaInc, File::Spec->catdir(@dirs,'schema'); + + package main; + + my $bootstrap = File::Spec->catfile($ConfigBase, 'bootstrap.pm'); + if( -f $bootstrap ) { + do $bootstrap; + + ($! ? die($@,$!) : die($@) )if $@; + + } + +} + +1; \ No newline at end of file diff -r 000000000000 -r aac1085b256d public_html/cgi-bin/handler.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public_html/cgi-bin/handler.pl Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,22 @@ +#!/usr/bin/perl -wT +#-d:NYTProf +use strict; + +BEGIN { + require "./_config.pm"; +} + +use CGI; +use IMPL::require { + TApp => 'Benzin::Web::Application' +}; + +eval { + my $instance = TApp->spawn; + + $instance->Run(); +}; +if ($@) { + print CGI::header(-status => 500, type => 'text/plain'); + print $@; +} \ No newline at end of file diff -r 000000000000 -r aac1085b256d serve.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/serve.pl Sat Mar 15 00:34:33 2014 +0400 @@ -0,0 +1,50 @@ +#!/usr/bin/perl +use strict; +use warnings; +use POSIX qw(setsid); + +my ($pidApache,$pidMysql,$pidTailf); + +print "starting apache\n"; +unless($pidApache = fork()) { + setsid(); + exec('/usr/sbin/httpd2 -d . -f httpd.conf -DNO_DETACH -DFOREGROUND'); +} + +print "starting mysql\n"; +unless($pidMysql = fork()) { + #setsid(); + open STDERR, '>mysql.log'; + open STDOUT, '>mysql.log'; + exec('/usr/sbin/mysqld --defaults-file=./my.cnf'); +} + +print "press any key to stop\n"; +print "opening apache log\n"; +unless($pidTailf = fork()) { + #setsid(); + exec('/usr/bin/tailf httpd.log'); +} + +getc; + +print "SHUTDOWN\n"; + +print "shutdown apache ($pidApache)\n"; +kill 28, $pidApache; +waitpid $pidApache, 0; +print "apache exited\n"; + +print "shutdown mysql ($pidMysql)\n"; +kill 15, $pidMysql; +waitpid $pidMysql, 0; +print "mysql exited\n"; + + +print "closing log ($pidTailf)\n"; +kill 9, $pidTailf; +waitpid $pidTailf, 0; + +print "done\n"; + +exit; \ No newline at end of file diff -r 000000000000 -r aac1085b256d view/templates/Collection.tt diff -r 000000000000 -r aac1085b256d view/templates/Compound.tt diff -r 000000000000 -r aac1085b256d view/templates/Library.tt diff -r 000000000000 -r aac1085b256d view/templates/Member.tt