Commit Graph

2630 Commits

Author SHA1 Message Date
Digimer
ee543ab64b * Re-fixed postgresql daemon path.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-12 21:30:13 -04:00
Digimer
b87f6c63e2 * Fixed the postgres service variable.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-12 21:22:15 -04:00
Digimer
8cee9cdcc2 * Updatedb the anvil.spec to be smarter about pre and post (and postun).
* Updated tools/anvil-prep-database to use a daemon name from Tools.pm to more easily support later postgres version upgrades.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-12 21:16:27 -04:00
Digimer
1539ef72a8 * Fixed how passwords are supressed in logs.
* Fixed config step 2 display.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-07-11 14:07:07 -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
f120866fa5 * Fixed merge issues.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-27 18:55:35 -04:00
Digimer
96bda1d329 Merge branch 'master' of github.com:digimer/anvil
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-27 18:51:55 -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
a6a5df2496 * Fixed a bug in 'home' not displaying the 'offline' message when it was waiting for a reconfig.
* Cleaned up 'button' CSS class links and submit CSS to match.
* Re-enabled reboot at the end of a tools/anvil-configure-striker run.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-22 17:27:30 -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
a3d97e4c92 * Updated anvil-update-states to mark interfaces, bonds, bridges and IP addresses as DELETEd when they disappear.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-18 16:29:27 -04:00
Digimer
c208d676cb * Finished the jquery (for now) to pre-fill the step 2 form.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-18 01:24:19 -04:00
Digimer
2ea506b4d9 * Got the jquery to fill the form IP data is set.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-17 18:25:56 -04:00
Digimer
97441831e6 * Started reworking the jquery to read through the network.json file and parse the form, instead of looping through the form and reading the json file repeatedly.
* Made System->get_ips() smarter; it pulls DNS data from the route interface only.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-16 00:19:39 -04:00
Digimer
0272ba8b80 * Moved the network default values into the main defaults hash.
* Fixed a bug in Database->insert_or_update_network_interfaces where independent interfaces (not under a bridge or a bond) were not being saved.
* Continued working on improving Striker's network config jquery/form functions.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-15 02:17:20 -04:00
Digimer
38f81fd8eb * Started work on using jquery to more intelligently set the config step 2 form.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-13 18:49:23 -04:00
Digimer
86259a4783 * Got the network.xml and network.json files fixed and parsable.
* Moved config JS to config.js.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-10 00:27:08 -04:00
Digimer
66b5c815d0 * Finished recording IP address information in network.json/xml.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-09 13:29:51 -04:00
Digimer
12afcb9731 * Started working on adding IP data to network.json (and .xml).
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-08 10:52:31 -04:00
Digimer
1245cfc547 * Re-enabled writing of the network.json and network.xml files.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-07 23:40:38 -04:00
Digimer
76725e9160 * Fixed a bug in Database->insert_or_update_bonds() that caused unneeded UPDATE.
* Fixed anvil-update-states to record the bond UUID for interfaces already in bonds.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-07 23:15:43 -04:00
Digimer
d600a635d4 * Made 'network_interface_bridge_uuid' allow NULL entries allow NULL entries.
* Fixed a sanity check in Database->insert_or_update_network_interfaces.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-06 18:43:56 -04:00
Digimer
67c4f50bdc * Updated Database->insert_or_update_network_interfaces() to work like other similar methods. Also re-enabled NULL for 'network_interface_bond_uuid' as an empty string can't be used on a 'uuid' column type and it's not always set.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-06 18:31:19 -04:00
Digimer
870a2eb803 * Updated the SQL schema to convert all 'boolean' to 'integer' (using 0 for false). Also made all columns NOT NULL, given they should all always have an empty string. The logic behind this was to standardize the code and avoid bugs.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-06-04 13:12:32 -05: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
b0232c6180 * Made the sysfs directory references static.
* 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>
2018-05-29 17:57:55 -04:00
Digimer
66f280c9a7 * Added Database->insert_or_update_bridges() and finished Database->insert_or_update_bonds (both need testing still).
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-25 00:10:29 -04:00
Digimer
d6c94e9d28 * Started working on Database->insert_or_update_bonds.
* 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>
2018-05-24 03:02:27 -04:00
Digimer
a6e50f15a9 * Updated System->get_ips() to determine which interface is the default gateway and set the gateway IP and active DNS servers.
* 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>
2018-05-23 03:50:30 -04: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
6f3537807a * Added Account->read_details to collect data on the given user name.
* 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>
2018-05-19 00:01:24 -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
04cbec30a0 * Created Database->insert_or_update_users() to add/edit users.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-17 00:45:20 -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
9a37f66468 * Decided to abandon using apache security and to integrate it into Striker itself. This will allow for layers of access, easier account sync'ing, etc. Further, there is no proper way to handle logging out on apache, and they use md5 * 1000 iterations (with a salt, to be fair) for security... Not exactly the strongest.
* Created the new Account.pm module for handling account related tasks.
* Moved 'sys::stty' to 'sys::terminal:stty'.
* Created Get->_salt which generates a (pseudo) random salt for internal passwords and Get->_wrap_to that checks the current terminal width.
* Added the parameter 'redirect_stderr' (default '1') to System->call to optionally not redirect STDERR to STDOUT (needed for tput to be useful as STDERR is a terminal of sorts).
* Disabled System->change_apache_password (to be removed entirely later).
* Created Words->_wrap_string to wrap text strings to the active terminal width.
* Added the user's table to the core SQL. Also deleted the empty Anvil/Tools.sql file.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-15 01:55:56 -04:00
Digimer
de333704b5 * Created System->change_apache_password() to update (and enable) Striker's apache user. For now, it simply enables it in httpd.conf, it doesn't actually set/update the password.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-05-10 01:41:45 -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
b42d4a6fea * Tested that the new remote Storage->read_file() works and removed some test code.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-04-24 18:46:12 -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