/[smeserver]/rpms/smeserver-manager/sme10/smeserver-manager-0.1.2-update_systemd.patch
ViewVC logotype

Contents of /rpms/smeserver-manager/sme10/smeserver-manager-0.1.2-update_systemd.patch

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


Revision 1.1 - (show annotations) (download)
Sat Nov 21 08:43:53 2020 UTC (3 years, 11 months ago) by michel
Branch: MAIN
CVS Tags: smeserver-manager-0_1_2-11_el7_sme, smeserver-manager-0_1_2-8_el7_sme, smeserver-manager-0_1_2-10_el7_sme, smeserver-manager-0_1_2-13_el7_sme, smeserver-manager-0_1_2-3_el7_sme, smeserver-manager-0_1_2-6_el7_sme, smeserver-manager-0_1_2-5_el7_sme, smeserver-manager-0_1_2-7_el7_sme, smeserver-manager-0_1_2-2_el7_sme, smeserver-manager-0_1_2-12_el7_sme, smeserver-manager-0_1_2-9_el7_sme, smeserver-manager-0_1_2-4_el7_sme
* Fri Nov 20 2020 Michel Begue <mab974@gmail.com> 0.1.2-2.sme
- Fix smanager-update event name
- Move smanager service to /usr/lib/systemd
- Fix Bugreport file download
- Fix translations missing in 'viewlogfiles'
- Remove Admin auth in httpd configuration
- Add an optional alias for admin sign in.
- Remove systemctl from .spec file

