Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
25 stars 19 forks source link

Geeklog Database Administration Improvements Needed #1111

Closed eSilverStrike closed 2 years ago

eSilverStrike commented 2 years ago

There are several issues with the Geeklog Database Administration:

Config Option dbdump_tables_only

For Database Administration, is the config option "dbdump_tables_only" needed? Why would anyone want just the table structure and not the records as well? Also should this default to false on new installs?

Also this config option only seems to work for the non Ajax backup and the backup cron job. If ajax is used this config option is ignored. Ajax is only used if javascript is enabled (see the dbbackup.js script as it changes the action hidden input).

To test non ajax method you can just delete the javascript line from the dbbackup.thtml template file:

<script src="{site_url}/javascript/dbbackup.js"></script>

No Complete Messages for when action is complete

Also some sort of backup complete/not complete message would be nice for non ajax backup method (ajax method does have messages) once a backup is complete. Messages for other features like optimizing tables, etc. should also be checked.

Cron Job

The dbbackup.class.php contains a function called cron_backup(). This does a backup and then emails it to a recipient (found in deliver_backup function and set somehow????)

$recipient = $_VARS['_dbback_sendto'];

I was able to run the cron function but had to use the code like this which I just inserted in database.php as a test

$backup = new dbBackup(true); // set to true for cron backup job
$backup->getBackupFilename();
$backup->getTableList();    
$backup->cron_backup();

Anyways if we want the cron backup job (which I think is a good idea) we should include instructions on how to run it, how to pass the recipient email address, and how to make sure it is secure (for example if this code is in a file that is run by the cron job we don't want any old visitor to execute it).

mystralkk commented 2 years ago

I agree:

  1. that config Option dbdump_tables_only is not only useless but harmful
  2. that some sort of backup complete/not complete message would be desirable

About Cron Job, I am not sure if I can do something about it.

eSilverStrike commented 2 years ago

Just added this issue #1113 which is related to the cron portion of this issue.

It deals with cronjobs but has a bit more information on how to do it. It also has a file that needs to be run by the cron which is included with Geeklog. A similar file for the cron job to run should probably be added to Geeklog for the email backup file. Instructions for this also should be added somewhere...

eSilverStrike commented 2 years ago

Fixed

eSilverStrike commented 2 years ago

I saw that the dbdump_tables_only config option does display a warning on the backup page when enabled so I figured I might as well leave it.