* Fri Oct 03 2025 Brian Read <brianr@koozali.org> 1.0-28.sme

- Add in UTF8 to ConfigDB open [SME: 13209]
This commit is contained in:
2025-10-03 15:33:04 +01:00
parent 367e4da9e8
commit a2c3f3cdb4
2 changed files with 12 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ use Mojo::Base 'Mojolicious::Controller';
use Locale::gettext; use Locale::gettext;
use SrvMngr::I18N; use SrvMngr::I18N;
use SrvMngr qw( theme_list init_session is_normal_password ); use SrvMngr qw( theme_list init_session is_normal_password );
use esmith::ConfigDB; use esmith::ConfigDB::UTF8;
use Net::IP; use Net::IP;
my $adb; my $adb;
my $cdb; my $cdb;
@@ -29,10 +29,10 @@ sub main {
my $c = shift; my $c = shift;
$c->app->log->info($c->log_req); $c->app->log->info($c->log_req);
my %wrg_datas = (); my %wrg_datas = ();
$wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard'); $wdb = esmith::ConfigDB::UTF8->open('wireguard') || esmith::ConfigDB::UTF8->create('wireguard');
my $title = $c->l('wrg_FORM_TITLE'); my $title = $c->l('wrg_FORM_TITLE');
$wrg_datas{'trt'} = 'LST'; $wrg_datas{'trt'} = 'LST';
$cdb = esmith::ConfigDB->open() || die "Couldn't open config DB\n"; $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config DB\n";
my $wg = $cdb->get('wg-quick@wg0'); my $wg = $cdb->get('wg-quick@wg0');
$wrg_datas{'wgpub'} = $wg->prop('public'); $wrg_datas{'wgpub'} = $wg->prop('public');
$wrg_datas{'wgip'} = $wg->prop('ip'); $wrg_datas{'wgip'} = $wg->prop('ip');
@@ -61,8 +61,8 @@ sub do_display {
my $title = $c->l('wrg_FORM_TITLE'); my $title = $c->l('wrg_FORM_TITLE');
my $modul = ''; my $modul = '';
$adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb"; $adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb";
$cdb = esmith::ConfigDB->open() || die "Couldn't open config DB\n"; $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config DB\n";
$wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard'); $wdb = esmith::ConfigDB::UTF8->open('wireguard') || esmith::ConfigDB::UTF8->create('wireguard');
#$ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n"; #$ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n";
$wrg_datas{'trt'} = $trt; $wrg_datas{'trt'} = $trt;
@@ -125,8 +125,8 @@ sub do_action {
my $result = ''; my $result = '';
my $res = ''; my $res = '';
$adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb"; $adb = esmith::AccountsDB->open() || die "Couldn't open accounts DB\ndb";
$cdb = esmith::ConfigDB->open() || die "Couldn't open config DB\n"; $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config DB\n";
$wdb = esmith::ConfigDB->open('wireguard') || esmith::ConfigDB->create('wireguard'); $wdb = esmith::ConfigDB::UTF8->open('wireguard') || esmith::ConfigDB::UTF8->create('wireguard');
$ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n"; $ndb = esmith::NetworksDB->open_ro || die "Error opening networks DB\n";
if ($trt eq 'QRC') { if ($trt eq 'QRC') {
@@ -216,7 +216,7 @@ sub do_action {
} }
#force reload as successfull (for Main) #force reload as successfull (for Main)
$wdb = esmith::ConfigDB->open('wireguard'); $wdb = esmith::ConfigDB::UTF8->open('wireguard');
my $message = "'Wireguard' update ($trt) DONE"; my $message = "'Wireguard' update ($trt) DONE";
$c->app->log->info($message); $c->app->log->info($message);
$c->flash(success => $result); $c->flash(success => $result);

View File

@@ -1,4 +1,4 @@
%define release 27 %define release 28
%define version 1.0 %define version 1.0
%define debug_package %{nil} %define debug_package %{nil}
@@ -57,6 +57,9 @@ cat %{name}-%{version}-filelist
%changelog %changelog
* Fri Oct 03 2025 Brian Read <brianr@koozali.org> 1.0-28.sme
- Add in UTF8 to ConfigDB open [SME: 13209]
* Fri Oct 03 2025 Brian Read <brianr@koozali.org> 1.0-27.sme * Fri Oct 03 2025 Brian Read <brianr@koozali.org> 1.0-27.sme
- Remove smanager-refresh from spec file [SME: 13212] - Remove smanager-refresh from spec file [SME: 13212]