1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
6 %# <sales@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 %# 02110-1301 or visit their web page on the internet at
27 %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
30 %# CONTRIBUTION SUBMISSION POLICY:
32 %# (The following paragraph is not intended to limit the rights granted
33 %# to you to modify and distribute this software under the terms of
34 %# the GNU General Public License and is only of importance to you if
35 %# you choose to contribute your changes and enhancements to the
36 %# community by submitting them to Best Practical Solutions, LLC.)
38 %# By intentionally submitting any modifications, corrections or
39 %# derivatives to this work, or any other work intended for use with
40 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 %# you are the copyright holder for those contributions and you grant
42 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43 %# royalty-free, perpetual, license to use, copy, create derivative
44 %# works based on those contributions, and sublicense and distribute
45 %# those contributions and any derivatives thereof.
47 %# END BPS TAGGED BLOCK }}}
49 require Module::Versions::Report;
50 my $title = loc('System Configuration');
51 unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
52 Abort(loc('This feature is only available to system administrators'));
55 <& /Admin/Elements/Header, Title => $title &>
58 <&|/Widgets/TitleBox, title => loc("RT Configuration") &>
59 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
60 <tr class="collection-as-table">
61 <th class="collection-as-table"><&|/l&>Option</&></th>
62 <th class="collection-as-table"><&|/l&>Value</&></th>
63 <th class="collection-as-table"><&|/l&>Source</&></th>
67 foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
68 my $val = RT->Config->GetObfuscated( $key, $session{'CurrentUser'} );
69 next unless defined $val;
71 my $meta = RT->Config->Meta( $key );
73 if ( $meta->{'Source'}{'Extension'} && $meta->{'Source'}{'SiteConfig'} ) {
74 $description = loc("[_1] site config", $meta->{'Source'}{'Extension'});
76 elsif ( $meta->{'Source'}{'Extension'} ) {
77 $description = loc("[_1] core config", $meta->{'Source'}{'Extension'});
79 elsif ( $meta->{'Source'}{'SiteConfig'} ) {
80 $description = loc("site config");
83 $description = loc("core config");
87 <tr class="<% $index_conf%2 ? 'oddline' : 'evenline'%>">
88 <td class="collection-as-table"><% $key %></td>
89 <td class="collection-as-table">
90 % if ( $key =~ /Password/i and $key !~ /MinimumPasswordLength|AllowLoginPasswordAutoComplete/ ) {
91 <em><% loc('Password not printed' ) %></em>\
93 <% stringify($val) |n %>\
96 <td class="collection-as-table" style="white-space: nowrap">
97 % if ( $meta->{'Source'}{'SiteConfig'} ) {
98 <span style="font-weight: bold"><% $description %></span>
109 <td valign="top" width="60%" class="boxcontainer">
110 <&|/Widgets/TitleBox, title=> loc("RT core variables") &>
111 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
112 <tr class="collection-as-table">
113 <th class="collection-as-table"><&|/l&>Variable</&></th>
114 <th class="collection-as-table"><&|/l&>Value</&></th>
117 { no strict qw/refs/;
118 my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef );
120 foreach my $key ( sort keys %{*RT::} ) {
121 next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
124 <tr class="collection-as-table <% $index_var%2 ? 'oddline' : 'evenline'%>">
125 <td class="collection-as-table">RT::<% $key %></td>
126 <td class="collection-as-table">
127 % if ( $key =~ /Password(?!Length)/i ) {
128 <em><% loc('Password not printed' ) %></em>\
139 <&|/Widgets/TitleBox, title => loc("RT Size") &>
140 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
141 <tr class="collection-as-table">
142 <th class="collection-as-table"><&|/l&>Object</&></th>
143 <th class="collection-as-table"><&|/l&>Size</&></th>
146 my ($index_size, $user_count, $privileged_count);
147 for my $type (qw/Tickets Queues Transactions Groups PrivilegedUsers UnprivilegedUsers/) {
149 my $class = 'RT::' . $type;
150 $class =~ s/Privileged|Unprivileged//;
151 my $collection = $class->new(RT->SystemUser);
152 $collection->UnLimit;
153 $collection->FindAllRows; # find disabled
154 if ($type =~ /PrivilegedUsers/) {
155 $user_count = $collection->CountAll;
156 $collection->LimitToPrivileged;
157 $count = $privileged_count = $collection->CountAll;
158 } elsif ($type =~ /UnprivilegedUsers/) {
159 $count = $user_count - $privileged_count;
161 $count = $collection->CountAll;
165 <tr class="<% $index_size%2 ? 'oddline' : 'evenline'%>">
166 <td class="collection-as-table"><% $type %></td>
167 <td class="collection-as-table"><% $count %></td>
173 <td valign="top" class="boxcontainer">
175 <&|/Widgets/TitleBox, title => loc("Mason template search order") &>
177 % foreach my $path ( RT::Interface::Web->ComponentRoots ) {
183 <&|/Widgets/TitleBox, title => loc("Static file search order") &>
185 % foreach my $path ( (map {$_->{root}} RT->Config->Get('StaticRoots')),
186 % RT::Interface::Web->StaticRoots ) {
192 <&|/Widgets/TitleBox, title => loc("Perl library search order") &>
194 % foreach my $inc (@INC) {
200 <&|/Widgets/TitleBox, title=> loc("Loaded config files") &>
202 % foreach my $config (RT->Config->LoadedConfigs) {
203 % if ($config->{site}) {
204 <li><strong><% $config->{filename} %></strong></li>
206 <li><% $config->{filename} %></li>
212 <&|/Widgets/TitleBox, title=> loc("Logging summary") &>
213 <& /Admin/Elements/LoggingSummary &>
219 <&|/Widgets/TitleBox, title => loc("Global Attributes") &>
220 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
221 <tr class="collection-as-table">
222 <th class="collection-as-table"><&|/l&>Name</&></th>
223 <th class="collection-as-table"><&|/l&>Value</&></th>
225 % my $attrs = $RT::System->Attributes;
226 % my $index_size = 0;
227 % while ( my $attr = $attrs->Next ) {
228 % next if $attr->Name eq 'UpgradeHistory';
229 <tr class="<% $index_size%2 ? 'oddline' : 'evenline'%>">
230 % if ($attr->Name eq 'UserLogo') {
231 % my $content = $attr->Content;
232 % $content->{data} = defined $content->{data} ? 'DATA' : 'undef'
233 % if exists $content->{data};
234 <td><% $attr->Name %></td><td><% stringify($content) |n %></td>
236 <td><% $attr->Name %></td><td><% stringify($attr->Content) |n %></td>
244 <&|/Widgets/TitleBox, title => loc("Loaded perl modules")&>
245 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
246 <tr class="collection-as-table">
247 <th class="collection-as-table"><&|/l&>Module</&></th>
248 <th class="collection-as-table"><&|/l&>Version</&></th>
249 <th class="collection-as-table"><&|/l&>Source</&></th>
254 my $report = Module::Versions::Report::report();
255 my @report = grep /v\d/, split("\n",$report);
256 shift @report; # throw away the perl version
257 my ($ver, $source, $distfile);
258 foreach my $item (@report) {
259 if ($item =~ /^\s*(.*?)\s*v(\S+);/) {
262 $distfile = $item.".pm";
263 $distfile =~ s|::|/|g;
266 <tr class="<% $i++ %2 ? 'oddline' : 'evenline'%>">
267 <td class="collection-as-table"><% $item %></td>
268 <td class="collection-as-table">
271 <td class="collection-as-table">
272 <% $INC{$distfile} || '' %>
279 <&|/Widgets/TitleBox, title => loc("RT upgrade history")&>
280 <& /Admin/Elements/UpgradeHistory &>
283 <&|/Widgets/TitleBox, title => loc("Perl configuration") &>
286 <% Config::myconfig() %>
290 <&|/Widgets/TitleBox, title=> loc("Environment variables") &>
291 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
292 <tr class="collection-as-table">
293 <th class="collection-as-table"><&|/l&>Variable</&></th>
294 <th class="collection-as-table"><&|/l&>Value</&></th>
297 % for my $key (sort keys %ENV) {
298 <tr class="collection-as-table <% $row++ %2 ? 'oddline' : 'evenline'%>">
299 <td class="collection-as-table"><% $key %></td>
300 <td class="collection-as-table"><% $ENV{$key} %></td>
306 <&|/Widgets/TitleBox, title => loc("Operating System") &>
307 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
308 <tr class="collection-as-table evenline">
309 <td class="collection-as-table">Deployment type</td>
310 <td class="collection-as-table"><%
311 $INC{'mod_perl.pm'} ? "mod_perl" :
312 $INC{'FCGI.pm'} ? "fastcgi" :
318 "Distribution" => 'lsb_release --all',
319 "uname -a" => 'uname -a',
320 "SELinux status" => 'getenforce',
321 "Apache" => [map { "$_ -V" } qw(apache2ctl apachectl httpdctl)],
322 "nginx" => 'nginx -V 2>&1',
323 "lighttpd" => 'lighttpd -V',
327 while (my ($name, $cmd) = splice @os, 0, 2) {
328 $cmd = [$cmd] unless ref $cmd eq 'ARRAY';
329 for my $run (@$cmd) {
330 $run .= " </dev/null";
331 $run .= " 2>/dev/null" unless $run =~ /2>/;
333 if (defined $result and $result =~ /\S/) {
334 push @os_info, $name => $result;
341 % while (my ($name, $output) = splice @os_info, 0, 2) {
342 <tr class="collection-as-table <% $row++ % 2 ? "oddline" : "evenline" %>">
343 <td class="collection-as-table"><% $name %></td>
344 <td class="collection-as-table" style="white-space: pre-wrap; font-family: monospace"><% $output %></td>
352 local $Data::Dumper::Terse = 1;
353 local $Data::Dumper::Indent = 2;
357 my $output = Dumper $value;
358 RT::Interface::Web::EscapeHTML(\$output);
359 $output =~ s/ / /g;
360 $output =~ s!\n!<br />!g;