1 diff -urN smeserver-manager-0.1.2.old/createlinks smeserver-manager-0.1.2/createlinks
2 --- smeserver-manager-0.1.2.old/createlinks 2020-11-19 11:53:26.000000000 +0400
3 +++ smeserver-manager-0.1.2/createlinks 2020-11-20 22:49:04.000000000 +0400
4 @@ -11,36 +11,35 @@
5 for ( qw( sme_core.css sme_main.css sme_menu.css styles.css ) )
6 {
7 templates2events("$mngrdir/themes/default/public/css/$_", qw(
8 - bootstrap-console-save smanager-update
9 + bootstrap-console-save smeserver-manager-update
10 ));
11 }
12
13 templates2events("$mngrdir/conf/srvmngr.conf",
14 - qw( smanager-update smanager-modify bootstrap-console-save ));
15 -
16 -templates2events("/etc/systemd/system/smanager.service",
17 - qw( smanager-update bootstrap-console-save ));
18 + qw( smeserver-manager-update smanager-modify bootstrap-console-save ));
19
20 templates2events("/etc/httpd/conf/httpd.conf",
21 - qw( smanager-update smanager-modify ));
22 + qw( smeserver-manager-update smanager-modify ));
23
24
25 # services to launch on event
26 -for my $event ( qw( smanager-update smanager-modify ) )
27 +for my $event ( qw( smeserver-manager-update smanager-modify ) )
28 {
29 safe_symlink("restart",
30 "root/etc/e-smith/events/$event/services2adjust/smanager");
31 safe_symlink("sigusr1",
32 - "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
33 + "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
34 }
35
36 safe_symlink("restart",
37 "root/etc/e-smith/events/smanager-refresh/services2adjust/smanager");
38
39 # actions to perform
40 -for my $event ( qw( smanager-update smanager-refresh bootstrap-console-save ) )
41 +for my $event ( qw( smeserver-manager-update smanager-refresh bootstrap-console-save ) )
42 {
43 event_link('navigation2-conf', "$event", '80');
44 event_link('routes2-conf', "$event", '80');
45 event_link('locales2-conf', "$event", '80');
46 }
47 +
48 +event_link('systemd-reload', "smeserver-manager-update", '85');
49 diff -urN smeserver-manager-0.1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86SmanagerAlias smeserver-manager-0.1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86SmanagerAlias
50 --- smeserver-manager-0.1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86SmanagerAlias 2020-11-19 11:53:26.000000000 +0400
51 +++ smeserver-manager-0.1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86SmanagerAlias 1970-01-01 04:00:00.000000000 +0400
52 @@ -1,13 +0,0 @@
53 -{
54 - $OUT = '';
55 - $OUT .= "<Location /smanager>\n";
56 -
57 - $OUT .= " AuthName 'SManager Admin'\n";
58 - $OUT .= " AuthBasicProvider external\n";
59 - $OUT .= " AuthType Basic\n";
60 - $OUT .= " AuthExternal pwauth\n";
61 - $OUT .= " require user admin\n";
62 - $OUT .= " Satisfy all\n";
63 -
64 - $OUT .= "</Location>\n";
65 -}
66 diff -urN smeserver-manager-0.1.2.old/root/etc/e-smith/templates/etc/systemd/system/smanager.service/10All smeserver-manager-0.1.2/root/etc/e-smith/templates/etc/systemd/system/smanager.service/10All
67 --- smeserver-manager-0.1.2.old/root/etc/e-smith/templates/etc/systemd/system/smanager.service/10All 2020-11-19 11:53:26.000000000 +0400
68 +++ smeserver-manager-0.1.2/root/etc/e-smith/templates/etc/systemd/system/smanager.service/10All 1970-01-01 04:00:00.000000000 +0400
69 @@ -1,24 +0,0 @@
70 -[Unit]
71 -Description=Server Manager 2 Mojo
72 -Requires=network.target
73 -##Requires= httpd.target slapd.target
74 -##After=network.target slapd.target
75 -
76 -[Service]
77 -Type=simple
78 -SyslogIdentifier=smanager
79 -WorkingDirectory=/usr/share/smanager/script
80 -PIDFile=/var/run/smanager.pid
81 -#EnvironmentFile=-/etc/sysconfig/smanager
82 -ExecStart=/usr/bin/hypnotoad srvmngr -f
83 -ExecStop=/usr/bin/hypnotoad -s srvmngr
84 -ExecReload=/usr/bin/hypnotoad srvmngr
85 -##ExecReload=reload-srvmngr.sh
86 -KillMode=process
87 -Restart=always
88 -RestartSec=5
89 -User=root
90 -Group=root
91 -
92 -[Install]
93 -WantedBy=multi-user.target
94 diff -urN smeserver-manager-0.1.2.old/root/usr/lib/systemd/system/smanager.service smeserver-manager-0.1.2/root/usr/lib/systemd/system/smanager.service
95 --- smeserver-manager-0.1.2.old/root/usr/lib/systemd/system/smanager.service 1970-01-01 04:00:00.000000000 +0400
96 +++ smeserver-manager-0.1.2/root/usr/lib/systemd/system/smanager.service 2020-11-21 00:46:19.258000000 +0400
97 @@ -0,0 +1,21 @@
98 +[Unit]
99 +Description=Server Manager 2 Mojo
100 +Requires=network.target
101 +# httpd.service slapd.service
102 +After=network.target
103 +# slapd.service
104 +
105 +[Service]
106 +Type=simple
107 +SyslogIdentifier=smanager
108 +WorkingDirectory=/usr/share/smanager/script
109 +PIDFile=/var/run/smanager.pid
110 +ExecStart=/usr/bin/hypnotoad srvmngr -f
111 +ExecStop=/usr/bin/hypnotoad -s srvmngr
112 +ExecReload=/usr/bin/hypnotoad srvmngr
113 +KillMode=process
114 +Restart=always
115 +RestartSec=5
116 +
117 +[Install]
118 +WantedBy=sme-server.target
119 diff -urN smeserver-manager-0.1.2.old/root/usr/lib/systemd/system-preset/80-koozali-smanager.preset smeserver-manager-0.1.2/root/usr/lib/systemd/system-preset/80-koozali-smanager.preset
120 --- smeserver-manager-0.1.2.old/root/usr/lib/systemd/system-preset/80-koozali-smanager.preset 1970-01-01 04:00:00.000000000 +0400
121 +++ smeserver-manager-0.1.2/root/usr/lib/systemd/system-preset/80-koozali-smanager.preset 2020-11-20 22:22:04.000000000 +0400
122 @@ -0,0 +1,2 @@
123 +enable smanager.service
124 +
125 diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Bugreport.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Bugreport.pm
126 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Bugreport.pm 2020-11-19 11:53:26.000000000 +0400
127 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Bugreport.pm 2020-11-21 00:03:31.041000000 +0400
128 @@ -19,10 +19,10 @@
129 use File::Basename;
130 use esmith::FormMagick qw( gen_locale_date_string );
131
132 -our $db = esmith::ConfigDB->open or die "Couldn't open ConfigDB\n";
133 +our $cdb = esmith::ConfigDB->open or die "Couldn't open ConfigDB\n";
134
135 # Get some basic info on the current SME install
136 -our $sysconfig = $db->get('sysconfig');
137 +our $sysconfig = $cdb->get('sysconfig');
138 our $systemmode = $sysconfig->prop('PreviousSystemMode');
139 our $releaseversion = $sysconfig->prop('ReleaseVersion');
140
141 @@ -73,22 +73,18 @@
142
143 my $modul = 'Bug report download';
144
145 - #download_config_report();
146 +# $c->render_file(
147 +# 'filepath' => "$configreportfile",
148 +# 'format' => 'x-download',
149 +# 'content_disposition' => 'attachment',
150 +# 'cleanup' => 1,
151 +# );
152
153 - # --> OR <--
154 - #if ( $params{'output_format'} eq 'txtfile' ) {
155 - $c->res->headers->content_disposition("attachement; filename=" . basename($configreportfile) . ";");
156 - #$c->res->headers->content_type('text/plain');
157 - $c->reply->file("$configreportfile");
158 - #} else {
159 - # $modul .= "\n output_format not compatible with report file";
160 - #}
161 -
162 # the following in this sub will not be used !!!
163 - $bugr_datas{'trt'} = 'DOWN';
164 +# $bugr_datas{'trt'} = 'DOWN';
165
166 - $c->stash(title => $title, modul => $modul, bugr_datas => \%bugr_datas);
167 - $c->render(template => 'bugreport');
168 +# $c->stash(title => $title, modul => $modul, bugr_datas => \%bugr_datas);
169 +# $c->render(template => 'bugreport');
170 }
171 };
172
173 @@ -141,6 +137,7 @@
174 close $cfgrep;
175 }
176
177 +
178 sub show_config_report {
179 my $c = shift;
180
181 @@ -159,24 +156,16 @@
182
183 }
184
185 -sub download_config_report {
186
187 +sub download_config_report {
188 my $c = shift;
189
190 - my $filesize =-s $configreportfile;
191 -
192 - open (DLFILE, "<$configreportfile") or die "Could not access temporary file for config report!";
193 - my @fileholder = <DLFILE>;
194 - close (DLFILE) || Error ('close', 'file');
195 -
196 - print "Content-Type:text/plain\n";#application/x-downloadn";
197 - print "Content-Disposition:attachment;filename=" . basename($configreportfile) . "\n";
198 - print "Content-Length:" . $filesize;
199 - print "\n\n";
200 - print @fileholder ;
201 -
202 - return "";
203 -
204 + $c->render_file(
205 + 'filepath' => "$configreportfile",
206 + 'format' => 'x-download',
207 + 'content_disposition' => 'attachment',
208 + 'cleanup' => 1,
209 + );
210 }
211
212
213 diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Login.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Login.pm
214 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Login.pm 2020-11-19 11:53:26.000000000 +0400
215 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Login.pm 2020-11-21 00:03:42.223000000 +0400
216 @@ -64,6 +64,18 @@
217 return $c->render('login');
218 }
219
220 +
221 + my $alias = SrvMngr::Model::Main->check_adminalias( $c );
222 + if ( $alias ) {
223 + if ( $name eq $alias ) {
224 + $name = 'admin';
225 + } elsif ( $name eq 'admin' ) {
226 + record_login_attempt($c, 'FAILED');
227 + $c->stash( error => $c->l('use_SORRY'), trt => 'NORM' );
228 + return $c->render('login');
229 + }
230 + }
231 +
232 if (SrvMngr::Model::Main->check_credentials($name, $pass)) {
233 $c->session(logged_in => 1); # set the logged_in flag
234 $c->session(username => $name); # keep a copy of the username
235 diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm
236 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm 2020-11-19 11:53:26.000000000 +0400
237 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm 2020-11-21 00:03:22.385000000 +0400
238 @@ -5,6 +5,7 @@
239 use utf8;
240
241 use esmith::ConfigDB;
242 +use esmith::AccountsDB;
243 use esmith::util;
244
245 use Net::LDAP qw/LDAP_INVALID_CREDENTIALS/;
246 @@ -70,5 +71,28 @@
247 }
248
249
250 +sub check_adminalias {
251 +
252 + # is an alias required for admin ? return it or undef
253 + my $c = shift;
254 +
255 + my $alias;
256 + my $cdb = esmith::ConfigDB->open_ro() or die("can't open Configuration DB");
257 + if (defined $cdb->get('AdminAlias')) {
258 + $alias = $cdb->get('AdminAlias')->value;
259 + }
260 + return undef unless $alias;
261 +
262 + my $adb = esmith::AccountsDB->open_ro() or die("can't open Accounts DB");
263 + my $arec = $adb->get( $alias );
264 + return undef unless $arec;
265 +
266 + # $alias pseudo exists AND points to admin AND is removable (not known pseudos) => OK
267 + return ( $arec && $arec->prop('type') eq 'pseudonym' && $arec->prop('Account') eq 'admin'
268 + && ($arec->prop('Removable') || 'yes') ne 'no' ) ? $alias : undef;
269 +
270 +}
271 +
272 +
273 1;
274
275 diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr.pm
276 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr.pm 2020-11-20 23:53:46.000000000 +0400
277 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr.pm 2020-11-21 00:03:09.872000000 +0400
278 @@ -23,7 +23,7 @@
279 use SrvMngr::Model::Main;
280
281
282 -our $VERSION = '1.201';
283 +our $VERSION = '1.202';
284 $VERSION = eval $VERSION;
285
286 use Exporter 'import';
287 @@ -154,6 +154,8 @@
288
289 $self->plugin('TagHelpers');
290
291 + $self->plugin('RenderFile');
292 +
293 # CSRF protec if production
294 # $self->plugin('Mojolicious::Plugin::CSRFDefender') if ( $self->mode eq 'production' );
295
296 @@ -294,7 +296,7 @@
297
298 $if_admin->get('/viewlogfiles')->to('viewlogfiles#main')->name('viewlogfiles');
299 $if_admin->post('/viewlogfiles')->to('viewlogfiles#do_action')->name('viewlogfiles2');
300 - $if_admin->get('/viewlogfileR')->to('viewlogfiles#do_action')->name('viewlogfileR');
301 + $if_admin->get('/viewlogfilesr')->to('viewlogfiles#do_action')->name('viewlogfilesr');
302
303 $if_admin->get('/yum')->to('yum#main')->name('yum');
304 $if_admin->post('/yum')->to('yum#do_display')->name('yumd1');
305 @@ -607,7 +609,7 @@
306 }
307
308 my $lang = ( $c->tx->req->headers->accept_language || ['en_US'] );
309 - $lang = split(/,/, $lang);
310 + $lang = (split(/,/, $lang))[0];
311 # my $lang = (split(/,/, $c->tx->req->headers->accept_language))[0];
312 ## convert xx_XX lang format to xx-xx + delete .UTFxx + lowercase
313 # $lang =~ s/_(.*)\..*$/-${1}/; # just keep 'en-us'
314 diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/partials/_footer.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/partials/_footer.html.ep
315 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/partials/_footer.html.ep 2020-11-19 11:53:26.000000000 +0400
316 +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/partials/_footer.html.ep 2020-11-21 00:02:08.503000000 +0400
317 @@ -3,6 +3,6 @@
318 <font class="sme-copyright">
319 SME Server <%= session 'releaseVersion' %> - Manager <%= $c->app->VERSION %> - <%= session 'lang' %>
320 <br>Copyright 1999-2006 Mitel Corporation<br>
321 -<%= session 'copyRight' %>
322 +%= session 'copyRight'
323 <br>Copyright (c) 2013-2016 Koozali Foundation Inc.<br>
324 </font>
325 diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/viewlogfiles2.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/viewlogfiles2.html.ep
326 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/viewlogfiles2.html.ep 2020-11-19 11:53:26.000000000 +0400
327 +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/viewlogfiles2.html.ep 2020-11-21 00:02:39.558000000 +0400
328 @@ -18,7 +18,7 @@
329 <p>
330 <% my $btn = l('log_REFRESH'); %>
331
332 - %= form_for 'viewlogfileR' => (method => 'GET') => begin
333 + %= form_for 'viewlogfilesr' => (method => 'GET') => begin
334 %= submit_button "$btn", class => 'action'
335 %= hidden_field 'trt' => $log_datas->{trt}
336 %= hidden_field 'Filename' => $log_datas->{filename}

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