socialtext-commits Mailing List for Socialtext Open wiki (Page 2)
Brought to you by:
socialtextrocks
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(187) |
Sep
(149) |
Oct
(42) |
Nov
(265) |
Dec
(144) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(208) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pet...@us...> - 2007-01-29 23:17:38
|
Revision: 983 http://svn.sourceforge.net/socialtext/?rev=983&view=rev Author: petdance Date: 2007-01-29 15:17:36 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Handle current_callback(); put back _req to _r Modified Paths: -------------- branches/rug/lib/Socialtext/Rug/MP1.pm branches/rug/lib/Socialtext/Rug/MP2.pm Modified: branches/rug/lib/Socialtext/Rug/MP1.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/MP1.pm 2007-01-29 23:17:12 UTC (rev 982) +++ branches/rug/lib/Socialtext/Rug/MP1.pm 2007-01-29 23:17:36 UTC (rev 983) @@ -17,7 +17,7 @@ return bless { - _req => scalar Apache::Request->instance( $r, POST_MAX => MAX_UPLOAD_SIZE ) + _r => scalar Apache::Request->instance( $r, POST_MAX => MAX_UPLOAD_SIZE ) }, $class; } @@ -28,7 +28,7 @@ =cut -sub req { $_[0]->{_req} } +sub req { $_[0]->{_r} } sub user { shift->req->connection()->user(@_) } Modified: branches/rug/lib/Socialtext/Rug/MP2.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/MP2.pm 2007-01-29 23:17:12 UTC (rev 982) +++ branches/rug/lib/Socialtext/Rug/MP2.pm 2007-01-29 23:17:36 UTC (rev 983) @@ -13,6 +13,7 @@ use Apache2::URI (); use Apache2::Request (); use Apache2::RequestUtil (); +use ModPerl::Util (); use base 'Apache2::RequestRec'; @@ -25,11 +26,13 @@ my $r = shift || Apache2::RequestUtil->request; my $req = Apache2::Request->new( $r ); - my $self = bless { _req => $req }, $class; + my $self = bless { _r => $req }, $class; return $self; } +=head1 METHODS SPECIFIC TO THIS SocialRug::Rug::MP2 + =head2 $rug->req() Returns the Apache::Request object for this Rug object. Should only be @@ -37,22 +40,33 @@ =cut -sub req { $_[0]->{_req} } +sub req { $_[0]->{_r} } -sub user { - shift->req->connection()->user( @_ ); +=head1 STANDARD METHODS + +For standard methods required for any Socialtext::Rug::X module, see +Socialtext::Rug. + +=cut + +sub current_callback { + return ModPerl::Util::current_callback(); } sub get_config { - shift->req->dir_config->get( @_ ); + shift->dir_config->get( @_ ); } +sub log_error { + shift->req->log_error( @_ ); +} + sub send_http_header { shift->req->content_type( @_ ); } -sub log_error { - shift->req->log_error( @_ ); +sub user { + shift->req->connection()->user( @_ ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 23:17:13
|
Revision: 982 http://svn.sourceforge.net/socialtext/?rev=982&view=rev Author: petdance Date: 2007-01-29 15:17:12 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Handle the case where we have no RugHandler Modified Paths: -------------- branches/rug/lib/Socialtext/Rug/Handler.pm Modified: branches/rug/lib/Socialtext/Rug/Handler.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/Handler.pm 2007-01-29 23:16:51 UTC (rev 981) +++ branches/rug/lib/Socialtext/Rug/Handler.pm 2007-01-29 23:17:12 UTC (rev 982) @@ -13,9 +13,9 @@ my $rug = Socialtext::Rug->instance($r); my $phase = $rug->current_callback(); - ( my $config_key = $phase ) =~ s/^Perl/Rug/; + ( my $config_key = $phase ) =~ s/^Perl(Response)?/Rug/; - my $handler = $rug->get_config($config_key); + my $handler = $rug->get_config($config_key) or die "No RugHandler specified"; return $handler->handler($rug); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 23:16:53
|
Revision: 981 http://svn.sourceforge.net/socialtext/?rev=981&view=rev Author: petdance Date: 2007-01-29 15:16:51 -0800 (Mon, 29 Jan 2007) Log Message: ----------- updated docs Modified Paths: -------------- branches/rug/lib/Socialtext/Rug.pm Modified: branches/rug/lib/Socialtext/Rug.pm =================================================================== --- branches/rug/lib/Socialtext/Rug.pm 2007-01-29 22:56:25 UTC (rev 980) +++ branches/rug/lib/Socialtext/Rug.pm 2007-01-29 23:16:51 UTC (rev 981) @@ -16,6 +16,18 @@ use Socialtext::Build qw( get_build_setting ); use Socialtext::Validate qw( validate_pos APACHE_TYPE ); +=head1 FUNCTIONS + +=head2 webapi() + +Function that returns the API that we're using, either "mod_perl1" or "mod_perl2". + +=cut + +sub webapi { + return get_build_setting( 'webapi' ); +} + =head1 METHODS =head2 instance( [$r] ) @@ -273,16 +285,7 @@ caches the user name here. Sets the user name to the optional first argument. -=head1 FUNCTIONS - -=head2 webapi() - -Function that returns the API that we're using, either "mod_perl1" or "mod_perl2". - =cut -sub webapi { - return get_build_setting( 'webapi' ); -} - +1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 22:56:26
|
Revision: 980 http://svn.sourceforge.net/socialtext/?rev=980&view=rev Author: petdance Date: 2007-01-29 14:56:25 -0800 (Mon, 29 Jan 2007) Log Message: ----------- reverting pid name Modified Paths: -------------- branches/rug/etc/init.d/st-apache.in Modified: branches/rug/etc/init.d/st-apache.in =================================================================== --- branches/rug/etc/init.d/st-apache.in 2007-01-29 22:53:31 UTC (rev 979) +++ branches/rug/etc/init.d/st-apache.in 2007-01-29 22:56:25 UTC (rev 980) @@ -17,7 +17,7 @@ Readonly my $CONF => '@PREFIX@@HTTPD_CONFDIR@/st-httpd.conf'; Readonly my $DAEMON => '@HTTPD@'; Readonly my @COMMAND => ($DAEMON, '-f', $CONF); -Readonly my $PIDFILE => '@PREFIX@@HTTPD_PIDDIR@/st-app.pid'; +Readonly my $PIDFILE => '@PREFIX@@HTTPD_PIDDIR@/st-apache.pid'; Readonly my $PERL => '@PERL@'; Readonly my $USER => 'root'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 22:53:36
|
Revision: 979 http://svn.sourceforge.net/socialtext/?rev=979&view=rev Author: petdance Date: 2007-01-29 14:53:31 -0800 (Mon, 29 Jan 2007) Log Message: ----------- All the instance objects are now $rug instead of $r Modified Paths: -------------- branches/rug/lib/Socialtext/Rug.pm Modified: branches/rug/lib/Socialtext/Rug.pm =================================================================== --- branches/rug/lib/Socialtext/Rug.pm 2007-01-29 22:34:04 UTC (rev 978) +++ branches/rug/lib/Socialtext/Rug.pm 2007-01-29 22:53:31 UTC (rev 979) @@ -58,64 +58,74 @@ The astute reader will note that most of the docs here are taken from Apache.pm in mod_perl 1.29 and Apache::Request. This is not an accident. -=head2 $r->instance() constructor +=head2 $rug->instance() constructor This is the singleton constructor. -=head2 $r->content_type( [$newval] ) +=head2 $rug->content_type( [$newval] ) Get or set the content type being sent to the client. Content types are strings like "text/plain", "text/html" or "image/gif". This corresponds to the "Content-Type" header in the HTTP protocol. Example of usage is: - $previous_type = $r->content_type; - $r->content_type('text/plain'); + $previous_type = $rug->content_type; + $rug->content_type('text/plain'); -=head2 $r->custom_response( $code, $uri ) +=head2 $rug->current_callback() +Returns the name of the handler currently being run. This method is +most useful to PerlDispatchHandlers who wish to only take action for +certain phases. + + if ( $r->current_callback eq 'PerlLogHandler' ) { + $r->warn('Logging request'); + } + +=head2 $rug->custom_response( $code, $uri ) + This method provides a hook into the B<ErrorDocument> mechanism, allowing you to configure a custom response for a given response code at request-time. - #<Location $r->uri> + #<Location $rug->uri> #ErrorDocument 401 /error.html #</Location> - $r->custom_response(AUTH_REQUIRED, "/error.html"); + $rug->custom_response(AUTH_REQUIRED, "/error.html"); #can send a string too - #<Location $r->uri> + #<Location $rug->uri> #ErrorDocument 401 "sorry, go away" #</Location> - #$r->custom_response(AUTH_REQUIRED, "sorry, go away"); + #$rug->custom_response(AUTH_REQUIRED, "sorry, go away"); return AUTH_REQUIRED; -=head2 $r->err_header_out( $header, [$value] ) +=head2 $rug->err_header_out( $header, [$value] ) Change the value of an error response header, or create a new one. These headers are used if the status indicates an error. - $r->err_header_out( Warning => 'Bad luck' ); - $val = $r->err_header_out($key); + $rug->err_header_out( Warning => 'Bad luck' ); + $val = $rug->err_header_out($key); -=head2 $r->filename( [$filename] ) +=head2 $rug->filename( [$filename] ) Returns the result of the I<URI-to-filename> translation, optionally changing it with the first argument if you happen to be doing the translation. -=head2 $r->get_basic_auth_pw() +=head2 $rug->get_basic_auth_pw() If the current request is protected by Basic authentication, this method will return OK. Otherwise, it will return a value that ought to be propagated back to the client (typically AUTH_REQUIRED). The second return value will be the decoded password sent by the client. - ($ret, $sent_pw) = $r->get_basic_auth_pw; + ($ret, $sent_pw) = $rug->get_basic_auth_pw; -=head2 $r->get_config( $key ) +=head2 $rug->get_config( $key ) Returns the value of a web server config variable. @@ -124,55 +134,55 @@ # PerlAddVar Key Value2 # </Location> - my @val = $r->dir_config->get('Key'); + my @val = $rug->dir_config->get('Key'); Keys are case-insensitive. -=head2 $r->header_in( $header_name, [$value] ) +=head2 $rug->header_in( $header_name, [$value] ) Return the value of a client header. Can be used like this: - $ct = $r->header_in('Content-type'); - $r->header_in($key, $val); #set the value of header $key + $ct = $rug->header_in('Content-type'); + $rug->header_in($key, $val); #set the value of header $key -=head2 $r->header_out( $header, $value ) +=head2 $rug->header_out( $header, $value ) Change the value of a response header, or create a new one. You should not define any "Content-XXX" headers by calling this method, because these headers use their own specific methods. - $r->header_out( 'WWW-Authenticate' => 'Basic' ); - $val = $r->header_out($key); + $rug->header_out( 'WWW-Authenticate' => 'Basic' ); + $val = $rug->header_out($key); -=head2 $r->hostname() +=head2 $rug->hostname() Returns the server host name, as set by full URI or Host: header. -=head2 $r->log_error( $message ) +=head2 $rug->log_error( $message ) Write a message to the server errorlog. - $r->log_error( 'Some text that goes in the error_log' ); + $rug->log_error( 'Some text that goes in the error_log' ); -=head2 $r->log_reason( $message, $file ) +=head2 $rug->log_reason( $message, $file ) The request failed, why?? Write a message to the server errorlog. - $r->log_reason("Because I felt like it", $r->filename); + $rug->log_reason("Because I felt like it", $rug->filename); -=head2 $r->method( [$meth] ) +=head2 $rug->method( [$meth] ) Returns the request method, a string such as "GET", "HEAD" or "POST". Passing an argument will set the method, mainly used for internal redirects. -=head2 $r->note_basic_auth_failure() +=head2 $rug->note_basic_auth_failure() Prior to requiring Basic authentication from the client, this method will set the outgoing HTTP headers asking the client to authenticate for the realm defined by the configuration directive C<AuthName>. -=head2 $r->param( $key [=> $value] ) +=head2 $rug->param( $key [=> $value] ) Get or set request parameters using case-insensitive keys. @@ -183,25 +193,25 @@ # Assigns multiple values to 'foo' $apr->param('foo' => [qw(one two three)]); -=head2 $r->path() +=head2 $rug->path() Returns the path for the current request. -=head2 $r->pnotes( $key, [$value] ) +=head2 $rug->pnotes( $key, [$value] ) Return the value of a named entry in the Apache C<notes> table, or optionally set the value of a named entry. This table is used by Apache modules to pass messages amongst themselves. Generally if you are writing handlers in mod_perl you can use Perl variables for this. - $r->pnotes("MY_HANDLER" => [qw(one two)]); - my $val = $r->pnotes("MY_HANDLER"); + $rug->pnotes("MY_HANDLER" => [qw(one two)]); + my $val = $rug->pnotes("MY_HANDLER"); print $val->[0]; # prints "one" -Advantage over just using a Perl variable is that $r->pnotes gets +Advantage over just using a Perl variable is that $rug->pnotes gets cleaned up after every request. -=head2 $r->print() +=head2 $rug->print() This method sends data to the client. @@ -216,7 +226,7 @@ The result is "bar", not the "SCALAR(0xDEADBEEF)" you might have expected. -=head2 $r->read( $buf, $bytes_to_read, [$offset] ) +=head2 $rug->read( $buf, $bytes_to_read, [$offset] ) This method is used to read data from the client, looping until it gets all of C<$bytes_to_read> or a timeout happens. @@ -224,40 +234,40 @@ An offset may be specified to place the read data at some other place than the beginning of the string. -=head2 $r->requires() +=head2 $rug->requires() Returns an array reference of hash references, containing information related to the B<require> directive. This is normally used for access control, see L<Apache::AuthzAge> for an example. -=head2 $r->send_fd( $filehandle ) +=head2 $rug->send_fd( $filehandle ) Send the contents of a file to the client, such as: - open(FILE, $r->filename) || return 404; - $r->send_fd(FILE); + open(FILE, $rug->filename) || return 404; + $rug->send_fd(FILE); close(FILE); -=head2 $r->send_http_header() +=head2 $rug->send_http_header() Send the response line and all headers to the client. Takes an optional parameter indicating the content-type of the response, i.e. 'text/html'. -=head2 $r->status_line( $string ) +=head2 $rug->status_line( $string ) Get or set the response status line. The status line is a string like "200 Document follows". -=head2 $r->upload() +=head2 $rug->upload() XXX Need to write this in a mod_perl-agnostic way -=head2 $r->uri( [$uri] ) +=head2 $rug->uri( [$uri] ) Returns the requested URI minus optional query string, optionally changing it with the first argument. -=head2 $r->user( [$user] ) +=head2 $rug->user( [$user] ) If an authentication check was successful, the authentication handler caches the user name here. Sets the user name to the optional first This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 22:34:08
|
Revision: 978 http://svn.sourceforge.net/socialtext/?rev=978&view=rev Author: petdance Date: 2007-01-29 14:34:04 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Internally deal with ApacheN::Request objects as req, not r Modified Paths: -------------- branches/rug/lib/Socialtext/Rug/MP1.pm branches/rug/lib/Socialtext/Rug/MP2.pm branches/rug/lib/Socialtext/Rug.pm Modified: branches/rug/lib/Socialtext/Rug/MP1.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/MP1.pm 2007-01-29 22:24:46 UTC (rev 977) +++ branches/rug/lib/Socialtext/Rug/MP1.pm 2007-01-29 22:34:04 UTC (rev 978) @@ -17,17 +17,24 @@ return bless { - _r => scalar Apache::Request->instance( $r, POST_MAX => MAX_UPLOAD_SIZE ) + _req => scalar Apache::Request->instance( $r, POST_MAX => MAX_UPLOAD_SIZE ) }, $class; } -sub apache_object { $_[0]->{_r} } +=head2 $rug->req() -sub user { shift->{_r}->connection()->user(@_) } +Returns the Apache::Request object for this Rug object. Should only be +use internally. -sub get_config { shift->{_r}->dir_config->get(@_) } +=cut +sub req { $_[0]->{_req} } +sub user { shift->req->connection()->user(@_) } + +sub get_config { shift->req->dir_config->get(@_) } + + 1; __END__ Modified: branches/rug/lib/Socialtext/Rug/MP2.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/MP2.pm 2007-01-29 22:24:46 UTC (rev 977) +++ branches/rug/lib/Socialtext/Rug/MP2.pm 2007-01-29 22:34:04 UTC (rev 978) @@ -25,29 +25,34 @@ my $r = shift || Apache2::RequestUtil->request; my $req = Apache2::Request->new( $r ); - my $self = bless { _r => $req }, $class; + my $self = bless { _req => $req }, $class; return $self; } -sub r { $_[0]->{_r} } +=head2 $rug->req() -sub apache_object { $_[0]->{_r} } +Returns the Apache::Request object for this Rug object. Should only be +use internally. +=cut + +sub req { $_[0]->{_req} } + sub user { - shift->r->connection()->user( @_ ); + shift->req->connection()->user( @_ ); } sub get_config { - shift->r>dir_config->get( @_ ); + shift->req->dir_config->get( @_ ); } sub send_http_header { - shift->r->content_type( @_ ); + shift->req->content_type( @_ ); } sub log_error { - shift->r->log_error( @_ ); + shift->req->log_error( @_ ); } Modified: branches/rug/lib/Socialtext/Rug.pm =================================================================== --- branches/rug/lib/Socialtext/Rug.pm 2007-01-29 22:24:46 UTC (rev 977) +++ branches/rug/lib/Socialtext/Rug.pm 2007-01-29 22:34:04 UTC (rev 978) @@ -16,7 +16,15 @@ use Socialtext::Build qw( get_build_setting ); use Socialtext::Validate qw( validate_pos APACHE_TYPE ); +=head1 METHODS +=head2 instance( [$r] ) + +Returns a singleton instance of the Rug object, appropriate for which +web API we're using. + +=cut + sub instance { my $class = shift; my ($r) = validate_pos( @_, APACHE_TYPE( optional => 1 ) ); @@ -43,13 +51,6 @@ } } -sub webapi { - return get_build_setting( 'webapi' ); -} - -1; - -__END__ =head1 REQUIRED METHODS Any compliant Socialtext::Rug::* class must implement these methods. @@ -261,3 +262,17 @@ If an authentication check was successful, the authentication handler caches the user name here. Sets the user name to the optional first argument. + +=head1 FUNCTIONS + +=head2 webapi() + +Function that returns the API that we're using, either "mod_perl1" or "mod_perl2". + +=cut + +sub webapi { + return get_build_setting( 'webapi' ); +} + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 22:24:48
|
Revision: 977 http://svn.sourceforge.net/socialtext/?rev=977&view=rev Author: petdance Date: 2007-01-29 14:24:46 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Fixed instantiation of the Apache2::Request member. Modified Paths: -------------- branches/rug/lib/Socialtext/Rug/MP2.pm Modified: branches/rug/lib/Socialtext/Rug/MP2.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/MP2.pm 2007-01-29 22:21:36 UTC (rev 976) +++ branches/rug/lib/Socialtext/Rug/MP2.pm 2007-01-29 22:24:46 UTC (rev 977) @@ -11,20 +11,21 @@ use mod_perl 2.0; use Apache2::URI (); +use Apache2::Request (); use Apache2::RequestUtil (); use base 'Apache2::RequestRec'; -use constant MAX_UPLOAD_SIZE => 100 * 1024 * 1024; +# Apache2::Request provides the same API as Apache::Request. +# Apache2::RequestRec is more or less like the Apache.pm API sub _new { die 'Apache2::compat is loaded, and should not be' if $INC{'Apache2/compat.pm'}; my $class = shift; - my $r = shift || Apache->request(); + my $r = shift || Apache2::RequestUtil->request; + my $req = Apache2::Request->new( $r ); - my $self = bless { - _r => scalar Apache::RequestRec->instance( $r, POST_MAX => MAX_UPLOAD_SIZE ) - }, $class; + my $self = bless { _r => $req }, $class; return $self; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 22:21:40
|
Revision: 976 http://svn.sourceforge.net/socialtext/?rev=976&view=rev Author: petdance Date: 2007-01-29 14:21:36 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Have to load Apache2::Request and set a flag on it Modified Paths: -------------- branches/rug/build/deps/mod_perl2.yaml branches/rug/build/templates/app/modules.tt2 Modified: branches/rug/build/deps/mod_perl2.yaml =================================================================== --- branches/rug/build/deps/mod_perl2.yaml 2007-01-29 21:38:18 UTC (rev 975) +++ branches/rug/build/deps/mod_perl2.yaml 2007-01-29 22:21:36 UTC (rev 976) @@ -13,3 +13,4 @@ #MasonX::WebApp: 0.12 # First version compatible with mod_perl2 MasonX::WebApp: 0.1101 # My faked-up version until Dave releases his Apache2::Cookie: 0 +Apache2::Request: 0 Modified: branches/rug/build/templates/app/modules.tt2 =================================================================== --- branches/rug/build/templates/app/modules.tt2 2007-01-29 21:38:18 UTC (rev 975) +++ branches/rug/build/templates/app/modules.tt2 2007-01-29 22:21:36 UTC (rev 976) @@ -50,6 +50,7 @@ [% load_module( 'auth' ) %] [% load_module( 'setenvif' ) %] [% load_module( 'perl' ) %] + [% load_module( 'apreq', 'apreq2' ) %] [% IF config.ssl %] [% load_module( 'ssl' ) %] [% END %] @@ -57,4 +58,6 @@ [% load_module( 'status' ) %] ExtendedStatus On [% END %] + PerlModule Apache2::Request + PerlOptions +GlobalRequest [% END %] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 21:38:23
|
Revision: 975 http://svn.sourceforge.net/socialtext/?rev=975&view=rev Author: petdance Date: 2007-01-29 13:38:18 -0800 (Mon, 29 Jan 2007) Log Message: ----------- The pid is now st-app.pid Modified Paths: -------------- branches/rug/etc/init.d/st-apache.in Modified: branches/rug/etc/init.d/st-apache.in =================================================================== --- branches/rug/etc/init.d/st-apache.in 2007-01-29 20:00:58 UTC (rev 974) +++ branches/rug/etc/init.d/st-apache.in 2007-01-29 21:38:18 UTC (rev 975) @@ -17,7 +17,7 @@ Readonly my $CONF => '@PREFIX@@HTTPD_CONFDIR@/st-httpd.conf'; Readonly my $DAEMON => '@HTTPD@'; Readonly my @COMMAND => ($DAEMON, '-f', $CONF); -Readonly my $PIDFILE => '@PREFIX@@HTTPD_PIDDIR@/st-apache-perl.pid'; +Readonly my $PIDFILE => '@PREFIX@@HTTPD_PIDDIR@/st-app.pid'; Readonly my $PERL => '@PERL@'; Readonly my $USER => 'root'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 20:12:42
|
Revision: 974 http://svn.sourceforge.net/socialtext/?rev=974&view=rev Author: petdance Date: 2007-01-29 12:00:58 -0800 (Mon, 29 Jan 2007) Log Message: ----------- PerlModule directives are not allowed inside Location blocks under Apache2 Modified Paths: -------------- branches/rug/build/templates/app/app.tt2 Modified: branches/rug/build/templates/app/app.tt2 =================================================================== --- branches/rug/build/templates/app/app.tt2 2007-01-29 20:00:30 UTC (rev 973) +++ branches/rug/build/templates/app/app.tt2 2007-01-29 20:00:58 UTC (rev 974) @@ -3,8 +3,8 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler [% handler %] - PerlModule [% handler %] </Location> + PerlModule [% handler %] [% END %][%# simple_handler() %] [% MACRO match_handler( locpattern, handler ) BLOCK %] @@ -12,8 +12,8 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler [% handler %] - PerlModule [% handler %] </LocationMatch> + PerlModule [% handler %] [% END %][%# match_handler() %] [% MACRO vhost_common( for_ssl_vhost ) BLOCK %] @@ -87,9 +87,9 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler Socialtext::Handler::REST - PerlModule Socialtext::Handler::REST Require valid-user </Location> + PerlModule Socialtext::Handler::REST Alias /nlw [% config.comp_root %] [% simple_handler( '/nlw', 'Socialtext::MasonHandler' ) %] @@ -145,8 +145,8 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler Socialtext::Handler::App - PerlModule Socialtext::Handler::App </LocationMatch> + PerlModule Socialtext::Handler::App <LocationMatch "^/[^/]+/member/index\.cgi"> ErrorDocument 404 /index.cgi @@ -154,16 +154,16 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler Socialtext::Handler::App - PerlModule Socialtext::Handler::App </LocationMatch> + PerlModule Socialtext::Handler::App <Location /index.cgi> SetHandler perl-script PerlInitHandler +Socialtext::InitHandler PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler Socialtext::Handler::NoWorkspace - PerlModule Socialtext::Handler::NoWorkspace </Location> + PerlModule Socialtext::Handler::NoWorkspace <Location /feed> AuthName "Socialtext Authentication" @@ -180,8 +180,8 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler Socialtext::Handler::Syndicate - PerlModule Socialtext::Handler::Syndicate </Location> + PerlModule Socialtext::Handler::Syndicate [% simple_handler( '/noauth/feed', 'Socialtext::Handler::Syndicate' ) %] [% simple_handler( '/soap/0.9', 'Socialtext::SOAPServer' ) %] @@ -200,9 +200,9 @@ SetHandler perl-script PerlHandler +Socialtext::Rug::Handler PerlSetVar RugHandler Apache::Registry - PerlModule Apache::Registry Options ExecCGI </Location> + PerlModule Apache::Registry [% END %] [% END %][%# MACRO vhost_common %] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 20:12:31
|
Revision: 973 http://svn.sourceforge.net/socialtext/?rev=973&view=rev Author: petdance Date: 2007-01-29 12:00:30 -0800 (Mon, 29 Jan 2007) Log Message: ----------- add mod_rewrite Modified Paths: -------------- branches/rug/build/templates/app/modules.tt2 Modified: branches/rug/build/templates/app/modules.tt2 =================================================================== --- branches/rug/build/templates/app/modules.tt2 2007-01-29 15:51:02 UTC (rev 972) +++ branches/rug/build/templates/app/modules.tt2 2007-01-29 20:00:30 UTC (rev 973) @@ -45,6 +45,7 @@ [% load_module( 'negotiation' ) %] [% load_module( 'alias' ) %] [% load_module( 'dir' ) %] + [% load_module( 'rewrite' ) %] [% load_module( 'access' ) %] [% load_module( 'auth' ) %] [% load_module( 'setenvif' ) %] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-29 15:51:23
|
Revision: 972 http://svn.sourceforge.net/socialtext/?rev=972&view=rev Author: petdance Date: 2007-01-29 07:51:02 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Only checks version if we loaded the module successfully Modified Paths: -------------- branches/rug/dev-bin/list-module-deps Modified: branches/rug/dev-bin/list-module-deps =================================================================== --- branches/rug/dev-bin/list-module-deps 2007-01-26 20:47:21 UTC (rev 971) +++ branches/rug/dev-bin/list-module-deps 2007-01-29 15:51:02 UTC (rev 972) @@ -67,19 +67,24 @@ # Get the version eval "require $module; 0"; my $err = $@; - my $ver = eval {$module->VERSION} || eval "\$$module\::VERSION" || 0; - $ver =~ s/_//g if $ver; - $status->{have}= $ver; # Set the status if ($err) { $status->{status} = "not found: $err"; - } elsif ($status->{wanted} and $ver < $status->{wanted}) { - $status->{status} = 'old'; - } elsif ($ver >= $status->{wanted} or not $status->{wanted}) { - $status->{status} = 'ok'; } + else { + my $ver = eval {$module->VERSION} || eval "\$$module\::VERSION" || 0; + $ver =~ s/_//g if $ver; + $status->{have}= $ver; + if ($status->{wanted} and ($ver < $status->{wanted})) { + $status->{status} = 'old'; + } + elsif ((not $status->{wanted}) or ($ver >= $status->{wanted})) { + $status->{status} = 'ok'; + } + } + $results{$module} = $status; } return %results; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-26 20:47:25
|
Revision: 971 http://svn.sourceforge.net/socialtext/?rev=971&view=rev Author: petdance Date: 2007-01-26 12:47:21 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Still more reshuffling, and everything named apache_base_X is now apache_app_X Modified Paths: -------------- branches/rug/build/templates/app/base.tt2 branches/rug/build/templates/shared/rewrite.tt2 branches/rug/dev-bin/gen-config Added Paths: ----------- branches/rug/build/templates/app/app.tt2 branches/rug/build/templates/proxy/proxy.tt2 Removed Paths: ------------- branches/rug/build/templates/app/nlw.tt2 branches/rug/build/templates/proxy/nlw.tt2 Copied: branches/rug/build/templates/app/app.tt2 (from rev 970, branches/rug/build/templates/app/nlw.tt2) =================================================================== --- branches/rug/build/templates/app/app.tt2 (rev 0) +++ branches/rug/build/templates/app/app.tt2 2007-01-26 20:47:21 UTC (rev 971) @@ -0,0 +1,298 @@ +[% MACRO simple_handler( loc, handler ) BLOCK %] + <Location [% loc %]> + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler [% handler %] + PerlModule [% handler %] + </Location> +[% END %][%# simple_handler() %] + +[% MACRO match_handler( locpattern, handler ) BLOCK %] + <LocationMatch [% locpattern %]> + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler [% handler %] + PerlModule [% handler %] + </LocationMatch> +[% END %][%# match_handler() %] + +[% MACRO vhost_common( for_ssl_vhost ) BLOCK %] + ServerAdmin [% config.server_admin %] + DocumentRoot [% config.data_root_dir %] + PerlSetEnv HOME [% config.prefix_dir %]/var/www +[% IF config.is_dev %] + PerlPassEnv NLW_APPCONFIG +[% END %] + PerlSetEnv APACHE_LOG_DIR [% config.log_dir %] + +[% IF config.is_dev %] + PerlSetVar ReloadAll Off + PerlSetVar ReloadModules "Socialtext::WebApp Socialtext::WebApp::* Socialtext::* Socialtext::MasonHandler Socialtext::Handler Socialtext::Handler::* Socialtext::RequestContext" + [% IF config.webapi == 'mod_perl1' %] + PerlInitHandler +Apache::Reload + [% END %] + [% IF config.webapi == 'mod_perl2' %] + PerlInitHandler +Apache2::Reload + [% END %] +[% END %] + +[% IF config.apache_status %] + # Optionally load B::TerseSize for Apache::Status to use + <Perl> + eval { require B::TerseSize }; + </Perl> + # Status handlers + <Location /status> + SetHandler server-status + Order Deny,Allow + Deny from all + Allow from [% config.apache_status %] + </Location> + <Location /perl-status> + SetHandler perl-script + [% IF config.webapi == 'mod_perl1' %] + PerlHandler +Apache::Status + [% END %] + [% IF config.webapi == 'mod_perl2' %] + PerlResponseHandler +Apache2::Status + [% END %] + PerlSetVar StatusOptionsAll On + PerlSetVar StatusTerseSizeMainSummary On + Order Deny,Allow + Deny from all + Allow from [% config.apache_status %] + </Location> +[% END %] + +[% IF config.single %] + [% PROCESS 'shared/rewrite.tt2' %] +[% END %] + + PerlCleanupHandler +Socialtext::Handler::Cleanup + + <Location /> + PerlInitHandler +Socialtext::InitHandler + </Location> + + <Location /data> + AuthName "Socialtext Authentication" + AuthType Basic + PerlAddVar SocialtextAuthenActions check_cookie + PerlAddVar SocialtextAuthenActions check_basic + PerlAddVar SocialtextAuthenActions http_401 + + PerlAuthenHandler +Socialtext::Rug::Handler + PerlSetVar RugAuthenHandler Socialtext::Apache::AuthenHandler + + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler Socialtext::Handler::REST + PerlModule Socialtext::Handler::REST + Require valid-user + </Location> + + Alias /nlw [% config.comp_root %] + [% simple_handler( '/nlw', 'Socialtext::MasonHandler' ) %] + +[% IF not config.socialtext_open %] + <Location /st-archive> + [%# A way for host customers to download stuff (workspace backups, + etc) in a way that requires authentication. Only used on production. %] + Options FollowSymlinks + AuthName "Socialtext Authentication" + AuthType Basic + PerlAddVar SocialtextAuthenActions check_cookie + PerlAddVar SocialtextAuthenActions check_basic + PerlAddVar SocialtextAuthenActions http_401 + + PerlAuthenHandler +Socialtext::Rug::Handler + PerlSetVar RugAuthenHandler Socialtext::Apache::AuthenHandler + + PerlSetEnv ST_AUTHZ_URL_BASE /st-archive/ + PerlAuthzHandler +Socialtext::Rug::Handler + RugAuthzHandler Socialtext::AuthzHandler + Require valid-workspace-membership + </Location> + <Location /nlw/control> + [%# Control panel %] + PerlAccessHandler +Socialtext::AccessHandler::IsBusinessAdmin + </Location> +[% END %] + + # These are considered internal components (traditional Mason naming + # convention), where .html, etc, are publically viewable. + <LocationMatch "^/nlw/.*(handler|\.mas)$"> + Deny from all + </LocationMatch> + +[% simple_handler( '/lite/page', 'Socialtext::Handler::Page::Lite' ) %] +[% simple_handler( '/lite/changes', 'Socialtext::Handler::Changes::Lite' ) %] +[% simple_handler( '/lite/search', 'Socialtext::Handler::Search::Lite' ) %] +[% simple_handler( '/lite/category', 'Socialtext::Handler::Category::Lite' ) %] + +[% simple_handler( '/page', 'Socialtext::Handler::Page::Full' ) %] +[% simple_handler( '/changes', 'Socialtext::Handler::Changes::Full' ) %] +[% simple_handler( '/search', 'Socialtext::Handler::Search::Full' ) %] +[% simple_handler( '/category', 'Socialtext::Handler::Category::Full' ) %] + +[% match_handler( '^/page/[^/]+/[^/]+/attachments', 'Socialtext::Handler::Attachment' ) %] +[% match_handler( '^/page/[^/]+/[^/]+/tags', 'Socialtext::Handler::Tag' ) %] +[% match_handler( '^/index\.cgi', 'Socialtext::Handler::App' ) %] + + <LocationMatch "^/[^/]+/index\.cgi"> + ErrorDocument 404 /index.cgi + + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler Socialtext::Handler::App + PerlModule Socialtext::Handler::App + </LocationMatch> + + <LocationMatch "^/[^/]+/member/index\.cgi"> + ErrorDocument 404 /index.cgi + + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler Socialtext::Handler::App + PerlModule Socialtext::Handler::App + </LocationMatch> + + <Location /index.cgi> + SetHandler perl-script + PerlInitHandler +Socialtext::InitHandler + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler Socialtext::Handler::NoWorkspace + PerlModule Socialtext::Handler::NoWorkspace + </Location> + + <Location /feed> + AuthName "Socialtext Authentication" + AuthType Basic + PerlAddVar SocialtextAuthenActions check_cookie + PerlAddVar SocialtextAuthenActions check_basic + PerlAddVar SocialtextAuthenActions http_401 + + PerlAuthenHandler +Socialtext::Rug::Handler + PerlSetVar RugAuthenHandler Socialtext::Apache::AuthenHandler + + Require valid-user + + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler Socialtext::Handler::Syndicate + PerlModule Socialtext::Handler::Syndicate + </Location> + +[% simple_handler( '/noauth/feed', 'Socialtext::Handler::Syndicate' ) %] +[% simple_handler( '/soap/0.9', 'Socialtext::SOAPServer' ) %] +[% simple_handler( '/wsdl', 'Socialtext::Handler::WSDL' ) %] + +[% IF config.is_appliance %] + Alias /console/ /var/www/console/ + + <Directory /var/www/console> + Options FollowSymlinks + </Directory> + + <Location /console> + DirectoryIndex index.html index.cgi + + SetHandler perl-script + PerlHandler +Socialtext::Rug::Handler + PerlSetVar RugHandler Apache::Registry + PerlModule Apache::Registry + Options ExecCGI + </Location> +[% END %] +[% END %][%# MACRO vhost_common %] + +[%# Real code starts here %] +# This file is the Socialtext-specific Apache configuration. It is designed +# to be Included from a parent configuration file. You can use the +# /etc/apache-perl/st-httpd.conf that we build for you, or, if you have other +# server settings you prefer, you can Include it from your own +# /etc/apache-perl/httpd.conf. +# --------------------------------------------------------------------------- +# You can set set the size limits for Apache processes by setting the +# appropriate variables below. These are passed through to Apache::SizeLimit +# via Socialtext::Handler::Cleanup. +# Set min/max sizes to pass to Apache::SizeLimit +# See http://search.cpan.org/dist/Apache-SizeLimit/ + +# This sets the maximum size of the Apache process, including both shared +# and unshared memory. +# PerlSetVar st_max_process_size 200000 + +# These two are effectively meaningless if Apache::SizeLimit can't +# determine the shared memory size for your platform. + +# This sets the maximum amount of unshared memory the process can use. +PerlSetVar st_max_unshared_size 200000 + +# This sets the minimum amount of shared memory the process must have. +# PerlSetVar st_min_shared_size 70000 + +[% PROCESS 'app/modules.tt2' %] +[%- IF config.inc -%] + <Perl> + use lib + [%- FOREACH dirname IN config.inc %] + '[% dirname %]'[%- IF loop.last -%];[%- ELSE -%],[%- END -%] + [%- END %] + </Perl> +[%- END -%] + +PerlSetEnv NLW_CONFIG [% config.nlw_config_file %] +PerlSetEnv MASON_COMP_ROOT [% config.comp_root %] +PerlSetEnv APACHE_LOG_DIR [% config.log_dir %] +[% IF ENV.HARNESS_ACTIVE %] +PerlSetEnv HARNESS_ACTIVE [% ENV.HARNESS_ACTIVE %] +[% END %] +[%# REVIEW - hack to make Socialtext::Workspace->uri work in devs envs %] +[% IF config.is_dev %] +PerlSetEnv NLW_FRONTEND_PORT [% config.apache_proxy_port %] +PerlSetEnv NLW_DEV_MODE 1 +[% END %] + +PerlModule Socialtext::ModPerl +PerlModule Socialtext::Authen::Postgres +PerlModule Socialtext::Rug::Handler +PerlModule Socialtext::AuthzHandler +PerlModule Socialtext::Apache::AuthenHandler +PerlModule Socialtext::Handler::REST +PerlModule Socialtext::Handler::App +PerlModule Socialtext::Handler::NoWorkspace +PerlModule Socialtext::Handler::Syndicate +[% IF config.webapi == 'mod_perl1' %] +PerlModule Socialtext::Rug::MP1 +[% END %] +[% IF config.webapi == 'mod_perl2' %] +PerlModule Socialtext::Rug::MP2 +[% END %] + +<VirtualHost *:[% config.backend_port %]> +[% IF !config.apache_proxy %] + ServerName [% config.nlw_server_hostname %] +[% END %] +[% vhost_common( 0 ) %] +</VirtualHost> + +[% IF config.apache_proxy %] +<VirtualHost *:[% config.backend_port + 1000 %]> + PerlSetVar NLWHTTPSRedirect 1 +[% vhost_common( 1 ) %] +</VirtualHost> +[% END %][%# config.apache_proxy %] + +[% IF config.eu_httpd_exists %] +<VirtualHost 10.8.0.1:[% config.backend_port %]> + ServerName www.eu.socialtext.net +[% vhost_common( 1 ) %] +</VirtualHost> + +<VirtualHost 10.8.0.1:[% config.backend_port + 1000 %]> + ServerName www.eu.socialtext.net + PerlSetVar NLWHTTPSRedirect 1 +[% vhost_common( 1 ) %] +</VirtualHost> +[% END %][%# config.eu_httpd_exists %] Modified: branches/rug/build/templates/app/base.tt2 =================================================================== --- branches/rug/build/templates/app/base.tt2 2007-01-26 20:01:33 UTC (rev 970) +++ branches/rug/build/templates/app/base.tt2 2007-01-26 20:47:21 UTC (rev 971) @@ -11,13 +11,13 @@ Listen [% config.apache_proxy_port %] Listen [% config.apache_proxy_ssl_port %] [% ELSE %] -Listen [% config.apache_base_port %] -Listen [% config.apache_base_port + 1000 %] +Listen [% config.apache_app_port %] +Listen [% config.apache_app_port + 1000 %] [% END %] [% PROCESS 'shared/common.tt2' %] -Include [% config.apache_base_etc_dir %]/auto-generated.d/st-app.conf +Include [% config.apache_app_etc_dir %]/auto-generated.d/st-app.conf [% IF !config.is_dev %] -Include [% config.apache_base_etc_dir %]/conf.d/*.conf +Include [% config.apache_app_etc_dir %]/conf.d/*.conf [% END %] Deleted: branches/rug/build/templates/app/nlw.tt2 =================================================================== --- branches/rug/build/templates/app/nlw.tt2 2007-01-26 20:01:33 UTC (rev 970) +++ branches/rug/build/templates/app/nlw.tt2 2007-01-26 20:47:21 UTC (rev 971) @@ -1,298 +0,0 @@ -[% MACRO simple_handler( loc, handler ) BLOCK %] - <Location [% loc %]> - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler [% handler %] - PerlModule [% handler %] - </Location> -[% END %][%# simple_handler() %] - -[% MACRO match_handler( locpattern, handler ) BLOCK %] - <LocationMatch [% locpattern %]> - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler [% handler %] - PerlModule [% handler %] - </LocationMatch> -[% END %][%# match_handler() %] - -[% MACRO vhost_common( for_ssl_vhost ) BLOCK %] - ServerAdmin [% config.server_admin %] - DocumentRoot [% config.data_root_dir %] - PerlSetEnv HOME [% config.prefix_dir %]/var/www -[% IF config.is_dev %] - PerlPassEnv NLW_APPCONFIG -[% END %] - PerlSetEnv APACHE_LOG_DIR [% config.log_dir %] - -[% IF config.is_dev %] - PerlSetVar ReloadAll Off - PerlSetVar ReloadModules "Socialtext::WebApp Socialtext::WebApp::* Socialtext::* Socialtext::MasonHandler Socialtext::Handler Socialtext::Handler::* Socialtext::RequestContext" - [% IF config.webapi == 'mod_perl1' %] - PerlInitHandler +Apache::Reload - [% END %] - [% IF config.webapi == 'mod_perl2' %] - PerlInitHandler +Apache2::Reload - [% END %] -[% END %] - -[% IF config.apache_status %] - # Optionally load B::TerseSize for Apache::Status to use - <Perl> - eval { require B::TerseSize }; - </Perl> - # Status handlers - <Location /status> - SetHandler server-status - Order Deny,Allow - Deny from all - Allow from [% config.apache_status %] - </Location> - <Location /perl-status> - SetHandler perl-script - [% IF config.webapi == 'mod_perl1' %] - PerlHandler +Apache::Status - [% END %] - [% IF config.webapi == 'mod_perl2' %] - PerlResponseHandler +Apache2::Status - [% END %] - PerlSetVar StatusOptionsAll On - PerlSetVar StatusTerseSizeMainSummary On - Order Deny,Allow - Deny from all - Allow from [% config.apache_status %] - </Location> -[% END %] - -[% IF config.single %] - [% PROCESS 'shared/rewrite.tt2' %] -[% END %] - - PerlCleanupHandler +Socialtext::Handler::Cleanup - - <Location /> - PerlInitHandler +Socialtext::InitHandler - </Location> - - <Location /data> - AuthName "Socialtext Authentication" - AuthType Basic - PerlAddVar SocialtextAuthenActions check_cookie - PerlAddVar SocialtextAuthenActions check_basic - PerlAddVar SocialtextAuthenActions http_401 - - PerlAuthenHandler +Socialtext::Rug::Handler - PerlSetVar RugAuthenHandler Socialtext::Apache::AuthenHandler - - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler Socialtext::Handler::REST - PerlModule Socialtext::Handler::REST - Require valid-user - </Location> - - Alias /nlw [% config.comp_root %] - [% simple_handler( '/nlw', 'Socialtext::MasonHandler' ) %] - -[% IF not config.socialtext_open %] - <Location /st-archive> - [%# A way for host customers to download stuff (workspace backups, - etc) in a way that requires authentication. Only used on production. %] - Options FollowSymlinks - AuthName "Socialtext Authentication" - AuthType Basic - PerlAddVar SocialtextAuthenActions check_cookie - PerlAddVar SocialtextAuthenActions check_basic - PerlAddVar SocialtextAuthenActions http_401 - - PerlAuthenHandler +Socialtext::Rug::Handler - PerlSetVar RugAuthenHandler Socialtext::Apache::AuthenHandler - - PerlSetEnv ST_AUTHZ_URL_BASE /st-archive/ - PerlAuthzHandler +Socialtext::Rug::Handler - RugAuthzHandler Socialtext::AuthzHandler - Require valid-workspace-membership - </Location> - <Location /nlw/control> - [%# Control panel %] - PerlAccessHandler +Socialtext::AccessHandler::IsBusinessAdmin - </Location> -[% END %] - - # These are considered internal components (traditional Mason naming - # convention), where .html, etc, are publically viewable. - <LocationMatch "^/nlw/.*(handler|\.mas)$"> - Deny from all - </LocationMatch> - -[% simple_handler( '/lite/page', 'Socialtext::Handler::Page::Lite' ) %] -[% simple_handler( '/lite/changes', 'Socialtext::Handler::Changes::Lite' ) %] -[% simple_handler( '/lite/search', 'Socialtext::Handler::Search::Lite' ) %] -[% simple_handler( '/lite/category', 'Socialtext::Handler::Category::Lite' ) %] - -[% simple_handler( '/page', 'Socialtext::Handler::Page::Full' ) %] -[% simple_handler( '/changes', 'Socialtext::Handler::Changes::Full' ) %] -[% simple_handler( '/search', 'Socialtext::Handler::Search::Full' ) %] -[% simple_handler( '/category', 'Socialtext::Handler::Category::Full' ) %] - -[% match_handler( '^/page/[^/]+/[^/]+/attachments', 'Socialtext::Handler::Attachment' ) %] -[% match_handler( '^/page/[^/]+/[^/]+/tags', 'Socialtext::Handler::Tag' ) %] -[% match_handler( '^/index\.cgi', 'Socialtext::Handler::App' ) %] - - <LocationMatch "^/[^/]+/index\.cgi"> - ErrorDocument 404 /index.cgi - - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler Socialtext::Handler::App - PerlModule Socialtext::Handler::App - </LocationMatch> - - <LocationMatch "^/[^/]+/member/index\.cgi"> - ErrorDocument 404 /index.cgi - - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler Socialtext::Handler::App - PerlModule Socialtext::Handler::App - </LocationMatch> - - <Location /index.cgi> - SetHandler perl-script - PerlInitHandler +Socialtext::InitHandler - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler Socialtext::Handler::NoWorkspace - PerlModule Socialtext::Handler::NoWorkspace - </Location> - - <Location /feed> - AuthName "Socialtext Authentication" - AuthType Basic - PerlAddVar SocialtextAuthenActions check_cookie - PerlAddVar SocialtextAuthenActions check_basic - PerlAddVar SocialtextAuthenActions http_401 - - PerlAuthenHandler +Socialtext::Rug::Handler - PerlSetVar RugAuthenHandler Socialtext::Apache::AuthenHandler - - Require valid-user - - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler Socialtext::Handler::Syndicate - PerlModule Socialtext::Handler::Syndicate - </Location> - -[% simple_handler( '/noauth/feed', 'Socialtext::Handler::Syndicate' ) %] -[% simple_handler( '/soap/0.9', 'Socialtext::SOAPServer' ) %] -[% simple_handler( '/wsdl', 'Socialtext::Handler::WSDL' ) %] - -[% IF config.is_appliance %] - Alias /console/ /var/www/console/ - - <Directory /var/www/console> - Options FollowSymlinks - </Directory> - - <Location /console> - DirectoryIndex index.html index.cgi - - SetHandler perl-script - PerlHandler +Socialtext::Rug::Handler - PerlSetVar RugHandler Apache::Registry - PerlModule Apache::Registry - Options ExecCGI - </Location> -[% END %] -[% END %][%# MACRO vhost_common %] - -[%# Real code starts here %] -# This file is the Socialtext-specific Apache configuration. It is designed -# to be Included from a parent configuration file. You can use the -# /etc/apache-perl/st-httpd.conf that we build for you, or, if you have other -# server settings you prefer, you can Include it from your own -# /etc/apache-perl/httpd.conf. -# --------------------------------------------------------------------------- -# You can set set the size limits for Apache processes by setting the -# appropriate variables below. These are passed through to Apache::SizeLimit -# via Socialtext::Handler::Cleanup. -# Set min/max sizes to pass to Apache::SizeLimit -# See http://search.cpan.org/dist/Apache-SizeLimit/ - -# This sets the maximum size of the Apache process, including both shared -# and unshared memory. -# PerlSetVar st_max_process_size 200000 - -# These two are effectively meaningless if Apache::SizeLimit can't -# determine the shared memory size for your platform. - -# This sets the maximum amount of unshared memory the process can use. -PerlSetVar st_max_unshared_size 200000 - -# This sets the minimum amount of shared memory the process must have. -# PerlSetVar st_min_shared_size 70000 - -[% PROCESS 'app/modules.tt2' %] -[%- IF config.inc -%] - <Perl> - use lib - [%- FOREACH dirname IN config.inc %] - '[% dirname %]'[%- IF loop.last -%];[%- ELSE -%],[%- END -%] - [%- END %] - </Perl> -[%- END -%] - -PerlSetEnv NLW_CONFIG [% config.nlw_config_file %] -PerlSetEnv MASON_COMP_ROOT [% config.comp_root %] -PerlSetEnv APACHE_LOG_DIR [% config.log_dir %] -[% IF ENV.HARNESS_ACTIVE %] -PerlSetEnv HARNESS_ACTIVE [% ENV.HARNESS_ACTIVE %] -[% END %] -[%# REVIEW - hack to make Socialtext::Workspace->uri work in devs envs %] -[% IF config.is_dev %] -PerlSetEnv NLW_FRONTEND_PORT [% config.apache_proxy_port %] -PerlSetEnv NLW_DEV_MODE 1 -[% END %] - -PerlModule Socialtext::ModPerl -PerlModule Socialtext::Authen::Postgres -PerlModule Socialtext::Rug::Handler -PerlModule Socialtext::AuthzHandler -PerlModule Socialtext::Apache::AuthenHandler -PerlModule Socialtext::Handler::REST -PerlModule Socialtext::Handler::App -PerlModule Socialtext::Handler::NoWorkspace -PerlModule Socialtext::Handler::Syndicate -[% IF config.webapi == 'mod_perl1' %] -PerlModule Socialtext::Rug::MP1 -[% END %] -[% IF config.webapi == 'mod_perl2' %] -PerlModule Socialtext::Rug::MP2 -[% END %] - -<VirtualHost *:[% config.backend_port %]> -[% IF !config.apache_proxy %] - ServerName [% config.nlw_server_hostname %] -[% END %] -[% vhost_common( 0 ) %] -</VirtualHost> - -[% IF config.apache_proxy %] -<VirtualHost *:[% config.backend_port + 1000 %]> - PerlSetVar NLWHTTPSRedirect 1 -[% vhost_common( 1 ) %] -</VirtualHost> -[% END %][%# config.apache_proxy %] - -[% IF config.eu_httpd_exists %] -<VirtualHost 10.8.0.1:[% config.backend_port %]> - ServerName www.eu.socialtext.net -[% vhost_common( 1 ) %] -</VirtualHost> - -<VirtualHost 10.8.0.1:[% config.backend_port + 1000 %]> - ServerName www.eu.socialtext.net - PerlSetVar NLWHTTPSRedirect 1 -[% vhost_common( 1 ) %] -</VirtualHost> -[% END %][%# config.eu_httpd_exists %] Deleted: branches/rug/build/templates/proxy/nlw.tt2 =================================================================== --- branches/rug/build/templates/proxy/nlw.tt2 2007-01-26 20:01:33 UTC (rev 970) +++ branches/rug/build/templates/proxy/nlw.tt2 2007-01-26 20:47:21 UTC (rev 971) @@ -1,58 +0,0 @@ -[% MACRO server_common( apache_base_port, for_ssl_vhost ) BLOCK %] -[% IF config.is_appliance %] - Include /etc/apache2/conf.d/hostname.conf -[% ELSE %] - ServerName [% config.nlw_server_hostname %] - [% FOREACH alias in config.nlw_server_aliases %] - ServerAlias [% alias %] - [% END %] -[% END %][%# is_appliance %] - - ServerAdmin [% config.server_admin %] - DocumentRoot [% config.data_root_dir %] - ProxyRequests Off - - <Proxy *> - Order deny,allow - Deny from all - </Proxy> - - <Proxy http://localhost:*/*> - Order deny,allow - Allow from all - </Proxy> - - ProxyPreserveHost On - -[%# The rewrite file must come before any of the redirect confs below %] -[% PROCESS 'shared/rewrite.tt2' %] - - # This fixes a bug where images flash on mouseover in IE - ExpiresActive On - # Do not set ExpiresDefault! That will cause firefox to cache redirects - ExpiresByType image/gif A86400 - ExpiresByType image/jpeg A86400 - ExpiresByType image/png A86400 - -[% IF config.is_dev %] - Redirect 301 /favicon.ico http://www.socialtext.net/favicon.ico -[% END %] -[% END %][%# server_common %] - -[%# Real code starts %] -ErrorDocument 502 /static/html/502.html - -<VirtualHost *:[% config.ports.http %]> -[% server_common( config.apache_base_port, 0 ) %] -</VirtualHost> - -[% IF config.use_ssl %] -<VirtualHost _default_:[% config.ports.https %]> - [% hi_port = config.apache_base_port + 1000 %] - [% server_common( hi_port, 1 ) %] - SSLEngine on - SSLCertificateFile [% config.ssl_base_dir %]/certs/[% config.nlw_server_hostname %].crt - SSLCertificateKeyFile [% config.ssl_base_dir %]/private/[% config.nlw_server_hostname %].key -</VirtualHost> -[% END %] - Copied: branches/rug/build/templates/proxy/proxy.tt2 (from rev 969, branches/rug/build/templates/proxy/nlw.tt2) =================================================================== --- branches/rug/build/templates/proxy/proxy.tt2 (rev 0) +++ branches/rug/build/templates/proxy/proxy.tt2 2007-01-26 20:47:21 UTC (rev 971) @@ -0,0 +1,58 @@ +[% MACRO server_common( apache_app_port, for_ssl_vhost ) BLOCK %] +[% IF config.is_appliance %] + Include /etc/apache2/conf.d/hostname.conf +[% ELSE %] + ServerName [% config.nlw_server_hostname %] + [% FOREACH alias in config.nlw_server_aliases %] + ServerAlias [% alias %] + [% END %] +[% END %][%# is_appliance %] + + ServerAdmin [% config.server_admin %] + DocumentRoot [% config.data_root_dir %] + ProxyRequests Off + + <Proxy *> + Order deny,allow + Deny from all + </Proxy> + + <Proxy http://localhost:*/*> + Order deny,allow + Allow from all + </Proxy> + + ProxyPreserveHost On + +[%# The rewrite file must come before any of the redirect confs below %] +[% PROCESS 'shared/rewrite.tt2' %] + + # This fixes a bug where images flash on mouseover in IE + ExpiresActive On + # Do not set ExpiresDefault! That will cause firefox to cache redirects + ExpiresByType image/gif A86400 + ExpiresByType image/jpeg A86400 + ExpiresByType image/png A86400 + +[% IF config.is_dev %] + Redirect 301 /favicon.ico http://www.socialtext.net/favicon.ico +[% END %] +[% END %][%# server_common %] + +[%# Real code starts %] +ErrorDocument 502 /static/html/502.html + +<VirtualHost *:[% config.ports.http %]> +[% server_common( config.apache_app_port, 0 ) %] +</VirtualHost> + +[% IF config.use_ssl %] +<VirtualHost _default_:[% config.ports.https %]> + [% hi_port = config.apache_app_port + 1000 %] + [% server_common( hi_port, 1 ) %] + SSLEngine on + SSLCertificateFile [% config.ssl_base_dir %]/certs/[% config.nlw_server_hostname %].crt + SSLCertificateKeyFile [% config.ssl_base_dir %]/private/[% config.nlw_server_hostname %].key +</VirtualHost> +[% END %] + Modified: branches/rug/build/templates/shared/rewrite.tt2 =================================================================== --- branches/rug/build/templates/shared/rewrite.tt2 2007-01-26 20:01:33 UTC (rev 970) +++ branches/rug/build/templates/shared/rewrite.tt2 2007-01-26 20:47:21 UTC (rev 971) @@ -93,7 +93,7 @@ RewriteRule !^/static - [C] RewriteRule !^/logos - [C] RewriteRule !^/favicon\.ico - [C] - RewriteRule (.*) http://localhost:[% apache_base_port %]$1 [P,L] + RewriteRule (.*) http://localhost:[% apache_app_port %]$1 [P,L] [% END %] Alias /static [% config.static_dir %] Modified: branches/rug/dev-bin/gen-config =================================================================== --- branches/rug/dev-bin/gen-config 2007-01-26 20:01:33 UTC (rev 970) +++ branches/rug/dev-bin/gen-config 2007-01-26 20:47:21 UTC (rev 971) @@ -144,14 +144,14 @@ } if ( is_target_for( 'apache', 'apache-perl' ) ) { - my $params = apache_base_params( \%dirs ); + my $params = apache_app_params( \%dirs ); generate_config( - 'app/base.tt2' => "$dirs{apache_base_etc}/${app_prefix}httpd.conf", + 'app/base.tt2' => "$dirs{apache_app_etc}/${app_prefix}httpd.conf", $params, 'overwrite' ); generate_config( - 'app/app.tt2' => "$dirs{apache_base_etc}/auto-generated.d/st-app.conf", + 'app/app.tt2' => "$dirs{apache_app_etc}/auto-generated.d/st-app.conf", $params, 'overwrite' ); @@ -182,10 +182,9 @@ apache_proxy_etc => "$dirs{etc}/apache2", apache_proxy_log => File::Spec->catfile( $root_dir, 'log', 'apache2' ), apache_proxy_root => "$dirs{etc}/apache2", - apache_base_etc => "$dirs{etc}/apache-perl", - apache_base_log => - File::Spec->catfile( $root_dir, 'log', 'apache-perl' ), - apache_base_root => "$dirs{etc}/apache-perl", + apache_app_etc => "$dirs{etc}/apache-perl", + apache_app_log => File::Spec->catfile( $root_dir, 'log', 'apache-perl' ), + apache_app_root => "$dirs{etc}/apache-perl", ssl_base => "$dirs{etc}/ssl", ); for my $dir ( keys %dirs ) { @@ -205,9 +204,9 @@ apache_proxy_etc => '/etc/apache2', apache_proxy_log => '/var/log/apache2', apache_proxy_root => '/etc/apache2', - apache_base_etc => get_prefixed_dir('httpd_confdir'), - apache_base_log => get_prefixed_dir('httpd_logdir'), - apache_base_root => get_prefixed_dir('httpd_confdir'), + apache_app_etc => get_prefixed_dir('httpd_confdir'), + apache_app_log => get_prefixed_dir('httpd_logdir'), + apache_app_root => get_prefixed_dir('httpd_confdir'), run => get_prefixed_dir('httpd_piddir'), lock => get_prefixed_dir('httpd_lockdir'), root => get_prefixed_dir('webroot'), @@ -448,28 +447,28 @@ } } -sub apache_base_params { +sub apache_app_params { my %dirs = %{+shift}; my $single = !$opts{'apache-proxy'}; - my $confd = "$dirs{apache_base_etc}/conf.d"; + my $confd = "$dirs{apache_app_etc}/conf.d"; my %config = standard_params( \%dirs ); my $webapi = get_build_setting( 'webapi' ); %config = ( %config, - base_dir => $dirs{apache_base_root}, - log_dir => $dirs{apache_base_log}, + base_dir => $dirs{apache_app_root}, + log_dir => $dirs{apache_app_log}, lock_dir => $dirs{lock}, - apache_base_etc_dir => $dirs{apache_base_etc}, + apache_app_etc_dir => $dirs{apache_app_etc}, confd_exists => -d $confd, eu_httpd_exists => -f "$confd/eu-httpd.conf", eu_httpsd_exists => -f "$confd/eu-httpsd.conf", # XXX See how this was used in the original Mason $opts{'apache-proxy'} ? () : ( - apache_proxy_etc_dir => $dirs{apache_base_etc}, + apache_proxy_etc_dir => $dirs{apache_app_etc}, use_ssl => _use_ssl($config{nlw_server_hostname}), ), module_dir => get_build_setting( $webapi eq 'mod_perl1' ? 'apache-perl-moduledir' : 'apache2-moduledir' ), @@ -488,12 +487,12 @@ apache_short_name => 'apache-perl', use_canonical_name => 'On', ); - $config{backend_port} = $single ? $config{apache_proxy_port} : $config{apache_base_port}; + $config{backend_port} = $single ? $config{apache_proxy_port} : $config{apache_app_port}; if ($is_appliance) { # Apache 1 pukes if you use a symlink as part of a glob, so # need to give it the real directory - $config{apache_base_etc_dir} = '/hd' . $config{apache_base_etc_dir}; + $config{apache_app_etc_dir} = '/hd' . $config{apache_app_etc_dir}; } $config{inc} = _get_inc(); @@ -582,7 +581,7 @@ $config{apache_proxy_port} = _proxy_ports()->{http}; $config{apache_proxy_ssl_port} = _proxy_ports()->{https}; - $config{apache_base_port} = + $config{apache_app_port} = $opts{ports_start_at} ? $user->uid + $opts{ports_start_at} + 2000 : 8080; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-26 20:01:35
|
Revision: 970 http://svn.sourceforge.net/socialtext/?rev=970&view=rev Author: petdance Date: 2007-01-26 12:01:33 -0800 (Fri, 26 Jan 2007) Log Message: ----------- more config file renaming Modified Paths: -------------- branches/rug/build/templates/app/base.tt2 branches/rug/build/templates/app/modules.tt2 branches/rug/build/templates/app/nlw.tt2 branches/rug/build/templates/proxy/base.tt2 Modified: branches/rug/build/templates/app/base.tt2 =================================================================== --- branches/rug/build/templates/app/base.tt2 2007-01-26 19:19:01 UTC (rev 969) +++ branches/rug/build/templates/app/base.tt2 2007-01-26 20:01:33 UTC (rev 970) @@ -5,7 +5,7 @@ ClearModuleList AddModule mod_so.c [% END %] -[% PROCESS 'apache-perl/modules.tt2' %] +[% PROCESS 'app/modules.tt2' %] [% IF config.single %] Listen [% config.apache_proxy_port %] @@ -17,7 +17,7 @@ [% PROCESS 'shared/common.tt2' %] -Include [% config.apache_base_etc_dir %]/auto-generated.d/*.conf +Include [% config.apache_base_etc_dir %]/auto-generated.d/st-app.conf [% IF !config.is_dev %] Include [% config.apache_base_etc_dir %]/conf.d/*.conf [% END %] Modified: branches/rug/build/templates/app/modules.tt2 =================================================================== --- branches/rug/build/templates/app/modules.tt2 2007-01-26 19:19:01 UTC (rev 969) +++ branches/rug/build/templates/app/modules.tt2 2007-01-26 20:01:33 UTC (rev 970) @@ -1,4 +1,4 @@ -[%# To be included by base.tt2 and nlw.tt2. Not a standalone file. %] +[%# To be included by base.tt2 and app.tt2. Not a standalone file. %] [% MACRO load_module( which, alt_which ) BLOCK %] [%- filebase = 'mod_' _ (alt_which || which) -%] <IfModule ![% filebase %].c> @@ -8,7 +8,7 @@ [%# This is where we specify each module that's needed for apache-perl. They will be loaded in both the main httpd.conf, and the ST-specific - nlw.conf that can get included by a user's config. This way, we're + st-app.conf that can get included by a user's config. This way, we're sure that whether the main httpd.conf is written by us, or by an OSR user, we'll get the proper modules loaded. %] Modified: branches/rug/build/templates/app/nlw.tt2 =================================================================== --- branches/rug/build/templates/app/nlw.tt2 2007-01-26 19:19:01 UTC (rev 969) +++ branches/rug/build/templates/app/nlw.tt2 2007-01-26 20:01:33 UTC (rev 970) @@ -232,7 +232,7 @@ # This sets the minimum amount of shared memory the process must have. # PerlSetVar st_min_shared_size 70000 -[% PROCESS 'apache-perl/modules.tt2' %] +[% PROCESS 'app/modules.tt2' %] [%- IF config.inc -%] <Perl> use lib Modified: branches/rug/build/templates/proxy/base.tt2 =================================================================== --- branches/rug/build/templates/proxy/base.tt2 2007-01-26 19:19:01 UTC (rev 969) +++ branches/rug/build/templates/proxy/base.tt2 2007-01-26 20:01:33 UTC (rev 970) @@ -52,7 +52,7 @@ NameVirtualHost *:[% config.ports.http %] -Include [% config.apache_proxy_etc_dir %]/auto-generated.d/*.conf +Include [% config.apache_proxy_etc_dir %]/auto-generated.d/st-proxy.conf [% IF !config.is_dev %] Include [% config.apache_proxy_etc_dir %]/conf.d/*.conf This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-26 19:19:13
|
Revision: 969 http://svn.sourceforge.net/socialtext/?rev=969&view=rev Author: petdance Date: 2007-01-26 11:19:01 -0800 (Fri, 26 Jan 2007) Log Message: ----------- reorganizing the templates dir Modified Paths: -------------- branches/rug/dev-bin/gen-config Added Paths: ----------- branches/rug/build/templates/app/ branches/rug/build/templates/proxy/ Removed Paths: ------------- branches/rug/build/templates/apache-perl/ branches/rug/build/templates/apache2/ Copied: branches/rug/build/templates/app (from rev 967, branches/rug/build/templates/apache-perl) Copied: branches/rug/build/templates/proxy (from rev 967, branches/rug/build/templates/apache2) Modified: branches/rug/dev-bin/gen-config =================================================================== --- branches/rug/dev-bin/gen-config 2007-01-26 17:18:29 UTC (rev 968) +++ branches/rug/dev-bin/gen-config 2007-01-26 19:19:01 UTC (rev 969) @@ -132,12 +132,12 @@ if ( is_target_for( 'apache', 'apache2' ) ) { my $params = apache_proxy_params( \%dirs ); generate_config( - 'apache2/base.tt2' => "$dirs{apache_proxy_etc}/${app_prefix}apache2.conf", + 'proxy/base.tt2' => "$dirs{apache_proxy_etc}/${app_prefix}apache2.conf", $params, 'overwrite' ); generate_config( - 'apache2/nlw.tt2' => "$dirs{apache_proxy_etc}/auto-generated.d/nlw.conf", + 'proxy/proxy.tt2' => "$dirs{apache_proxy_etc}/auto-generated.d/st-proxy.conf", $params, 'overwrite' ); @@ -146,12 +146,12 @@ if ( is_target_for( 'apache', 'apache-perl' ) ) { my $params = apache_base_params( \%dirs ); generate_config( - 'apache-perl/base.tt2' => "$dirs{apache_base_etc}/${app_prefix}httpd.conf", + 'app/base.tt2' => "$dirs{apache_base_etc}/${app_prefix}httpd.conf", $params, 'overwrite' ); generate_config( - 'apache-perl/nlw.tt2' => "$dirs{apache_base_etc}/auto-generated.d/nlw.conf", + 'app/app.tt2' => "$dirs{apache_base_etc}/auto-generated.d/st-app.conf", $params, 'overwrite' ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-26 17:18:45
|
Revision: 968 http://svn.sourceforge.net/socialtext/?rev=968&view=rev Author: petdance Date: 2007-01-26 09:18:29 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Changed generate_config to get called once per file, rather than with a list Modified Paths: -------------- branches/rug/dev-bin/gen-config Modified: branches/rug/dev-bin/gen-config =================================================================== --- branches/rug/dev-bin/gen-config 2007-01-23 22:25:19 UTC (rev 967) +++ branches/rug/dev-bin/gen-config 2007-01-26 17:18:29 UTC (rev 968) @@ -129,52 +129,42 @@ my @files; - # Format for each entry is - # [ - # source component => destination, - # config parameters - # whether or not to overwrite existing - # ] if ( is_target_for( 'apache', 'apache2' ) ) { my $params = apache_proxy_params( \%dirs ); - push @files, - [ + generate_config( 'apache2/base.tt2' => "$dirs{apache_proxy_etc}/${app_prefix}apache2.conf", $params, - 'overwrite', - ], - [ + 'overwrite' + ); + generate_config( 'apache2/nlw.tt2' => "$dirs{apache_proxy_etc}/auto-generated.d/nlw.conf", $params, - 'overwrite', - ]; + 'overwrite' + ); } if ( is_target_for( 'apache', 'apache-perl' ) ) { my $params = apache_base_params( \%dirs ); - push @files, - [ + generate_config( 'apache-perl/base.tt2' => "$dirs{apache_base_etc}/${app_prefix}httpd.conf", $params, - 'overwrite', - ], - [ + 'overwrite' + ); + generate_config( 'apache-perl/nlw.tt2' => "$dirs{apache_base_etc}/auto-generated.d/nlw.conf", $params, - 'overwrite', - ]; + 'overwrite' + ); } - if ( is_target_for( "app" ) ) { - push @files, - [ + if ( is_target_for( 'app' ) ) { + generate_config( 'socialtext/shortcuts.yaml.tt2' => "$dirs{socialtext_etc}/shortcuts.yaml", { }, $is_dev_install ? 'overwrite' : 0 - ]; + ); } - generate_app_config( \%dirs ) if is_target_for("app") && !$opts{stdout}; - generate_config( @files ); + generate_app_config( \%dirs ) if is_target_for('app') && !$opts{stdout}; if ( !$is_dev_install && !$opts{stdout} && is_target_for( 'ssl', 'apache', 'apache2', 'apache-perl' ) ) { copy_static_files( \%dirs ) @@ -306,7 +296,7 @@ } sub generate_config { - my @files = @_; + my ( $source, $target, $config, $overwrite ) = @_; my $template_root = Cwd::abs_path( @@ -321,32 +311,33 @@ ABSOLUTE => 1, # Allow absolute paths }) || die "$Template::ERROR\n"; - while ( my $spec = shift @files ) { - my ( $source, $target, $config, $overwrite ) = @$spec; + return if !$opts{stdout} && -f $target && !$overwrite; - next if -f $target && !$overwrite && !$opts{stdout}; + _print_file_gen( "$inc/templates$source", $target ); - _print_file_gen( "$inc/templates$source", $target ); + my $buffer; + $tt->process( $source, { + config => $config, + ENV => \%ENV, + }, \$buffer ) or die $Template::ERROR; - my $buffer; - $tt->process( $source, { - config => $config, - ENV => \%ENV, - }, \$buffer ) or die $Template::ERROR; + my $time = scalar localtime; + if ($opts{stdout}) { + my $divider = '#' x 78; + print <<"END"; +$divider +$target +\$ $command_line +$time +$divider +$buffer +END + } + else { + File::Path::mkpath( File::Basename::dirname($target), $opts{verbose}, 0755 ); - if ($opts{stdout}) { - print '#' x 78, "\n"; - print "$target\n"; - print "\$ $command_line\n"; - print '#' x 78, "\n"; - print $buffer; - } - else { - my $time = scalar localtime; - File::Path::mkpath( File::Basename::dirname($target), $opts{verbose}, 0755 ); - - open my $fh, ">", $target or die "Cannot write to $target: $!"; - print {$fh} <<"EOF"; + open my $fh, '>', $target or die "Cannot write to $target: $!"; + print {$fh} <<"EOF"; # # WARNING: DO NOT EDIT THIS FILE # @@ -361,10 +352,9 @@ # $buffer EOF - close $fh; - print "Created $target\n"; - } - } # while files to process + close $fh; + print "Created $target\n"; + } } sub apache_proxy_params { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 22:25:19
|
Revision: 967 http://svn.sourceforge.net/socialtext/?rev=967&view=rev Author: petdance Date: 2007-01-23 14:25:19 -0800 (Tue, 23 Jan 2007) Log Message: ----------- fixed how we check for is_dev Modified Paths: -------------- branches/rug/dev-bin/gen-config Modified: branches/rug/dev-bin/gen-config =================================================================== --- branches/rug/dev-bin/gen-config 2007-01-23 21:45:39 UTC (rev 966) +++ branches/rug/dev-bin/gen-config 2007-01-23 22:25:19 UTC (rev 967) @@ -176,7 +176,7 @@ generate_app_config( \%dirs ) if is_target_for("app") && !$opts{stdout}; generate_config( @files ); - if ( !$config{is_dev} && !$opts{stdout} && is_target_for( 'ssl', 'apache', 'apache2', 'apache-perl' ) ) { + if ( !$is_dev_install && !$opts{stdout} && is_target_for( 'ssl', 'apache', 'apache2', 'apache-perl' ) ) { copy_static_files( \%dirs ) } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 21:45:55
|
Revision: 966 http://svn.sourceforge.net/socialtext/?rev=966&view=rev Author: petdance Date: 2007-01-23 13:45:39 -0800 (Tue, 23 Jan 2007) Log Message: ----------- clarify rules for copying that static files. Modified Paths: -------------- branches/rug/dev-bin/gen-config Modified: branches/rug/dev-bin/gen-config =================================================================== --- branches/rug/dev-bin/gen-config 2007-01-23 20:37:18 UTC (rev 965) +++ branches/rug/dev-bin/gen-config 2007-01-23 21:45:39 UTC (rev 966) @@ -175,8 +175,10 @@ } generate_app_config( \%dirs ) if is_target_for("app") && !$opts{stdout}; generate_config( @files ); - copy_static_files( \%dirs ) - if is_target_for( "ssl", "apache", "apache2", "apache-perl" ); + + if ( !$config{is_dev} && !$opts{stdout} && is_target_for( 'ssl', 'apache', 'apache2', 'apache-perl' ) ) { + copy_static_files( \%dirs ) + } } sub local_dirs { @@ -614,8 +616,6 @@ my %dirs = %{+shift}; my %config = standard_params( \%dirs ); - return unless $config{is_dev}; - my $crt_source = -f "$inc/static/ssl/$config{nlw_server_hostname}.crt" ? "$inc/static/ssl/$config{nlw_server_hostname}.crt" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 20:37:20
|
Revision: 965 http://svn.sourceforge.net/socialtext/?rev=965&view=rev Author: petdance Date: 2007-01-23 12:37:18 -0800 (Tue, 23 Jan 2007) Log Message: ----------- app_prefix is a standard_param now Modified Paths: -------------- branches/rug/dev-bin/gen-config Modified: branches/rug/dev-bin/gen-config =================================================================== --- branches/rug/dev-bin/gen-config 2007-01-23 19:13:24 UTC (rev 964) +++ branches/rug/dev-bin/gen-config 2007-01-23 20:37:18 UTC (rev 965) @@ -381,7 +381,6 @@ redirect_to_ssl => -f "$confd/redirect-to-ssl", module_dir => get_build_setting( 'apache2-moduledir' ), nlw_config_file => File::Spec->catfile( $dirs{socialtext_etc}, 'socialtext.conf' ), - app_prefix => $app_prefix, log_prefix => 'nlw', ports => _proxy_ports(), nlw_server_aliases => [], @@ -483,7 +482,6 @@ ), module_dir => get_build_setting( $webapi eq 'mod_perl1' ? 'apache-perl-moduledir' : 'apache2-moduledir' ), nlw_config_file => File::Spec->catfile( $dirs{socialtext_etc}, 'socialtext.conf' ), - app_prefix => $app_prefix, log_prefix => 'nlw', servers => { min_spare => 10, @@ -572,6 +570,7 @@ apache_status => $opts{'apache-status'}, server_admin => get_build_setting( 'server-admin' ), webapi => get_build_setting( 'webapi' ), + app_prefix => $app_prefix, ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 19:13:45
|
Revision: 964 http://svn.sourceforge.net/socialtext/?rev=964&view=rev Author: petdance Date: 2007-01-23 11:13:24 -0800 (Tue, 23 Jan 2007) Log Message: ----------- mod_perl2 does not allow <Perl> blocks inside <Location> handlers Modified Paths: -------------- branches/rug/build/templates/apache-perl/nlw.tt2 Modified: branches/rug/build/templates/apache-perl/nlw.tt2 =================================================================== --- branches/rug/build/templates/apache-perl/nlw.tt2 2007-01-23 19:11:08 UTC (rev 963) +++ branches/rug/build/templates/apache-perl/nlw.tt2 2007-01-23 19:13:24 UTC (rev 964) @@ -37,6 +37,10 @@ [% END %] [% IF config.apache_status %] + # Optionally load B::TerseSize for Apache::Status to use + <Perl> + eval { require B::TerseSize }; + </Perl> # Status handlers <Location /status> SetHandler server-status @@ -45,15 +49,12 @@ Allow from [% config.apache_status %] </Location> <Location /perl-status> - <Perl> - eval { require B::TerseSize }; - </Perl> SetHandler perl-script [% IF config.webapi == 'mod_perl1' %] PerlHandler +Apache::Status [% END %] [% IF config.webapi == 'mod_perl2' %] - PerlHandler +Apache2::Status + PerlResponseHandler +Apache2::Status [% END %] PerlSetVar StatusOptionsAll On PerlSetVar StatusTerseSizeMainSummary On This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 19:11:09
|
Revision: 963 http://svn.sourceforge.net/socialtext/?rev=963&view=rev Author: petdance Date: 2007-01-23 11:11:08 -0800 (Tue, 23 Jan 2007) Log Message: ----------- actually import the imports we want Modified Paths: -------------- branches/rug/lib/Socialtext/Rug/Constants.pm Modified: branches/rug/lib/Socialtext/Rug/Constants.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/Constants.pm 2007-01-23 18:53:40 UTC (rev 962) +++ branches/rug/lib/Socialtext/Rug/Constants.pm 2007-01-23 19:11:08 UTC (rev 963) @@ -32,7 +32,7 @@ $_ = ':http' if $_ eq ':response'; } - eval "package $caller; use Apache2::Const '-compile' => qw( @imports )"; + eval "package $caller; use Apache2::Const qw( @imports )"; die $@ if $@; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 18:53:43
|
Revision: 962 http://svn.sourceforge.net/socialtext/?rev=962&view=rev Author: petdance Date: 2007-01-23 10:53:40 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Use Apache2::Cookie for our mod_perl2 cookies Modified Paths: -------------- branches/rug/build/deps/mod_perl2.yaml branches/rug/lib/Socialtext/Rug/Cookie.pm Modified: branches/rug/build/deps/mod_perl2.yaml =================================================================== --- branches/rug/build/deps/mod_perl2.yaml 2007-01-23 18:31:43 UTC (rev 961) +++ branches/rug/build/deps/mod_perl2.yaml 2007-01-23 18:53:40 UTC (rev 962) @@ -12,3 +12,4 @@ mod_perl2: 2.0 # Not used, but force a version number #MasonX::WebApp: 0.12 # First version compatible with mod_perl2 MasonX::WebApp: 0.1101 # My faked-up version until Dave releases his +Apache2::Cookie: 0 Modified: branches/rug/lib/Socialtext/Rug/Cookie.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/Cookie.pm 2007-01-23 18:31:43 UTC (rev 961) +++ branches/rug/lib/Socialtext/Rug/Cookie.pm 2007-01-23 18:53:40 UTC (rev 962) @@ -13,9 +13,8 @@ use warnings; use Socialtext::Rug; -use vars qw( $CookieClass ); +our $CookieClass; - BEGIN: { my $api = Socialtext::Rug->webapi; if ( $api eq 'mod_perl1' ) { @@ -23,7 +22,7 @@ $CookieClass = 'Apache::Cookie'; } elsif ( $api eq 'mod_perl2' ) { - require Apache::Cookie; + require Apache2::Cookie; $CookieClass = 'Apache2::Cookie'; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-23 18:31:49
|
Revision: 961 http://svn.sourceforge.net/socialtext/?rev=961&view=rev Author: petdance Date: 2007-01-23 10:31:43 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Added get_uid_gid() to Socialtext::Build Modified Paths: -------------- branches/rug/lib/Socialtext/Build.pm branches/rug/lib/Socialtext/Handler.pm branches/rug/lib/Socialtext/ModPerl.pm branches/rug/lib/Socialtext/Rug/Constants.pm Modified: branches/rug/lib/Socialtext/Build.pm =================================================================== --- branches/rug/lib/Socialtext/Build.pm 2007-01-22 21:06:27 UTC (rev 960) +++ branches/rug/lib/Socialtext/Build.pm 2007-01-23 18:31:43 UTC (rev 961) @@ -1,13 +1,23 @@ +package Socialtext::Build; # @COPYRIGHT@ -package Socialtext::Build; +=head1 NAME + +Socialtext::Build + +=head1 SUMMARY + +This module provides build-time settings as passed to F<./configure>. + +=cut + use strict; use warnings; use base 'Exporter'; use File::Spec; use File::Basename qw(dirname); -our @EXPORT_OK = qw(get_build_setting get_prefixed_dir); +our @EXPORT_OK = qw( get_build_setting get_prefixed_dir get_uid_gid ); our %Settings; eval { @@ -17,11 +27,25 @@ }; _load_defaults() if keys(%Settings) == 0; +=head1 FUNCTIONS + +=head2 get_build_setting + +Returns one of the settings specified in ./configure. + +=cut + sub get_build_setting { - my $key = shift || ''; + my $key = shift or return; return $Settings{$key}; } +=head2 get_prefixed_dir( $key ) + +Returns a path-related setting prefixed with the I<prefix> key. + +=cut + sub get_prefixed_dir { my $key = shift; return File::Spec->catdir( @@ -30,6 +54,21 @@ ); } +=head2 get_uid_gid() + +Returns a two-element list with the UID and GID specified by the st-user +and st-group settings. + +=cut + +sub get_uid_gid() { + my $user = get_build_setting( 'st-user' ) or die "Can't find st-user setting"; + my $group = get_build_setting( 'st-group' ) or die "Can't find st-group setting"; + + return ( scalar getpwnam( $user ), scalar getgrnam( $group ) ); +} + + sub _load_defaults { my $defaults_pl = _defaults_pl(); if ($defaults_pl) { @@ -56,17 +95,3 @@ } 1; - -__END__ - -=pod - -=head1 NAME - -Socialtext::Build - -=head1 SUMMARY - -This module provides build-time settings as passed to F<./configure>. - -=cut Modified: branches/rug/lib/Socialtext/Handler.pm =================================================================== --- branches/rug/lib/Socialtext/Handler.pm 2007-01-22 21:06:27 UTC (rev 960) +++ branches/rug/lib/Socialtext/Handler.pm 2007-01-23 18:31:43 UTC (rev 961) @@ -14,7 +14,8 @@ use Socialtext::RequestContext; use Socialtext::WebApp; use Socialtext::TT2::Renderer; -use Socialtext::User; +use Socialtext::User (); +use Socialtext::Build qw( get_uid_gid ); # provides a way to skip this when running tests _preload_templates() @@ -23,9 +24,7 @@ sub _preload_templates { my @files = Socialtext::TT2::Renderer->PreloadTemplates(); - my $server = Apache->server; - my $uid = $server->uid; - my $gid = $server->gid; + my ($uid,$gid) = get_uid_gid(); my $chown = sub { chown $uid, $gid, $File::Find::name Modified: branches/rug/lib/Socialtext/ModPerl.pm =================================================================== --- branches/rug/lib/Socialtext/ModPerl.pm 2007-01-22 21:06:27 UTC (rev 960) +++ branches/rug/lib/Socialtext/ModPerl.pm 2007-01-23 18:31:43 UTC (rev 961) @@ -6,7 +6,7 @@ use Carp (); use File::Path (); use Socialtext::AlzaboWrapper; -use Socialtext::Build qw( get_build_setting ); +use Socialtext::Build qw( get_uid_gid ); use Socialtext::Workspace; use Socialtext::File; @@ -26,8 +26,7 @@ File::Path::mkpath( $dir, 0, 0775 ) unless -d $dir; - my $uid = getpwnam( get_build_setting( 'st-user' ) or die "Can't find st-user setting" ); - my $gid = getgrnam( get_build_setting( 'st-group' ) or die "Cant' find st-group setting" ); + my ($uid,$gid) = get_uid_gid(); chown $uid, $gid, $dir, Socialtext::File::files_and_dirs_under($dir) or die "Cannot chown all files/dirs in $dir to $uid:$gid: $!"; } @@ -54,9 +53,9 @@ * Call C<< Socialtext::AlzaboWrapper->UseCache() >> -* Chowns all the files and dirs under C<< - Socialtext::Workspace->LogoRoot() >> to be owned by the Apache - server's uid/gid, so that the app can save and delete workspace - logos. +* Chowns all the files and dirs under +C<< Socialtext::Workspace->LogoRoot() >> to be owned by the Apache +server's uid/gid, so that the app can save and delete workspace +logos. =cut Modified: branches/rug/lib/Socialtext/Rug/Constants.pm =================================================================== --- branches/rug/lib/Socialtext/Rug/Constants.pm 2007-01-22 21:06:27 UTC (rev 960) +++ branches/rug/lib/Socialtext/Rug/Constants.pm 2007-01-23 18:31:43 UTC (rev 961) @@ -26,8 +26,13 @@ } elsif ( $api eq 'mod_perl2' ) { require Apache2::Const; + my @imports = @_; - eval "package $caller; use Apache2::Const '-compile' => qw( @_ )"; + for ( @imports ) { + $_ = ':http' if $_ eq ':response'; + } + + eval "package $caller; use Apache2::Const '-compile' => qw( @imports )"; die $@ if $@; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-22 21:06:32
|
Revision: 960 http://svn.sourceforge.net/socialtext/?rev=960&view=rev Author: petdance Date: 2007-01-22 13:06:27 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Use the build settings for user and group instead of from apache Modified Paths: -------------- branches/rug/lib/Socialtext/ModPerl.pm Modified: branches/rug/lib/Socialtext/ModPerl.pm =================================================================== --- branches/rug/lib/Socialtext/ModPerl.pm 2007-01-22 19:41:42 UTC (rev 959) +++ branches/rug/lib/Socialtext/ModPerl.pm 2007-01-22 21:06:27 UTC (rev 960) @@ -6,6 +6,7 @@ use Carp (); use File::Path (); use Socialtext::AlzaboWrapper; +use Socialtext::Build qw( get_build_setting ); use Socialtext::Workspace; use Socialtext::File; @@ -25,8 +26,8 @@ File::Path::mkpath( $dir, 0, 0775 ) unless -d $dir; - my $uid = Apache->server->uid; - my $gid = Apache->server->gid; + my $uid = getpwnam( get_build_setting( 'st-user' ) or die "Can't find st-user setting" ); + my $gid = getgrnam( get_build_setting( 'st-group' ) or die "Cant' find st-group setting" ); chown $uid, $gid, $dir, Socialtext::File::files_and_dirs_under($dir) or die "Cannot chown all files/dirs in $dir to $uid:$gid: $!"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pet...@us...> - 2007-01-22 19:42:11
|
Revision: 959 http://svn.sourceforge.net/socialtext/?rev=959&view=rev Author: petdance Date: 2007-01-22 11:41:42 -0800 (Mon, 22 Jan 2007) Log Message: ----------- This doesn't seem to use Apache at all, so don't include it Modified Paths: -------------- branches/rug/lib/Socialtext/Statistics.pm Modified: branches/rug/lib/Socialtext/Statistics.pm =================================================================== --- branches/rug/lib/Socialtext/Statistics.pm 2007-01-22 18:53:06 UTC (rev 958) +++ branches/rug/lib/Socialtext/Statistics.pm 2007-01-22 19:41:42 UTC (rev 959) @@ -1,5 +1,5 @@ -# @COPYRIGHT@ package Socialtext::Statistics; +# @COPYRIGHT@ use warnings; use strict; @@ -11,13 +11,6 @@ use Socialtext::AppConfig; use Readonly; -BEGIN { - if ($ENV{MOD_PERL}) { - require Apache; - import Apache (); - } -} - Readonly my $LOG_NAME => 'nlw-stats.log'; Readonly my $LOG_PATH => $ENV{APACHE_LOG_DIR} ? "$ENV{APACHE_LOG_DIR}/$LOG_NAME" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |