* Thu Sep 25 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-2.sme
- CSP relaxed policy - revert authentication - httpd syntax fix - smanager improvement
This commit is contained in:
@@ -22,18 +22,16 @@ $ua->insecure(1);
|
||||
sub main {
|
||||
my $c = shift;
|
||||
my $title = $c->l('psi_phpsysinfo_panel');
|
||||
my $php_url = 'https://sme11.thereadclan.me.uk/phpsysinfo/index.php?disp=static';
|
||||
#my $first_line = q{<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' 'unsafe-eval' 'self'" />};
|
||||
#my $second_line = q{<meta name="Description" content="phpSysInfo is a customizable PHP script that displays information about your system nicely" />};
|
||||
my $host = $c->req->url->to_abs->host;
|
||||
my $php_url = "https://".$host."/phpsysinfo/index.php?disp=static";
|
||||
my $php_url2 = "https://".$host."/phpsysinfo/index.php?disp=bootstrap";
|
||||
$ua->get($php_url => sub {
|
||||
my ($ua, $tx) = @_;
|
||||
if ($tx->res->is_success) {
|
||||
my $php_content = $tx->res->body;
|
||||
my ($phpsysinfo_html) = $php_content =~ m{<body[^>]*>(.*?)</body>}si;
|
||||
$phpsysinfo_html =~ s/^( SME Server|<BR>Copyright \(c\)).*\n//gmi;
|
||||
# Insert $first_line before $second_line - supressing CSP
|
||||
#$phpsysinfo_html =~ s/(\Q$second_line\E)/$first_line\n$1/;
|
||||
$c->stash(title => $title, phpsysinfo => $phpsysinfo_html, php_url => $php_url);
|
||||
$c->stash(title => $title, phpsysinfo => $phpsysinfo_html, php_url => $php_url, php_url2 => $php_url2);
|
||||
$c->render(template => 'phpsysinfo');
|
||||
} else {
|
||||
my $code = $tx->res->code // 'No code';
|
||||
@@ -49,4 +47,4 @@ sub main {
|
||||
# $c->proxy_to('https://sme11.thereadclan.me.uk/phpsysinfo/index.php?disp=static');
|
||||
#}
|
||||
|
||||
1;
|
||||
1;
|
||||
|
@@ -15,10 +15,10 @@
|
||||
</div>
|
||||
%}
|
||||
|
||||
<%= link_to 'Visit External Website' => $c->stash('php_url'), target => '_blank', rel => 'noopener noreferrer' %>
|
||||
<%= link_to 'Visit External Website' => $c->stash('php_url2'), target => '_blank', rel => 'noopener noreferrer' %>
|
||||
|
||||
<h1>Legacy-<%=$c->l('psi_phpsysinfo') %></h1><br>
|
||||
|
||||
%== $c->stash('phpsysinfo');
|
||||
|
||||
%end
|
||||
%end
|
||||
|
Reference in New Issue
Block a user