barreljan / netlog

A Syslog-NG to MySQL parser with no-nonsense GUI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move config parameters to database

barreljan opened this issue · comments

In the config/config.php file, there are numerous settings that can be modified from the GUI and being a parameter from the database itself.

Settings like:
$default_view
$showlines_default
$showlines
$showlines_default

Eventually for the background processes:
$mail_from
$mail_rcpt

Perhaps the $debug bool?

And maybe more.

For the database self, a new table (innodb preferably) should be made with 2, maybe 3 colums (an ID column, just in case):

USE netlogconfig;
CREATE TABLE global (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
setting varchar(40) NOT NULL,
value varchar(40) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

However the id field makes it possible, possibly unwanted, to have duplicate entries. Something to think about.

the 'default_view' parameter needs to be an id (not string) that corresponds to the hosttype id.

First steps and changes made in branch config_to_db