/[smeserver]/rpms/e-smith-manager/sme9/e-smith-manager-2.6.0-bz10238-bugreport.patch
ViewVC logotype

Contents of /rpms/e-smith-manager/sme9/e-smith-manager-2.6.0-bz10238-bugreport.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Mon Apr 17 01:27:49 2017 UTC (7 years, 7 months ago) by unnilennium
Branch: MAIN
CVS Tags: e-smith-manager-2_6_0-21_el6_sme
Changes since 1.2: +6 -6 lines
* Sun Apr 16 2017 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-21.sme
- add a panel to ease reporting bugs [SME: 10238]
- Original work from Mats Schuh m.schuh@neckargeo.net

1 --- e-smith-manager-2.8.0/root/etc/e-smith/web/common/configuration_report.tmpl.ori 1969-12-31 19:00:00.000000000 -0500
2 +++ e-smith-manager-2.8.0/root/etc/e-smith/web/common/configuration_report.tmpl 2017-04-15 16:07:53.616770604 -0400
3 @@ -0,0 +1,52 @@
4 +Configuration report created {$report_creation_time}
5 +
6 +==================
7 +Base configuration
8 +==================
9 +
10 +SME server version: {$releaseversion}
11 +SME server mode: {$systemmode}
12 +Running Kernel: {$curkernel}
13 +
14 +
15 +===========================
16 +New RPMs not in base system
17 +===========================
18 +
19 +{ foreach $i (@newrpms) {
20 + $OUT .= "$i";
21 + }
22 +}
23 +
24 +
25 +
26 +===========================
27 +Custom and modified templates
28 +===========================
29 +{ foreach $i (@templates) {
30 + $OUT .= "$i";
31 + }
32 +}
33 +
34 +
35 +
36 +===========================
37 +Modified events
38 +===========================
39 +{ foreach $i (@events) {
40 + $OUT .= "$i";
41 + }
42 +}
43 +
44 +
45 +
46 +=======================
47 +Additional repositories
48 +=======================
49 +
50 +{ foreach $r (@repositories) {
51 + $OUT .= "$r";
52 + }
53 +}
54 +
55 +DONE!
56 --- e-smith-manager-2.8.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/bugreport.pm.ori 1969-12-31 19:00:00.000000000 -0500
57 +++ e-smith-manager-2.8.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/bugreport.pm 2017-04-16 17:12:17.077004028 -0400
58 @@ -0,0 +1,170 @@
59 +#!/usr/bin/perl -w
60 +package esmith::FormMagick::Panel::bugreport;
61 +
62 +use strict;
63 +use warnings;
64 +use esmith::ConfigDB;
65 +use esmith::FormMagick;
66 +use Text::Template;
67 +use File::Basename;
68 +
69 +our @ISA = qw(esmith::FormMagick Exporter);
70 +
71 +our @EXPORT = qw();
72 +
73 +our $VERSION = sprintf '%d.%03d', q$Revision: 1.2 $ =~ /: (\d+).(\d+)/;
74 +
75 +our $db = esmith::ConfigDB->open or die "Couldn't open ConfigDB\n";
76 +
77 +# Get some basic info on the current SME install
78 +our $sysconfig = $db->get('sysconfig');
79 +our $systemmode = $sysconfig->prop('PreviousSystemMode');
80 +our $releaseversion = $sysconfig->prop('ReleaseVersion');
81 +
82 +# Prepare some filehandles for templates and reports
83 +our $templatefile = '/tmp/bugreport_template.txt';
84 +our $configreportfile = '/tmp/configreport.txt';
85 +
86 +sub new {
87 + shift;
88 + my $self = esmith::FormMagick->new();
89 + $self->{calling_package} = (caller)[0];
90 + if (defined($self->cgi->param('action')) && $self->cgi->param('action') eq 'download_config_report') {
91 + download_config_report();
92 + return 0;
93 + }
94 + bless $self;
95 + return $self;
96 +}
97 +
98 +sub create_template
99 +{
100 + # TBD
101 +}
102 +
103 +sub display_page
104 +{
105 + my $self = shift;
106 + print "<tr><td colspan=\"2\"><p><p><b>". $self->localise('DO_NOT_PANIC') ."</b></p>\n";
107 + print "\t<p>". $self->localise('SME_EXPERIENCE') ."</p>\n";
108 + print "\t<p>". $self->localise('USE_TEMPLATE') .": <a href=\"https://wiki.koozali.org/Bugzilla_Help#Reporting_Bugs\" target=\"_blank\">https://wiki.koozali.org/Bugzilla_Help#Reporting_Bugs</a>. </p>\n";
109 + print "\t<p>". $self->localise('PLEASE_REPORT_HERE') .": <a href=\"https://bugs.koozali.org\" target=\"_blank\">https://bugs.koozali.org</a>.</p>";
110 + print "</p></td>";
111 + print "</tr>\n ";
112 + print "<tr><td colspan=\"2\"><p><p>". $self->localise('FOLLOWING_REPORT_MIGHT_HELP') ."</p>\n";
113 + print "\t<p>". $self->localise('REPORT_CONTENT') .":</p>\n";
114 + print "\t<ul>\n";
115 + print "\t\t<li>". $self->localise('SME_VERSION') ."</li>\n";
116 + print "\t\t<li>". $self->localise('SERVER_MODE') ."</li>\n";
117 + print "\t\t<li>". $self->localise('KERNEL_AND_ARCH') ."</li>\n";
118 + print "\t\t<li>". $self->localise('INSTALLED_RPMS') ."</li>\n";
119 + print "\t\t<li>". $self->localise('ALTERED_TEMPLATES') ."</li>\n";
120 + print "\t\t<li>". $self->localise('ALTERED_EVENTS') ."</li>\n";
121 + print "\t\t<li>". $self->localise('YUM_REPOS') ."</li>\n";
122 + print "</ul>\n";
123 + print "\t<p>". $self->localise('PRIVACY') ."</p>\n";
124 + print "</p></td>";
125 + print "</tr>\n";
126 + return '';
127 +}
128 +
129 +sub display_donation
130 +{
131 + my $self = shift;
132 + print "<tr><td colspan=\"2\"><p><p><b>". $self->localise('DONATING') ."</b></p>\n";
133 + print "\t<p>". $self->localise('AWARE_SME') ."</p>\n";
134 + print "\t<p><b>". $self->localise('YOUR_HELP') ."</b></p>\n";
135 + print "\t<p>". $self->localise('CONSIDER_DONATING') ."</p>\n";
136 + print '<p>
137 + <a href="https://wiki.koozali.org/Donate" target="_blank">
138 + <img src="/server-common/btn_donateCC_LG.gif" alt="https://wiki.koozali.org/Donate"
139 + align="middle"></a>
140 + </p>';
141 +
142 + print "\t<p>". $self->localise('THANK_YOU') ."</p>\n";
143 + print "</p></td>";
144 + print "</tr>\n ";
145 + return '';
146 +
147 +}
148 +
149 +
150 +sub create_configuration_report
151 +{
152 + my $fm = shift;
153 + my $q = $fm->{'cgi'};
154 +
155 + # TBD: possibly check $q for a boolean value eg. from a checkbox
156 + # indicating the user has read privacy warning etc.
157 +
158 + # create the reporting template
159 + my $configreport_template = Text::Template->new(TYPE => 'FILE', SOURCE => '/etc/e-smith/web/common/configuration_report.tmpl', UNTAINT => 1);
160 + my $report_creation_time = $fm->gen_locale_date_string;
161 +
162 + # curent kernel
163 + my $curkernel = `uname -r`;
164 +
165 + # get additional RPMs
166 + my @newrpms = `/sbin/e-smith/audittools/newrpms`;
167 +
168 + # get additional Repositories
169 + my @repositories = `/sbin/e-smith/audittools/repositories`;
170 + #print @repositories;
171 +
172 + # get templates
173 + my @templates = `/sbin/e-smith/audittools/templates`;
174 +
175 + # get events
176 + my @events = `/sbin/e-smith/audittools/events`;
177 +
178 +
179 + # set template variables
180 + my %vars = (report_creation_time => \$report_creation_time,
181 + releaseversion => \$releaseversion,
182 + curkernel => \$curkernel,
183 + systemmode => \$systemmode,
184 + newrpms => \@newrpms,
185 + templates => \@templates,
186 + events => \@events,
187 + repositories => \@repositories,
188 + );
189 +
190 + # prcess template
191 + my $result = $configreport_template->fill_in(HASH => \%vars);
192 +
193 + # write processed template to file
194 + open (my $cfgrep, '>', $configreportfile) or die "Could not create temporary file for config report!";
195 + print $cfgrep $result;
196 + close $cfgrep;
197 +}
198 +
199 +sub show_config_report {
200 + my $fm = shift;
201 + my $q = $fm->{'cgi'};
202 + print "<PRE>";
203 + open (my $cfgrep, '<', $configreportfile) or die "Could not find temporary config report file!";
204 + print while <$cfgrep>;
205 + close $cfgrep;
206 + print "</PRE>";
207 + # that would be too easy!?
208 + print "<a href=\"bugreport?action=download_config_report\">".$fm->localise('Download this report')."</a>";
209 + return "";
210 +
211 +
212 +}
213 +
214 +sub download_config_report {
215 + my $fm = shift;
216 + my $q = $fm->{'cgi'};
217 + open (DLFILE, "<$configreportfile") or die "Could not access temporary file for config report!";
218 + my @fileholder = <DLFILE>;
219 + close (DLFILE) || Error ('close', 'file');
220 + print "Content-Type:text/plain\n";#application/x-downloadn";
221 + print "Content-Disposition:attachment;filename=" . basename($configreportfile);
222 + print "\n\n";
223 + print @fileholder ;
224 + return "";
225 +
226 +}
227 +
228 +1;
229 --- e-smith-manager-2.8.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/bugreport.ori 1969-12-31 19:00:00.000000000 -0500
230 +++ e-smith-manager-2.8.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/bugreport 2017-04-16 17:10:19.933143945 -0400
231 @@ -0,0 +1,93 @@
232 +<lexicon lang="en-us">
233 +
234 + <entry>
235 + <base>FORM_TITLE</base>
236 + <trans>Report a Bug</trans>
237 + </entry>
238 + <entry>
239 + <base>DO_NOT_PANIC</base>
240 + <trans>Don't Panic!</trans>
241 + </entry>
242 + <entry>
243 + <base>SME_EXPERIENCE</base>
244 + <trans>Unfortunately there is no software without bugs, and you probably came to this page because of an issue you are experiencing with your SME-server installation.</trans>
245 + </entry>
246 + <entry>
247 + <base>PLEASE_REPORT_HERE</base>
248 + <trans>In order to help developers to diagnose and fix your issue, please download one of the following text templates, fill it out and paste it into your bug report at</trans>
249 + </entry>
250 + <entry>
251 + <base>USE_TEMPLATE</base>
252 + <trans>Please refer to the following link on how to report efficiency a bug and use its template</trans>
253 + </entry>
254 + <entry>
255 + <base>FOLLOWING_REPORT_MIGHT_HELP</base>
256 + <trans>It will also help if you provide some vital information on the configuration of your SME-server in your bug report. By clicking on the "Create configuration report" button below, you can create and download a text file containing this information. Please attach this file to your bug report as well.</trans>
257 + </entry>
258 + <entry>
259 + <base>REPORT_CONTENT</base>
260 + <trans>The report will contain the following information</trans>
261 + </entry>
262 + <entry>
263 + <base>SME_VERSION</base>
264 + <trans>Koozali SME Server version</trans>
265 + </entry>
266 + <entry>
267 + <base>SERVER_MODE</base>
268 + <trans>Server mode</trans>
269 + </entry>
270 + <entry>
271 + <base>KERNEL_AND_ARCH</base>
272 + <trans>Current running kernel version and architecture</trans>
273 + </entry>
274 + <entry>
275 + <base>INSTALLED_RPMS</base>
276 + <trans>A list of additional RPMs installed on your server</trans>
277 + </entry>
278 + <entry>
279 + <base>ALTERED_TEMPLATES</base>
280 + <trans>A list of SME templates that have been altered on your server from a base install</trans>
281 + </entry>
282 + <entry>
283 + <base>ALTERED_EVENTS</base>
284 + <trans>A list of SME events that have been altered on your server from a base install</trans>
285 + </entry>
286 + <entry>
287 + <base>YUM_REPOS</base>
288 + <trans>A list of additional software repositories configured on your server</trans>
289 + </entry>
290 + <entry>
291 + <base>PRIVACY</base>
292 + <trans>No privacy related data (ie. users, passwords, IP addresses) will be included in the report.</trans>
293 + </entry>
294 + <entry>
295 + <base>CREATE_REPORT</base>
296 + <trans>Create configuration report</trans>
297 + </entry>
298 +
299 + <entry>
300 + <base>DONATING</base>
301 + <trans>Have you considered donating?</trans>
302 + </entry>
303 + <entry>
304 + <base>AWARE_SME</base>
305 + <trans>You are probaly aware that SME server is developed and supported by a collaborative community of volunteers from all over the world. While SME server is free to download and use, maintaining the infrastructure behind the project (eg. hosting the forums and wiki, providing repositories and build servers etc.) costs real money in the real world.</trans>
306 + </entry>
307 + <entry>
308 + <base>YOUR_HELP</base>
309 + <trans>In very much the same way you need us to address your current issue, we need YOUR help to keep this project alive!</trans>
310 + </entry>
311 + <entry>
312 + <base>CONSIDER_DONATING</base>
313 + <trans>Please consider donating to the project by clicking on the image link below:</trans>
314 + </entry>
315 + <entry>
316 + <base>THANK_YOU</base>
317 + <trans>Thank you for your support!</trans>
318 + </entry>
319 + <entry>
320 + <base>Download this report</base>
321 + <trans>Download this report !</trans>
322 + </entry>
323 + <entry>
324 + <base>Report a bug</base>
325 + <trans>Report a bug</trans>
326 + </entry>
327 +
328 +</lexicon>
329 --- e-smith-manager-2.8.0.old/createlinks 2017-04-16 17:51:06.112000000 -0400
330 +++ e-smith-manager-2.8.0/createlinks 2017-04-16 17:54:11.417000000 -0400
331 @@ -4,6 +4,7 @@
332
333 panel_link("navigation", "manager");
334 panel_link("noframes", "manager");
335 +panel_link("bugreport", "manager");
336
337 event_link("navigation-conf", 'bootstrap-console-save', 50);
338
339 --- e-smith-manager-2.4.0/root/etc/e-smith/web/functions/bugreport.ori 1969-12-31 19:00:00.000000000 -0500
340 +++ e-smith-manager-2.4.0/root/etc/e-smith/web/functions/bugreport 2017-04-16 17:12:49.209966162 -0400
341 @@ -0,0 +1,59 @@
342 +#!/usr/bin/perl -wT
343 +
344 +#----------------------------------------------------------------------
345 +# heading : Miscellaneous
346 +# description : Report a bug
347 +# navigation : 7000 7300
348 +#
349 +# This program is free software; you can redistribute it and/or modify
350 +# it under the terms of the GNU General Public License as published by
351 +# the Free Software Foundation; either version 2 of the License, or
352 +# (at your option) any later version.
353 +#
354 +#----------------------------------------------------------------------
355 +
356 +use strict;
357 +use warnings;
358 +use esmith::TestUtils;
359 +use esmith::FormMagick::Panel::bugreport;
360 +
361 +my $f = esmith::FormMagick::Panel::bugreport->new();
362 +$f->display() if $f;
363 +
364 +=pod
365 +
366 +=head1 NAME
367 +
368 +bugreport -- report a bug
369 +
370 +=head2 DESCRIPTION
371 +
372 +This screen helps the administrator to submit helpful bug reports
373 +
374 +=begin testing
375 +
376 +=end testing
377 +
378 +=cut
379 +
380 +__DATA__
381 +<form
382 + title="FORM_TITLE"
383 + header="/etc/e-smith/web/common/head.tmpl"
384 + footer="/etc/e-smith/web/common/foot.tmpl">
385 +
386 + <page name="First" pre-event="print_status_message()"
387 + post-event="create_configuration_report">
388 +
389 + <subroutine src="display_page()"/>
390 +
391 + <subroutine src="print_button('CREATE_REPORT')" />
392 +
393 + <subroutine src="display_donation()"/>
394 + </page>
395 +
396 + <page name="ConfigReportPage" >
397 + <subroutine src="show_config_report()" />
398 +
399 + </page>
400 +</form>

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed