[Rt-commit] rt branch, 4.0/sanity-check-url-config, updated. rt-3.9.7-1148-ga1f2fef
Shawn Moore
sartak at bestpractical.com
Thu Mar 3 16:54:20 EST 2011
The branch, 4.0/sanity-check-url-config has been updated
via a1f2fef4ffb0ae40efacc4cdb7c1ba8cee31cdad (commit)
from 07ee408ad96bd427ecb0bbcdade82ce7e3bb43d7 (commit)
Summary of changes:
lib/RT/Interface/Web.pm | 11 +++++++++--
sbin/rt-server.in | 10 ++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit a1f2fef4ffb0ae40efacc4cdb7c1ba8cee31cdad
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 3 16:53:52 2011 -0500
Cope with rt-server --port by putting rt.port into %ENV
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index fafd2e9..82c153f 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1013,8 +1013,15 @@ sub ValidateWebConfig {
return if $_has_validated_web_config;
$_has_validated_web_config = 1;
- if ($ENV{SERVER_PORT} != RT->Config->Get('WebPort')) {
- $RT::Logger->warn("The actual SERVER_PORT ($ENV{SERVER_PORT}) does NOT match the configured WebPort ($RT::WebPort). Perhaps you should Set(\$WebPort, $ENV{SERVER_PORT}) in RT_SiteConfig.pm, otherwise your internal links may be broken.");
+ if ($ENV{'rt.port'}) {
+ if ($ENV{SERVER_PORT} != $ENV{'rt.port'}) {
+ $RT::Logger->warn("The actual SERVER_PORT ($ENV{SERVER_PORT}) does NOT match the requested port ($ENV{'rt.port'}). Perhaps you should Set(\$WebPort, $ENV{SERVER_PORT}) in RT_SiteConfig.pm, otherwise your internal links may be broken.");
+ }
+ }
+ else {
+ if ($ENV{SERVER_PORT} != RT->Config->Get('WebPort')) {
+ $RT::Logger->warn("The actual SERVER_PORT ($ENV{SERVER_PORT}) does NOT match the configured WebPort ($RT::WebPort). Perhaps you should Set(\$WebPort, $ENV{SERVER_PORT}) in RT_SiteConfig.pm, otherwise your internal links may be broken.");
+ }
}
if ($ENV{HTTP_HOST}) {
diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index 8b19c22..7cd565c 100755
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -185,6 +185,16 @@ else {
push @args, '--port', $port;
}
+# inform the rest of the system what port we're using
+my $old_app = $app;
+$app = sub {
+ my $env = shift;
+
+ $env->{'rt.port'} = $port;
+
+ $old_app->($env, @_);
+};
+
push @args, '--server', 'Standalone' if RT->InstallMode;
push @args, '--server', 'Starlet' unless $r->{server} || grep { m/--server/ } @args;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list