* Sun Oct 05 2025 Brian Read <brianr@koozali.org> 0.2-21.sme
- Add UTF8 and avoid potential DB caching problems [SME: 13209]
This commit is contained in:
@@ -18,8 +18,8 @@ use SrvMngr::I18N;
|
|||||||
use SrvMngr qw(theme_list init_session ip_number_or_blank);
|
use SrvMngr qw(theme_list init_session ip_number_or_blank);
|
||||||
|
|
||||||
use Quota;
|
use Quota;
|
||||||
use esmith::ConfigDB;
|
use esmith::ConfigDB::UTF8;
|
||||||
use esmith::AccountsDB;
|
use esmith::AccountsDB::UTF8;
|
||||||
|
|
||||||
use esmith::util;
|
use esmith::util;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
@@ -28,23 +28,22 @@ use File::Path qw(make_path remove_tree);
|
|||||||
|
|
||||||
use esmith::Backup;
|
use esmith::Backup;
|
||||||
use esmith::BackupHistoryDB;
|
use esmith::BackupHistoryDB;
|
||||||
use esmith::util;
|
|
||||||
use esmith::lockfile;
|
use esmith::lockfile;
|
||||||
|
|
||||||
use constant DEBUG => $ENV{MOJO_SMANAGER_DEBUG} || 0;
|
use constant DEBUG => $ENV{MOJO_SMANAGER_DEBUG} || 0;
|
||||||
|
|
||||||
our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
|
my $cdb;
|
||||||
our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
|
my $adb;
|
||||||
|
|
||||||
sub main {
|
sub main {
|
||||||
|
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
$c->app->log->info($c->log_req);
|
$c->app->log->info($c->log_req);
|
||||||
|
|
||||||
#my $modul = get_backuppc( $c );
|
$cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
|
||||||
|
$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
|
||||||
|
|
||||||
my $url = "https://".$c->session->{'SystemName'}.".".$c->session->{"DomainName"}."/BackupPC";
|
my $url = "https://".$c->session->{'SystemName'}.".".$c->session->{"DomainName"}."/BackupPC";
|
||||||
#my $url = 'https://sme10.thereadclan.me.uk/BackupPC';
|
|
||||||
$c->stash(url => $url );
|
$c->stash(url => $url );
|
||||||
$c->render(template => 'backuppc');
|
$c->render(template => 'backuppc');
|
||||||
|
|
||||||
@@ -53,52 +52,24 @@ sub main {
|
|||||||
|
|
||||||
sub get_backuppc {
|
sub get_backuppc {
|
||||||
|
|
||||||
my ($c) = @_;
|
my ($c) = @_;
|
||||||
|
my $tx = $c->tx;
|
||||||
my $tx = $c->tx;
|
my $req = $tx->req;
|
||||||
my $req = $tx->req;
|
|
||||||
|
|
||||||
# 3 env variables for durep.cgi
|
|
||||||
#$ENV{'SCRIPT_NAME'} = 'durep';
|
|
||||||
#$ENV{'REQUEST_METHOD'} = $req->method;
|
|
||||||
#$ENV{'QUERY_STRING'} = $req->url->query->to_string;
|
|
||||||
|
|
||||||
my $res = `https:////sme10.thereadclan.me.uk//BackupPC`;
|
|
||||||
|
|
||||||
my $res = `/usr/share/BackupPC/sbin/BackupPC_Admin`; #
|
my $res = `/usr/share/BackupPC/sbin/BackupPC_Admin`; #
|
||||||
my $step = 0; my $out;
|
my $step = 0;
|
||||||
|
my $out;
|
||||||
my @lines = split /\n/, $res;
|
my @lines = split /\n/, $res;
|
||||||
# remove except 'body'
|
# remove except 'body'
|
||||||
foreach my $line (@lines) {
|
foreach my $line (@lines) {
|
||||||
if ( $line =~ m|<body>| ) {
|
if ( $line =~ m|<body>| ) {
|
||||||
$step = 1;
|
$step = 1;
|
||||||
} elsif ( $line =~ m|</body>| ) {
|
} elsif ( $line =~ m|</body>| ) {
|
||||||
$step = 2;
|
$step = 2;
|
||||||
} elsif ( $step == 1 ) {
|
} elsif ( $step == 1 ) {
|
||||||
$out .= $line;
|
$out .= $line;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sub main {
|
1;
|
||||||
|
|
||||||
# my $c = shift;
|
|
||||||
# $c->app->log->info($c->log_req);
|
|
||||||
|
|
||||||
# BEGIN
|
|
||||||
# {
|
|
||||||
# $ENV {'PATH'} = '/bin:/usr/bin:/sbin';
|
|
||||||
# $ENV {'SHELL'} = '/bin/bash';
|
|
||||||
# delete $ENV {'ENV'};
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
|
||||||
#$c = $c->redirect_to("https://".$ENV {'HTTP_X_FORWARDED_HOST'}."/BackupPC");
|
|
||||||
# $c = $c->redirect_to("https://sme10.thereadclan.me.uk//BackupPC");
|
|
||||||
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Name: smeserver-BackupPC
|
Name: smeserver-BackupPC
|
||||||
Version: 0.2
|
Version: 0.2
|
||||||
Release: 20%{?dist}
|
Release: 21%{?dist}
|
||||||
Summary: BackupPC integration into SME server
|
Summary: BackupPC integration into SME server
|
||||||
|
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
@@ -52,6 +52,9 @@ This package contains specific configuration for SME server
|
|||||||
#----------------------------------------------------
|
#----------------------------------------------------
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun Oct 05 2025 Brian Read <brianr@koozali.org> 0.2-21.sme
|
||||||
|
- Add UTF8 and avoid potential DB caching problems [SME: 13209]
|
||||||
|
|
||||||
* Wed Sep 24 2025 Jean-Philippe Pialasse <jpp@koozali.org> 0.2-20.sme
|
* Wed Sep 24 2025 Jean-Philippe Pialasse <jpp@koozali.org> 0.2-20.sme
|
||||||
- relaxed CSP
|
- relaxed CSP
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user