Commit Graph

449 Commits

Author SHA1 Message Date
Digimer
d147e10552 * Changed the call to reboot after OS update to instead set a reboot required flag.
* Created tools/anvil-clear-reboot to clear the "reboot needed" flag. Also created, but not yet using (and may not use) units/anvil-boot-time.service.
* Started work on having jobs show their data via JSON / jquery.
* Updated anvil-update-system to record messages indicating the progress so far.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-22 02:16:56 -04:00
Digimer
51c9d2952d * Fixed a bug with caching database handles in the recent database updates causing Database->write to stop working.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-16 19:34:37 -04:00
Digimer
fe33fbb239 * Created System->maintenance_mode to add "maintenance mode" support to Striker.
* Continuing work on adding the system update job support to Striker. Untested/Incomplete.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-16 02:38:58 -04:00
Digimer
6aa74d3d96 * Updated Database->_test_access() to use the DBD 'ping' method, and attempt a reconnect of failure.
* Updated Database->connect to take a specific UUID to attempt a connection to.
* Renamed some old 'sys::x' variables related to the database to 'sys::database::x' to conform better to coding standards.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-15 16:57:57 -04:00
Digimer
dd88051d9b * Finished the initial version of tools/anvil-update-system.
* Updated the RPM to .13 to disable postun's disabling of postgres, which breaks Anvil! software using the database during RPM updates.
* Fixed a logging bug where the number of DB connections was not inserting the number properly.
* Fixed exits in tools/anvil-prep-database.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-14 03:45:36 -04:00
Digimer
a63bfb0799 * Added support to reconfigure a Striker system.
* Started adding support for updating the striker (and later, all) systems. This will be handled by the in-progress tools/anvil-update-system program.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-13 18:25:48 -04:00
Digimer
252fbf21ef * Fixed a bug where '$anvil->' wasn't referencing '$anvil->data->' when it should have been.
* Got anvil-manage-striker-peers working properly (so far).
* Updated anvil-prep-database to call anvil-manage-striker-peers, but testing still needed.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-13 02:22:46 -04:00
Digimer
1106d36e03 * Fixed bugs in tools/anvil-manage-striker-peers, basic testing done.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-11 23:20:03 -04:00
Digimer
89c06b9f24 * Started work on tools/anvil-manage-striker-peers to do the actual work on managing local and peer databases in anvil.conf.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-08 15:10:29 -04:00
Digimer
0fa3c42f2f * Fixed a bug where setting the debug level to 3 caused a deep recursion and a system hang.
* Update Anvil::Tools->new() to access the parameters 'log_level', 'log_secure' and 'debug', streamlining the frequent calls to $anvil->Log->level and ->secure in program startup, and allowing the values to take effect during the ->new constructor.
* Passed 'debug' to child method calls in more places (still more to do though).
* Fixed a bug where 'test_table' wasn't set in the right place, causing the database to try to initialize repeatedly.
* Made Database->archive_database only run if called with root access.
* Now the number of database connections are stored in 'sys::db_connections' instead of checking the returned number, and that is cleared on disconnect.
* Started working more on 'anvil-daemon', including adding support for System->call being taking 'background', 'stderr_file' and 'stdout_file' paramters which, when set, used Proc::Simple to background the process.
* Did some more work on database archiving, though still far from done.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-08-01 02:06:16 -04:00
Digimer
a364141d81 * Added a check/cycle to Remote->call that checks to see if the channel was established and loops up to five times, with a second delay in each try. Also disable the Time::HiRes stuff in this method for now.
* Fixed a bug where "form::error_massage" was default to '&nbsp;' which caused simple checks to thing there was an error when all was fine.
* Got the "add new sync peer" form confirmation box displaying and cleaned up the CSS a bit.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-30 01:53:36 -04:00
Digimer
839bfc8a2d * Updated Striker to better handle when host.uuid hasn't been generated yet on brand new installs.
* Updated anvil-update-state to add commas to network link speeds.
* Added dmidecode to the spec file

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-25 21:02:48 -04:00
Digimer
9ab242a117 * Decided to move development to Fedora 28 to prepare for the leap to RHEL 8. So this commit is the first where the Anvil! Striker can be installed.
* Updated Get->users_home() to default to return the hore directory for the user running the program.
* Updated Remote->call() to start working on handling timeouts.
* Updated Storage->change_owner(), ->make_directory() and ->write_file() to default the the user and group running the program.
* Fixed a bug in home reporting the MAC address of NICs when confirming configuration of Striker. Also changed showing the domain to the hostname.
* Got more work done on sync peers.
* Updated the RPM spec file to install on Fedora 28.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-25 02:34:47 -04:00
Digimer
b24b20ec89 * Working on saving the new peer. Made progress on, but not yet finished, sanity checking the new peer form values.
* Cleaned up some docs.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-20 03:08:44 -04:00
Digimer
578c23b0a3 * Finished the form for adding peers (but no logic to support it yet, it's just filled and formatted).
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-19 16:40:03 -04:00
Digimer
1ac1bc5ffb * Made more progress on the peer database configuration page.
* Added a switch to tools/anvil-configure-striker to prevent reboots.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-18 18:32:39 -04:00
Digimer
2c52f649ba * Fixed the path of anvil.sql
* Set Log->entry to chmod the log file to 666 when the file is opened to ensure apache can write to it.
* Fixed a string replacement variable name.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-13 03:26:53 -04:00
Digimer
2d88502f6a * Continued work on the sync page.
* Updated rpm spec to bring in gnome when installing anvil-string.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-11 02:14:21 -04:00
Digimer
ee649ff2dd * Started work on the Striker sync function. It shows (without formatting yet) the ways the local dashboard can be accessed.
* Added another check and better error handling to Template->get() to print a more useful message if a template is found but fails to parse.
* Moved some strings into the words file.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-07 01:31:40 -04:00
Digimer
6e19d45845 * Updated Template->get to print a useful error message of a template is not found in a file.
* Moved templates around different files to clean things up.
* Moved the "back" and "refresh" icons over to the right by the logo, and added a new icon for handling mail, alerts, install targets and manifests.
* Started work on the Striker configuration sub-page.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-06 03:07:45 -04:00
Digimer
19672f8b7c * Started work on the Striker menus, adding mechanisms for "back" and "refresh".
* Fixed a bug where the old style '#!replace!...!#' replacement variables were not being escaped when processing variable insertions into strings.
* Made the body variable be stored in 'form::body' instead of passing around the '$body' variable.
* Created a set of new icons.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-04 17:57:25 -04:00
Digimer
1079c65687 * Finished working on the log in and log out functions of Striker. Still super basic, but it works!
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-27 18:13:16 -04:00
Digimer
3fce021498 * Making good progress on the internal login/account methods. The user can now log in, though the first reload logs them right back out. Lots still broken.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-27 01:28:13 -04:00
Digimer
66928edb06 * Added logic to check if Striker is configured and, if so, enter main functions.
* Finished up the configuration logic for Striker.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-22 01:43:43 -04:00
Digimer
2febb09d72 * Updated anvil-configure-striker to handle network configurations in non-bonded configurations and to remove virsh bridges.
* Added error messages to Striker configuration forms.
* Fixed a bug in home->get_network_details() function to handle single IPs in network.xml.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-20 19:50:56 -04:00
Digimer
39c06f364f * Got tools/anvil-configure-striker updating the system passwords now.
* Updated System->get_ips to only record 'sys::mac::<mac>::iface' for actual interfaces, not bonds.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-02 00:22:40 -05:00
Digimer
4e6f492c4f * Updated Log->variables to add dots when printing a variable/value pair per line so that variables line up vertically.
* Renamed tools/anvil-configure-network to tools/anvil-configure-striker given that it will also now update system passwords.
* Started working on tools/anvil-update-states to properly handle a Striker with already-configured networking.
* Cleaned up tools/anvil-change-password.
* Fixed a bug in Storage->update_config to set the ownership of anvil.conf to 'apache:apache' so that the web server can read it.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-21 22:02:45 -04:00
Digimer
2163739b93 * Created Storage->update_config that will update a variable in anvil.conf (locally or remotely).
* Finished (for now) tools/anvil-change-password.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-21 03:11:47 -04:00
Digimer
59245a4f0b * Created Account->validate_password to test that a user name and password is valid.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-18 12:23:55 -04:00
Digimer
d110bff224 * Created Account->encrypt_password() for creating encrypted hashes of passwords. Set the default algorithm to sha256, a ~16 byte random salt and 500,000 re-encryptions (which takes a total of about 0.7 seconds on an Intel i7-6820HQ CPU).
* Added user_algorithm and user_hash_count to the new users database table so that we can remember how a hash was generated, should it be changed down the road.
* Made the salt length configurable by the user (as well as the algorithm and loop count).

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-15 17:45:52 -04:00
Digimer
b8bb781c5e * Added the new tools/anvil-cycle-vm-nics, which is the updated version for m2's cycle-vm-nics.pl.
* The RPM spec changes SELinux to 'permissive' (only for developmer, it will be removed before RC stage).

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-06 14:25:43 -04:00
Digimer
5f06752167 * Finished updating tools/anvil-prep-database to inject the new, local database entry into anvil.conf. This tool works again.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-01 12:26:41 -04:00
Digimer
a89fb24adf * Changed the Storage->copy() 'target' parameter to 'target_file' to avoid confusion with the often-used 'target' parameter for connecting to remote machines.
* 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>
2018-04-30 11:43:30 -04:00
Digimer
eafd4fd3f7 * Fixed a couple bugs to get System->change_shell_user_password() working.
* Made logging between journald and a traditional file configurable via 'sys::log_file'. Also made the file handle unbuffered when logging to a file.
* Fixed a bug with loading the anvil.conf config file in a few locations.
* Created System->stty_echo() to handle enabling/disabling shell echo, and added restoring the echo to Tools->catch_sig.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-26 12:41:03 -04:00
Digimer
188cab5ec0 * Fixed a few bugs with how rsync is handled, specifically in the rsync wrapper script.
* Fixed a bug with handling ssh fingerprints (and removed comments going to the known_hosts file).
* Added more nested debug parameter passing when methods call other methods (though more work is needed to catch up)

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-24 13:32:19 -04:00
Digimer
ea43896fca * Created the new Remote module, and in it, moved System->remote_call to Remote->call() and created the new add_target_to_known_hosts() method (and two private helper methods). These are adapted from the m2 code.
* Updated Storage->read_file and Storage->write_file to support reading and writing on remote systems (untested though)
* Created System->change_shell_user_password() that changes a shell user's password by manually generating an sha512 salted hash of the given password and uses the resulting hash to modify the target user's password, so the password should never be visible in the process list. Works on both local and remote systems, though it still needs testing.
* Created Storage->rsync() to handle moving files between the local and a remote system.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-22 22:16:10 -04:00
Digimer
a294c6c4fa * Updated the database components to use the name 'anvil' and the user 'admin'. The 'database::user' and 'database::name' variables are still supported, but now hidden.
* 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>
2018-04-13 19:55:34 -04:00
Digimer
e4f7bcf661 * Created Storage->backup() that makes a backup of the given file under the Anvil! backup directory with a time-stamped suffix and preserving the original directory path.
* 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>
2018-04-05 02:25:56 -04:00
Digimer
c88cbf4531 * Got tools/anvil-configure-network writing the first network config file body.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-03 01:00:46 -04:00
Digimer
d6846841a2 * Added the 'job_status' column to the 'jobs' table where progress to be shown to users is stored.
* Updated anvil-configure-network to use Database->insert_or_update_jobs().

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-02 01:03:28 -04:00
Digimer
d86750ba01 * Created System->hostname() to get and optionally set the hostname (static and pretty).
* Got anvil-configure-network setting the new hostname.
* Updated anvil-configure-network to exit only if the job was picked up by a still-running PID.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-01 02:26:38 -04:00
Digimer
b53f688048 * Got tools/anvil-configure-network to the point where it loads the job details.
* Made the Striker logo clickable.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-03-29 01:04:04 -04:00
Digimer
7694847160 * Fixed a bug in Database->insert_or_update_jobs().
* 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>
2018-03-26 23:55:39 -04:00
Digimer
0370d6acef * Fixed a bug in the network_interfaces SQL procedure that broke how data was recorded in the history schema.
* 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>
2018-03-24 09:57:10 -04:00
Digimer
c21b326f1a * Changed all methods to take a 'debug' argument for setting log level on calls.
* 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>
2018-03-07 03:11:55 -05:00
Digimer
6f4df4ed22 * Changed 'database::X::ping_before_connect' to 'database::X::ping' and made the value be the actual timeout to wait for pings when trying to connect to a database.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-02-23 00:58:47 -07:00
Digimer
f72d8e0f70 * Added a version file and Tools->_anvil_version() which reports the version in it.
* 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>
2018-01-04 01:29:05 -08:00
Digimer
f1bd4b99ca * Fixed more issues with anvil-prep-database.
* 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>
2017-12-27 00:45:59 -04:00
Digimer
d864bd6dac * Moved words.xml to /usr/share/anvil/
* Moved all executables to /usr/sbin/
* Made /root/anvil-backups/ the backup directory.
* Started debuging anvil-prep-database

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-26 14:12:59 -04:00