From: Will Budicm Date: Fri, 22 May 2020 21:10:30 +0000 (+1000) Subject: Started work on COMPRESS_ENC option. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=231ab2423a35b1ad7689e97b1827dc017c7086fb;p=LifeLog.git Started work on COMPRESS_ENC option. --- diff --git a/Current Development Check List.md b/Current Development Check List.md index ff3ea4f..aec8302 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -8,6 +8,7 @@ This version is not compatible in data structure to prior versions. Data migrati ### v.2.0 SUN STABLE Encountered +* Implement gzip http page encoding compression of traffic. * Multiple search views and their settings, should be preserved as last preset. Maybe even have name multiple ones in a dropdown. * ✔ Autocompletion picks up long false words, in html and code type messages. diff --git a/Installation.txt b/Installation.txt index 4244fe1..7092829 100644 --- a/Installation.txt +++ b/Installation.txt @@ -126,7 +126,8 @@ sudo cpan Number/Bytes/Human.pm; sudo cpan Regexp::Common; sudo cpan JSON; sudo cpan Switch; -sudo cpan install IPC::Run +sudo cpan IPC::Run +sudo cpan Gzip::Faster; #Install DBI module sudo cpan DBI; diff --git a/dbLifeLog/main.cnf b/dbLifeLog/main.cnf index 1cbc59b..36d0f23 100644 --- a/dbLifeLog/main.cnf +++ b/dbLifeLog/main.cnf @@ -26,6 +26,7 @@ Credential format:< , dont enable here using AUT 32|$KEEP_EXCS = 0`Cache excludes between sessions, off (default) or on. 34|$VIEW_ALL_LMT=1000`Limit of all records displayed for large logs. Set to 0, for unlimited. 36|$TRACK_LOGINS=1`Create system logs on login/logout of Life Log. +38|$COMPRESS_ENC=0`Compress Encode pages, default -> 0=false, 1=true. < 01|Unspecified `For quick uncategorised entries. 03|File System `Operating file system/Application short log. diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index 50db9e7..8aea9e7 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # # Programed by: Will Budic # Open Source License -> https://choosealicense.com/licenses/isc/ @@ -280,6 +280,19 @@ while(my @row = $dbs->fetchrow_array()) { $d); next; } + elsif($n eq "COMPRESS_ENC"){ + my($l,$u)=("",""); + if($v == 0){ + $l = "SELECTED" + } + else{ + $u = "SELECTED" + } + $v = qq(); + } elsif(!defined(Settings::anon($n))){ #change into settable field to us found here unknown and not anon. $v = ''; } diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index ba61121..7d3ccb1 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -23,6 +23,7 @@ use Time::localtime; use Regexp::Common qw /URI/; use List::MoreUtils qw(uniq); +use Gzip::Faster; #DEFAULT SETTINGS HERE! use lib "system/modules"; diff --git a/htdocs/cgi-bin/system/modules/Settings.pm b/htdocs/cgi-bin/system/modules/Settings.pm index 4531f9f..3db425f 100644 --- a/htdocs/cgi-bin/system/modules/Settings.pm +++ b/htdocs/cgi-bin/system/modules/Settings.pm @@ -35,6 +35,7 @@ our $RTF_SIZE = 0; our $THEME = 'Standard'; our $TRACK_LOGINS = 1; our $KEEP_EXCS = 0; +our $COMPRESS_ENC = 0; #HTTP Compressed encoding. #Annons here, variables that could be overiden in code or database, per need. @@ -74,6 +75,7 @@ sub windowRTFSize {return $RTF_SIZE} sub keepExcludes {return $KEEP_EXCS} sub bgcol {return $BGCOL} sub css {return $TH_CSS} +sub compressPage {return $COMPRESS_ENC} sub debug {my $ret=shift; if($ret){$DEBUG = $ret;}; return $DEBUG;} sub createCONFIGStmt { @@ -160,6 +162,7 @@ sub getConfiguration { case "DEBUG" { $DEBUG = $r[2];} case "KEEP_EXCS" { $KEEP_EXCS = $r[2];} case "TRACK_LOGINS" { $TRACK_LOGINS = $r[2];} + case "COMPRESS_ENC" { $COMPRESS_ENC = $r[2];} else { $anons{$r[1]} = $r[2];} } }