Commit Graph

1527 Commits

Author SHA1 Message Date
Chris Johnson
dbca9cd4df Fixed typo on last two perl dependency packages 2017-10-19 11:47:57 -04:00
Digimer
286b145434 * Added a general purpose 'notes' file.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-19 11:30:07 -04:00
Digimer
eed06bdb22 * Created a dedicated loop for processes that need to run each time tools/scancore-daemon loops.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-18 11:27:57 -04:00
Digimer
886331c756 * Created the new System->get_ips method which records IP addresses, subnet masks and MAC addresses of interfaces as reported by 'ip addr'.
* Finished the form for showing the user what changes will be made.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-12 18:34:41 -04:00
Digimer
27fe291524 * Started work on config_step3.
* Reworked step 2 to allow for empty DNS and empty gateway fields.
* Step2 now loads previous answers from the database properly.
* Fixed (the lack of) recording each network's IP and subnet to the database.
* Added (and disabled for now) a jquery feature for clearing the variables from the URL to keep it from getting exceptionally long.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-11 01:20:03 -04:00
Digimer
8a2c97c6c5 * Added a check to determine if the defined gateway in config step 2 matches one of the network and throws and error if not.
* Record step2 answers into the database.
* Added back hidden for values in config step 2 that recorded step 1's answers.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-10 02:33:58 -04:00
Digimer
bb89254207 * Added an undocumented (does this count?) parameter 'log_level' to Database->insert_or_update_variables() to allow per-call logging levels.
* Created Validate->form_field() which makes it a little quicker/easier to sanity check a form field that uses one of the other Validate methods.
* Added Validate->is_mac to validate MAC addresses.
* Got config_step2 finishes and sanity checked.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-08 02:54:10 -04:00
Digimer
3d385a5731 * Updated the configuration step 2 to properly show interface link changes again (had to add the network status XML generator back), and added displaying the 'up order', which tells the order that interfaces last cycles. This allows a user to unplug and plug the network cables in without watching the screen and be able to determine which interfaces cycled in a given order. This makes it easier to map MAC addresses to desired roles.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-05 00:20:36 -04:00
Digimer
fa11459543 * Updated Log->entry to use the new Log::Journald method, which improved writing to log speed at high log levels dramatically (ie: 33 seconds -> 1 seconds).
* Started using Time::HiRes and recording the run time of programs using AN::Tools at log level 2.
* Added a check in tools/an-prep-database to write journald.conf.d/an.conf to disable rate limiting to allow high log levels without losing messages.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-04 02:11:03 -04:00
Digimer
1e7fe44c23 * Updated Get->host_uuid to record the UUID to a cache file when run with root privs, but read from the cache when an unpriv user.
* Added a start-check to make sure 'home' could read the host UUID and exit if not.
* Removed network_interface_current_name / network_interface_requested_name from the network_interfaces DB table and used simply network_interface_name.
* Added caching to Storage->read_file().
* Now record form answers in the variables table as 'form::<form_name>::<variable>::value' and read the same when the form is first loaded.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-27 03:24:27 -04:00
Digimer
96670756ab * Created Database->insert_or_update_network_interfaces to handle pushing data into update_network_interfaces.
* Updated Database->connect to always test if hosts table exists and load the core schema if not.
* Fixed Database->write to log all SQL when 'sys::database::log_transactions' is set.
* Got tools/scancore-update-states scanning and recording network interface data to the database. Also removed it writing out the XML status file.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-22 00:56:35 -04:00
Digimer
65636100c6 * Adding support of network routing to config page2.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-17 10:49:10 -04:00
Digimer
30f87cd7c4 * Created Template->select_form() that builds a <select> form entry based on the old Web->build_select from v2.
* Finished config step 2's menus, including adding back the auto-updating network state form.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-10 23:47:31 +01:00
Digimer
20d3f0e90b * Got some more work done on config_stage2. Working on sanity checking requested IFNs versus available interfaces.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-07 14:55:21 +02:00
Digimer
c4a857e8d8 * Created Validate->is_alphanumeric, ->is_domain_name and ->is_positive_integer.
* In 'home', finished 'config_step1' sanity checks and framed up the base for step 2.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-05 14:55:48 +02:00
Digimer
3ac52e1724 * Added binary uploading to Get->cgi and moved the variable store to 'cgi::<variable>::value'. Also added "pretty" variable logging for passed-in CGI variables.
* Added fields for domain and sequence to config_step1 in 'home' CGI script.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-05 10:38:25 +02:00
Digimer
c962a9ac79 * Added the loading of the CGI module when the environment is set to 'html'.
* Added a check to Database->archive_database() to return immediately if the check_tables array is empty.
* Created the new Get->cgi() method that reads in CGI variables (as set by the special 'cgi_list' variable).
* Got more work done on the config_step1 funtions.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-04 17:10:02 +02:00
Digimer
fdc8850dfe * A touch of work on the new Striker setup questionair.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-29 19:24:32 -04:00
Digimer
0acb2c8e18 * Starting work on the Striker configuration workflow.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-24 23:58:14 -04:00
Digimer
692e3a1d97 * Started work on the database archiving method, but won't be continuing it until enough data is being collected to have a working data set.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-23 02:45:10 -04:00
Digimer
0af03deca9 * Fixed a problem with resync'ing a table with a host_uuid column.
* Added a missing column to 'history.states'.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-22 02:54:21 -04:00
Digimer
e68ebe31a0 * Fixed a problem in the resync code where differing time zones on two DB servers caused their time stamps to appear different.
* Fixed a pronlem where I entered into the check for missing records before reading the data from all the DBs.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-22 02:30:34 -04:00
Digimer
1d1258e8b5 * Resync'ing tables works!! (Well, kind of, loooots more testing needed).
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-21 21:41:18 -04:00
Digimer
1aefa7fb8a * Made more progress on the resync code.
* Added notes on SQL table requirements.
* Added the ability to sort columns in Log->variables.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-21 03:51:44 -04:00
Digimer
21694716e8 * Made more progress on the automatic DB resync code. It now pulls the table columns and reads the data from the DB.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-20 03:36:33 -04:00
Digimer
ce607238f8 * Fixed Database->_find_behind_databases(), making it a lot simpler in the process.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-19 02:40:14 -04:00
Digimer
3ce3a80c98 * Started working on the updated Databse->_find_behind_databases logic.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-18 02:09:35 -04:00
Digimer
b5e7054a33 * Added Scalar::Util->weaken to help avoid memory leaks.
* Added Tools->catch_sig to cleanly exit when SIGINT and SIGKILL.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-17 17:16:45 -04:00
Digimer
215d96b983 * Added a check to see if firewalld is running and, if not, start it in System->manage_firewall
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-17 13:40:15 -04:00
Digimer
eaf900d5c3 * Added a check in System->manage_firewall to check iptables-save for the requested port and return immediately if the requested port is open and the task wasn't 'close'. This speeds up firewall checks substantially.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-17 03:07:45 -04:00
Digimer
c1b21f96be * Finished updating System->manage_firewall to be much faster than before.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-16 02:49:48 -04:00
Digimer
189ca3bfce * Created System->_load_firewalld_zones and -> _load_specific_firewalld_zone to more efficiently load information about firewall zones.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-15 01:50:05 -04:00
Digimer
d7fd0c564f * Making good progress of speeding up firewalld stuff. Still room for improvement.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-09 01:04:25 -04:00
Digimer
31dddf95b0 * Created System->_match_port_to_service that matches a TCP or UDP port to a firewalld service name, if possible.
* Updated System->manage_firewall so that it now can open or close a port.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-08 01:35:08 -04:00
Digimer
9b8922b530 * Created System->is_local that takes a hostname or IP address and returns '1' if that matches the local host or one of the local IPs.
* Got System->manage_firewall to the point where it can get a list of open TCP and UDP ports for the active zone.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-08 00:19:57 -04:00
Digimer
cd5a78091f * Started work on managing the firewall in System.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-07 12:47:32 -04:00
Digimer
57f1b60bdb * Fixed several minor issues and silenced a lot of logging.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-04 01:45:56 -04:00
Digimer
c6ad16a7a1 * Added a timeout to System->ping to reduce the delay caused by the host being unable to resolve a hostname.
* Changed Storage->write_file to touch the target file and set it's permissions before writing it out when 'secure' is set.
* Did a bunch of general cleanup and minor bug fixes.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-02 03:00:08 -04:00
Digimer
04f49cdd41 * Fixed a couple problems with an-report-memory and related methods.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-01 21:36:57 -04:00
Digimer
9936554cdb * Created Tools->nice_exit
* Changed all methods that returned 'undef' on error to return '!!error!!' instead.
* Created Convert->round(), ->comma(), ->bytes_to_human_readable() and ->human_readable_to_bytes().
* Created Database->archive_databases(), ->check_lock_age(), ->lock_file() and ->resync_databases() (last one is not started yet).

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-01 21:04:35 -04:00
Digimer
6080ae0bb3 * Connecting to a database now adds/updates the host in the database via the new Database->insert_or_update_hosts and Database->get_hosts().
* Created the new System->determine_host_type() method that tries to determine the host type based on the host name (or via sys::host_type).

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-31 00:22:18 -04:00
Digimer
4aff8a1722 * Fixed bad calls to $an->_hostname and $an->_short_hostname.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-29 01:29:45 -04:00
Digimer
a932b44d28 * Fixed a few more problems with the SQL schema and setting up the database when needed.
* Fixed more typo-related bugs.
* Created System->enable_daemon().
* Changed the 'database::general' to 'sys::database' to avoid accidental collisions with database IDs.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-28 00:39:53 -04:00
Digimer
13352bad6d * Moved most of 'scancore-database' into the new Database->configure_pgsql() method. I had renamed that script, but now it will be removed soon.
* Created System->reload_daemon().

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-27 01:56:52 -04:00
Digimer
ae58dd6f12 * This commit gets m3 back to being able to compile. It very likely doesn't actually work yet though.
* Added the variables table to the core SQL schema.
* Added Databsae->insert_or_update_variables() and ->read_variable().

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-24 02:28:11 -04:00
Digimer
66a984adbc NOTE: Certainly a broken commit.
This continues the work of adding database support (and ancilliary functions) to m3.
* Adds Alert->check_alert_sent() and Alert->register_alert(), providing similar functions as in m2.
* Adds Database->disconnect(), Database->insert_or_update_states(), Database->locking() (still in progress), Database->mark_active(), Database->_find_behind_database(), Database->_mark_database_as_behind() and Database->_test_access().

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-20 02:00:40 -04:00
Digimer
13ae1f1701 Some more work on the database (and related methods). Still a long way from working.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-10 02:58:55 -04:00
Digimer
3ea562a79c Note: Broken Commit
* This is an in-progress commit working on adding the Database methods. Much of it is copy/pasted from v2 and none of the new code is tested yet. It will certainly fail to compile.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-07-07 01:54:49 -04:00
Digimer
e3f782a60c * Finished getting the unit tests caught up with the AN::Tools module methods.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-24 20:24:45 -04:00
Digimer
6b5185fe61 * Added a lot more testing.
* Created Get->uuid to generate random UUIDs via 'uuidgen'.
* Created Storage->read_mode that returns the standard 4-digit mode of a directory or file.
* Created System->stop_daemon to stop daemons.
* Altered Template->get to take fully defined path names.
* Altered Template->skin to use the 'set' parameter (as documented) instead of 'skin'. Also made it so that a skin could be set even if the skin directory doesn't exist via the new 'fatal' parameter.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-22 22:57:51 -04:00