diff -urN smeserver-manager-0.1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/27SManagerProxyPass smeserver-manager-0.1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/27SManagerProxyPass --- smeserver-manager-0.1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/27SManagerProxyPass 2021-04-20 22:54:26.000000000 +0400 +++ smeserver-manager-0.1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/27SManagerProxyPass 2021-04-21 15:00:38.000000000 +0400 @@ -5,6 +5,7 @@ $plainTextAccess = ${'httpd-admin'}{PermitPlainTextAccess} || 'no'; $plainPort = ${'httpd-e-smith'}{TCPPort} || '80'; $adminPort2 = ${'smanager'}{TCPPort} || '982'; + $adminAccess = ${'smanager'}{access} || 'private'; $sslPort = ${modSSL}{TCPPort} || '443'; $OUT = ''; @@ -25,20 +26,21 @@ $OUT .= " ProxyPassReverse /$place http://127.0.0.1:$adminPort2\n"; $OUT .= " RequestHeader set X-Forwarded-Proto 'http'\n"; - $OUT .= " \n"; + $OUT .= " \n"; $OUT .= " order deny,allow\n"; $OUT .= " deny from all\n"; if ($port eq $plainPort) { $OUT .= ' allow from 127.0.0.1' . "\n"; } - elsif (($haveSSL eq 'yes') && (($port eq $sslPort) || ($plainTextAccess ne 'yes'))) + elsif (($haveSSL eq 'yes') && ($port eq $sslPort) && ($adminAccess eq 'public')) { - $OUT .= " allow from $localAccess $externalSSLAccess\n"; + # $OUT .= " allow from $localAccess $externalSSLAccess\n"; + $OUT .= "# access public in conf db\n"; + $OUT .= " allow from all\n"; } else { $OUT .= " allow from $localAccess\n"; } - - $OUT .= " \n"; + $OUT .= " \n"; } } diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Swttheme.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Swttheme.pm --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Swttheme.pm 2021-04-20 22:34:06.000000000 +0400 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Swttheme.pm 2021-04-22 21:55:58.896000000 +0400 @@ -39,6 +39,7 @@ or warn "$c->l('ERROR_UPDATING')"; } +## (not sure) $c->flash( warning => $c->l('swt_LOGIN_AGAIN') ); $from = '/initial' if $from eq '/'; $from = '/' . $from if ( $from !~ m|^\/| ); diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2021-04-20 22:54:26.000000000 +0400 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2021-04-22 21:03:52.000000000 +0400 @@ -133,6 +133,7 @@ 'FM_MAC_ADDRESS2' => 'The MAC address you provided was not valid.', 'FM_ERR_UNEXPECTED_DESC' => 'Error: unexpected or missing characters in description', swt_THEME => 'Theme', +swt_LOGIN_AGAIN => 'You may need to login again to see the choosed theme', acs_NO => 'Not Authorized', acs_LOGIN => 'Login required', acs_ADMIN => 'Admin rights required', 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 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm 2021-04-20 22:54:26.000000000 +0400 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm 2021-04-21 15:21:21.867000000 +0400 @@ -35,6 +35,9 @@ $datas{'SystemName'} = $cdb->get("SystemName")->value; $datas{'DomainName'} = $cdb->get("DomainName")->value; + my $rec = $cdb->get("smanager"); + $datas{'Access'} = $rec->prop('access') || 'private'; + return \%datas; } 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 --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr.pm 2021-04-20 23:54:41.000000000 +0400 +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr.pm 2021-04-22 20:57:41.000000000 +0400 @@ -23,7 +23,7 @@ use SrvMngr::Model::Main; -our $VERSION = '1.208'; +our $VERSION = '1.209'; $VERSION = eval $VERSION; use Exporter 'import'; @@ -201,6 +201,7 @@ my $c =shift; return $c->is_logged_in || $c->auth_fail($c->l("acs_LOGIN")); }); + $if_logged_in->post('/swttheme')->to('swttheme#main')->name('swttheme'); $if_logged_in->get('/review')->to('review#main')->name('review'); $if_logged_in->get('/logout')->to('logout#logout')->name('logout'); $if_logged_in->get('/userpassword')->to('userpassword#main')->name('passwd'); @@ -293,7 +294,6 @@ $if_admin->post('/remoteaccess')->to('remoteaccess#do_action')->name('remoteaccessact'); $if_admin->get('/support')->to('support#main')->name('support'); - $if_admin->post('/swttheme')->to('swttheme#main')->name('swttheme'); $if_admin->get('/useraccounts')->to('useraccounts#main')->name('useraccounts'); $if_admin->post('/useraccounts')->to('useraccounts#do_display')->name('useraccountadd'); @@ -389,6 +389,7 @@ $c->session->{Unsafe} = $datas{'Unsafe'}; $c->session->{SystemName} = $datas{'SystemName'}; $c->session->{DomainName} = $datas{'DomainName'}; + $c->session->{Access} = $datas{'Access'}; if ( not defined $c->session->{CurrentTheme} ) { $c->session->{CurrentTheme} = $c->config->{theme}; } diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2021-04-20 22:54:26.000000000 +0400 +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2021-04-22 20:55:36.000000000 +0400 @@ -22,7 +22,7 @@ % } diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep 2020-11-19 11:53:26.000000000 +0400 +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep 2021-04-22 20:53:42.000000000 +0400 @@ -8,4 +8,9 @@ Warning: a reconfigure and reboot is required before proceeding! Failure to do so now may leave your system in an unknown state! <% } %> - + <% if ( $c->session->{Access} eq 'public' && (($config->{debug} ne '0') || ($config->{mode} ne 'production')) ) { %> +
+ Warning: Development or debug mode enabled AND public access is offered ! +
+ <% } %> +