* Fixed a typo in Database->insert_or_update_bridges().
* Added 'bond_mac_address' and 'bond_operational' to the bonds table.
* Gathered data needed for bonds in tools/anvil-update-states and got bonds recording successfully (but more testing needed).
Signed-off-by: Digimer <digimer@alteeve.ca>
* Changed the database table ip_address_subnet to ip_address_subnet_mask for clarity.
* Added a check to tools/anvil-update-states to update bond entries instead of just interface entries (also not done).
Signed-off-by: Digimer <digimer@alteeve.ca>
* Created (but not yet tested) Database->insert_or_update_ip_addresses() and the associated ip_addresses database table to store IP address details and reference the interface they're on.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Updated Account->encrypt_password to return a hash reference with keys matching to database column names for consistency sake,
* Renamed 'users -> user_password' to 'user_password_hash' for clarity.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Changed 'database:❌:...' so that 'x' is now the database host's UUID instead of a simple integer. This will simplify sync'ing configs. Also removed default entries, and made it so that anvil-prep-database injects the local config during first setup. Renamed Database->get_local_id to get_local_uuid and changed the 'id' parameter to 'uuid'. Changed Database->initialize's 'id' parameter to 'host_uuid'. The Database->query, Database->write, Database->_mark_database_as_behind and Database->_find_behind_databases methods had their 'id' parameter changed to 'uuid'.
* Added the 'remote_user' parameter to Get->anvil_version, System->ping and System->change_shell_user_password for conencting to remote targets.
* Added the 'remote_user' parameter to all internal Remote->call uses.
* Updated Storage->backup, Storage->copy_file, Storage->make_directory,
Signed-off-by: Digimer <digimer@alteeve.ca>
* Fixed a bug where some '$anvil->{}' variables should have been '$anvil->data->{}'.
* Started merging message keys on 'error_xxxx', 'warning_xxxx', etc.
* The anvil-configure-network now configures the network. Commented out, the tool can reconfigure the entire network without a reboot, but a current issue with the post-configured system refusing to use the allocated interface as the default gateway is to be reviewed at a future time. For now, a closing reboot will be issued.
* Started creating 'anvil-change-password' that will update passwords, including apache (and configure .htpasswd when needed).
Signed-off-by: Digimer <digimer@alteeve.ca>
* Got anvil-configure-network writing out the new network config properly, but renaming already-active interfaces isn't working yet.
* Updated System->get_ips() to record the interface name of a given network by MAC address using 'sys::mac::<mac_address>::iface'.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Fixed some logging in Get->cgi() and generally cleaned up logging levels.
* Got striker to the point where the job to reconfigure the network is saved in the database and the dashboard goes offline until it is done.
* Created the start of the new anvil-configure-network tool.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Added 'file' and 'line' arguments to the Database->insert_or_update_X methods to allow for the original caller's file and line number to be recorded in the SQL call logs.
* Cleaned up how logging to 'anvil.log' logging is handled.
* Updated anvil-update-states to ignore libvirt bridges and to manually set the speed and duplex of virtio network based interfaces.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Fixed a bug with resync, but others remain as resync is incomplete (at least for network_interfaces).
* Currently, tools/anvil-update-states is broken while working on the above issue.
* Reworked the jobs table and removed the units/anvil-jobs.service unit. Jobs will be invoked and backgrounded in all calls.
* Started adding missing hidden form fields.
* Updated the 'server' OCF resource agent version and metadata.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Created a new tool (that may go away) for monitoring for network changes as quickly and with as few resources as possible.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Added Get->anvil_version() to check the local or remote Anvil! version.
* Added a check in Database->connect() to see if a database server's Anvil! version matches the local version. If the versions don't match, the database is not used.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Added the 'debug' parameter to System->enable_daemon.
* Fixed a bug where the old 'Tools.sql' files was being referenced instead of the new 'anvil.sql'.
* Added the 'debug' parameter to Database->initialize and Database->write. Also made it enable the postgresql daemon when initializing the DB.
* Added the 'debug' parameter to Get->host_uuid.
* Fixed the old anvil.conf variable from defaults::log::db_transactions to sys::database::log_transactions.
* Fixed a bad replacement variable name in anvil.sql.
Signed-off-by: Digimer <digimer@alteeve.ca>
* Added the 'debug' parameter to System->call(). Also added a check to make sure that the called executable exists.
* Added the 'debug' parameter to System->start_daemon().
Signed-off-by: Digimer <digimer@alteeve.ca>
* Fixed display issues when showing a summary of what will be done if the user confirms the reconfiguration of the Striker.
Signed-off-by: Digimer <digimer@alteeve.ca>
We've decided to give up on trying to keep ScanCore, AN::Tools and Striker as three separate things. We had originally hoped to make ScanCore easily separatable from the Anvil!, but this was adding increasing complexity to the project and complexity is the enemy of reliability.
In this release, AN::Tools becomes Anvil::Tools, all configuration files move to /etc/anvil and all programs and data files move to /usr/sbin/anvil. Words files are now merged, as are SQL schemas (ScanCore agents will still maintain their own, later). The journald tag has changed from 'an-tools' to 'anvil'.
Other changes;
* Tools.t has been updated to handle existing tests. New methods and parameters still need to have tests added though.
* Added a simple test.pl script used for testing things outside the main program. It will be removed before final release.
* Added the simple 'watch_logs' bash script to more easily tail output.
Signed-off-by: Digimer <digimer@alteeve.ca>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>