From 56f7175e7c27bb1731d4a7784838fb088b7c9d77 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Fri, 17 Nov 2023 12:06:20 +1100 Subject: [PATCH] Transfer of Latest dev to new server. --- AAA_TEST.txt | 1 + Installation_PostgreSQL.txt | 12 +- TestMindMap.blinkmind | 111 +++++ htdocs/cgi-bin/CNFServices.cgi | 56 ++- htdocs/cgi-bin/config.cgi | 2 +- htdocs/cgi-bin/contact.cnf | 37 ++ htdocs/cgi-bin/docs/EContactHashSpecs.md | 22 + htdocs/cgi-bin/index.cnf | 12 +- htdocs/cgi-bin/login_ctr.cgi | 1 + htdocs/cgi-bin/main.cgi | 4 +- htdocs/cgi-bin/static | 1 + htdocs/cgi-bin/system/modules/CNFDateTime.pm | 1 + htdocs/cgi-bin/system/modules/CNFMeta.pm | 108 +++-- htdocs/cgi-bin/system/modules/CNFParser.pm | 390 +++++++++------- htdocs/cgi-bin/system/modules/CNFSQL.pm | 441 ++++++++++++++++++ .../cgi-bin/system/modules/ContactsPlugin.pm | 161 +++++++ .../cgi-bin/system/modules/MarkdownPlugin.pm | 6 +- .../cgi-bin/system/modules/RSSFeedsPlugin.pm | 2 +- htdocs/cgi-bin/wsrc/feeds.js | 31 +- htdocs/cgi-bin/wsrc/main.css | 51 +- htdocs/test.html | 79 ++++ install_lifelog_req_modules_2.4.sh | 35 ++ tash clear | 218 +++++++++ 23 files changed, 1548 insertions(+), 234 deletions(-) create mode 100644 AAA_TEST.txt create mode 100644 TestMindMap.blinkmind create mode 100644 htdocs/cgi-bin/contact.cnf create mode 100644 htdocs/cgi-bin/docs/EContactHashSpecs.md create mode 120000 htdocs/cgi-bin/static create mode 100644 htdocs/cgi-bin/system/modules/CNFSQL.pm create mode 100644 htdocs/cgi-bin/system/modules/ContactsPlugin.pm create mode 100755 install_lifelog_req_modules_2.4.sh create mode 100644 tash clear diff --git a/AAA_TEST.txt b/AAA_TEST.txt new file mode 100644 index 0000000..08d196d --- /dev/null +++ b/AAA_TEST.txt @@ -0,0 +1 @@ +added to test mods to lifelog.hopto.org diff --git a/Installation_PostgreSQL.txt b/Installation_PostgreSQL.txt index 108991e..040d2cf 100644 --- a/Installation_PostgreSQL.txt +++ b/Installation_PostgreSQL.txt @@ -49,7 +49,7 @@ host all all {client-server-access-ip}/24 scram- sudo service postgresql restart -## Install required libpq-dev to compile test perl driver, later. +## Install required libpq-dev to compile test perl driver, later. sudo apt install libpq-dev ## Install perl driver. @@ -96,12 +96,18 @@ pg_dump --file "~/dev/LifeLog/dbLifeLog/bck-pg-$DB_NAME.sql" $DB_NAME # Restore with: psql $DB_NAME < "~/dev/LifeLog/dbLifeLog/bck-pg-$DB_NAME.sql" +or +pg_restore -U lifelog -d lifelog < lifelog.sql +20231102 - Note bin/psql can have different default port number from the one in server config, + it is a separate client utility to postgres, bad thing refusing you connections. + So -h and -p options might be needed if using host settings which are for TCP sockets + The local setting is for linux sockets in the pg_hba.config file. ############################### Important pgAdmin4 Notes ############################### -What pgAdmin4 and their documentation and installation doesn't describe, +What pgAdmin4 and their documentation and installation doesn't describe, that the default web server is python based. The web based package will install the apache web server. You most likely don't want that. And the pgAdmin-desktop, you possibly don't need that. (Can use any browser instead) :) @@ -127,7 +133,7 @@ NOTE: Configuring authentication for SERVER mode. Enter the email address and password to use for the initial pgAdmin user account: Email address: user@domain.com -Password: +Password: Retype password: Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your browser. * Serving Flask app "pgadmin" (lazy loading) diff --git a/TestMindMap.blinkmind b/TestMindMap.blinkmind new file mode 100644 index 0000000..4845c1f --- /dev/null +++ b/TestMindMap.blinkmind @@ -0,0 +1,111 @@ +{ + "rootTopicKey": "c787a1ac-6cf8-4a19-8533-2011cfd25526", + "editorRootTopicKey": "c787a1ac-6cf8-4a19-8533-2011cfd25526", + "focusKey": "8a10c048-9a7a-49f6-b241-96c8f659882a", + "extData": {}, + "topics": [ + { + "key": "c787a1ac-6cf8-4a19-8533-2011cfd25526", + "parentKey": null, + "subKeys": [ + "8a10c048-9a7a-49f6-b241-96c8f659882a", + "b604e11b-8a64-4596-b7a1-6b964d96f9da" + ], + "collapse": false, + "style": null, + "blocks": [ + { + "type": "CONTENT", + "data": "Sample" + } + ] + }, + { + "key": "8a10c048-9a7a-49f6-b241-96c8f659882a", + "parentKey": "c787a1ac-6cf8-4a19-8533-2011cfd25526", + "subKeys": [], + "collapse": false, + "style": null, + "blocks": [ + { + "type": "CONTENT", + "data": "Test Code" + } + ] + }, + { + "key": "b604e11b-8a64-4596-b7a1-6b964d96f9da", + "parentKey": "c787a1ac-6cf8-4a19-8533-2011cfd25526", + "subKeys": [], + "collapse": false, + "style": null, + "blocks": [ + { + "type": "CONTENT", + "data": "" + } + ] + } + ], + "config": { + "readOnly": false, + "allowUndo": true, + "layoutDir": 0, + "theme": { + "name": "default", + "randomColor": true, + "background": "rgb(57,60,65)", + "highlightColor": "#50C9CE", + "marginH": 60, + "marginV": 20, + "contentStyle": { + "lineHeight": "1.5" + }, + "linkStyle": { + "lineRadius": 5, + "lineType": "curve", + "lineWidth": "3px" + }, + "rootTopic": { + "contentStyle": { + "fontSize": "34px", + "borderRadius": "35px", + "padding": "16px 18px 16px 18px" + }, + "subLinkStyle": { + "lineType": "curve", + "lineWidth": "3px", + "lineColor": "rgb(113, 203, 45)" + } + }, + "primaryTopic": { + "contentStyle": { + "borderWidth": "1px", + "borderStyle": "solid", + "borderRadius": "20px", + "fontSize": "17px", + "padding": "10px 15px 10px 15px" + }, + "subLinkStyle": { + "lineType": "curve", + "lineWidth": "3px", + "lineColor": "rgb(113, 203, 45)" + } + }, + "normalTopic": { + "contentStyle": { + "border": "1px solid #e8eaec", + "borderRadius": "20px", + "fontSize": "17px", + "padding": "4px 10px" + }, + "subLinkStyle": { + "lineType": "curve", + "lineWidth": "3px", + "lineColor": "white" + } + } + } + }, + "formatVersion": null +} \ No newline at end of file diff --git a/htdocs/cgi-bin/CNFServices.cgi b/htdocs/cgi-bin/CNFServices.cgi index 651e8aa..03388ad 100755 --- a/htdocs/cgi-bin/CNFServices.cgi +++ b/htdocs/cgi-bin/CNFServices.cgi @@ -18,24 +18,22 @@ use feature qw(signatures); ## use CGI::Carp qw(fatalsToBrowser set_message); -## -# This is a entry point script (main). -## -use lib::relative "system/modules"; +use lib "/home/will/dev/LifeLog/htdocs/cgi-bin/system/modules"; +#use lib::relative "system/modules"; require CNFParser; require CNFNode; our $GLOB_HTML_SERVE = "'{}/*.cgi' '{}/*.htm' '{}/*.html' '{}/*.md' '{}/*.txt'"; our $script_path = $0; $script_path =~ s/\w+.cgi$//; -use constant LOG_Settings =>q( +use constant LOG_Settings => q( <<@<%LOG> file = web_server.log # Should it mirror to console too? console = 0 # Disable/enable output to file at all? - enabled = 0 + enabled = 1 # Tail size cut, set to 0 if no tail cutting is desired. - tail = 1000 + tail = 60 >> ); @@ -47,21 +45,27 @@ cgi { chomp $error; $cgi->render(text=>qq(You have unfortunately hit an cgi-bin::CNFHTMLServiceError
$error

