From: Will Budic Date: Wed, 26 Feb 2020 10:51:26 +0000 (+1100) Subject: upd. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=ac88bee94fe159c644e75861707fd16e00c98cd8;p=LifeLog.git upd. --- diff --git a/Current Development Check List.md b/Current Development Check List.md index 28d5e14..8682969 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -58,6 +58,11 @@ This version is not compatible in data structure to prior versions. Data migrati ## Planned New Possible Features of Minor Relevance +* Plugin subpages. + * Configured in main.cnf + * Appear on menu or as dropdouwn in the header. + * Downloaded/Configurated from the configuration page. +* View save feature. Where you name and save to config or session a dropdown of views. * Fit to page log. Making log subpage scrollable rather than whole page to see the bottom. * Make session timeot sub pages aware via JSON. * Multiple category assignment table (set via hashtags and end of a post). diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index ca19915..d7d3131 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -65,6 +65,9 @@ my $csvp = $cgi->param('csv'); if($cgi->param('bck')){ &backup; } +elsif($cgi->param('data_bck')){ + &restore; +} elsif($cgi->param('data_cat')){ &importCatCSV; }elsif($cgi->param('data_log')){ @@ -389,7 +392,7 @@ print qq(
$bck_list

-
+   

CSV File Format

@@ -941,21 +944,48 @@ sub changeSystemSettings { sub backup { - my $ball = 'bck_'.$today->strftime('%Y%m%d%H%M%S_')."$dbname.osz"; - my $pipe = "tar czf - ".&Settings::logPath.'main.cnf' ."$database | openssl enc -k $pass:$userid -e -des-ede3-cfb -out ".Settings::logPath().$ball; - `$pipe`; + my $ball = 'bck__'.$today->strftime('%Y%m%d%H%M%S_')."$dbname.osz"; + my $pipe = "tar czf - ".&Settings::logPath.'main.cnf' ." $database | openssl enc -k $pass:$userid -e -des-ede3-cfb -pbkdf2 -out ".Settings::logPath().$ball; + my $rez = `$pipe`; + + print $cgi->header; + print $cgi->start_html; + + print $pipe; - print $cgi->header(-type=>"application/octet-stream", -attachment=>"$ball"); - select(STDOUT); $| = 1; #unbuffer STDOUT - binmode STDOUT; - open (TAR, '<', Settings::logPath().$ball); - print ; - close TAR; - #LifeLogException->throw("Backup feature currently under development! Serverside created files is -> $ball"); + + print $cgi->end_html; + exit; } +sub restore { + + my $hndl = $cgi->upload("data_bck"); + my $pipe; + try{ + + + print $cgi->header; + print $cgi->start_html; + + + my $pipe; + open ($pipe, "| openssl enc -k $pass:$userid -d -des-ede3-cfb -pbkdf2 -in /dev/stdin 2>/dev/null | tar zt");#1>/dev/null"); + while(<$hndl>){print $pipe $_;}; + close $pipe; + + print $cgi->end_html; + exit; + + + } + catch{ + LifeLogException->throw(error=>"Restore failed! hndl->$hndl",show_trace=>&Settings::debug); + }; + +} sub exportToCSV { try{