- + ) ); } ); - exit CNFHTMLService($cgi); -}; + # my $p = $cgi->_body_params->{keyed}; + # $p->{'service'} = ['contacts']; + # $p->{'action'} = ['form']; + + ## + # This is a entry point script (main). + ## + exit CNFHTMLService($cgi); +}; -sub CNFHTMLService { - my ($cgi,$ptr) = (shift, undef); - my $cnf = CNFParser -> new (undef,{ DO_ENABLED => 1, HAS_EXTENSIONS=>1, ANONS_ARE_PUBLIC => 1, CGI=>$cgi }); - $cnf->parse(undef,_getServiceScript($cgi)); - $ptr = $cnf->data(); +sub CNFHTMLService($cgi) { + my $cnf = CNFParser -> new (undef,{ DO_ENABLED => 1, HAS_EXTENSIONS=>1, ANONS_ARE_PUBLIC => 1, CGI=>$cgi }); + $cnf -> parse(undef,_getServiceScript($cgi)); + my $ptr = $cnf->data(); $ptr = $ptr->{'PAGE'}; #say $$ptr if $ptr; $cgi -> render(text=>$$ptr); @@ -77,8 +81,30 @@ sub _getServiceScript($cgi) { if($service eq 'feeds'){ return _CNF_Script_For_Feeds(); } + elsif($service eq 'contacts'){ + return _CNF_Script_For_Contacts(); + } } +sub _CNF_Script_For_Contacts { +LOG_Settings . <<__CNF_IS_COOL__; +<<>> +< + + package : ContactsPlugin + subroutine : process + // The property holding the responce for the service. + property : ECHASH_CONTACT_RESPONSE + // The following maps in the CNF script the table and data properties for transfer/synch to the store. + // This shows how CNF can get complicated but also convenient to bind things in its scripts. + table : ECHASH_HOLDERS + data : CONTACTS_FORM_DATA + +>> +__CNF_IS_COOL__ +} + + sub _CNF_Script_For_Feeds { LOG_Settings . <<__CNF_IS_COOL__; < diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index 207f220..0564efd 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -75,7 +75,7 @@ if ($ERROR) { &error; } else { print qq(