Commit Graph

45 Commits

Author SHA1 Message Date
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
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
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
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
5976e7ea32 * Adding a new Database->insert_or_update_jobs() method and associated database tables.
* 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>
2017-12-13 11:40:50 -05: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
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
648af130cd * Finished scancore-database. It now setups/repairs postgresql database config, user and scancore database.
* Fixed a bug in Tools.pm->_set_paths where a path set to '#!not_found!#' was being set (the existing value should have been left alone).
* Fixed some escaping in Log->entry. Also added some additional checks to error more gracefully.
* Created Storage->copy_file() that, well, copies files.
* Fixed Storage->find to not call Log->entry.
* Fixed Storage->make_directory() to only pass the first digit when passed a GID or UID with more that one digit (as can happen with GIDs).
* Updated Storage->write_file() to take 'secure' as a parameter to treat the file contents as containing secure data for logging purposes.
* Created System->check_daemon and ->start_daemon to check and start systemd daemons, as needed.
* Updated scancore-daemon to support running things just once on invocation (effectively run on boot or daemon restart). Call scancore-database. from here.
* Added reading striker.conf to scancore-update-states.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-19 22:32:35 -04:00
Digimer
632f677f04 * Added two new modules; Convert.pm for converting data types and Database.pm for managing all things related to databases.
* Created Convert->cidr() that will convert dotted decimal subnets to CIDR notation and vice versa.
* Created Database->get_local_id that returns the ID from striker.conf that matches the local host, if any,
* Created Get->network_details that returns the host name and a list of interfaces and their IP addresses (if any).
* Created System->call() that takes a shell call and returns the output.
* Created icon for the top-right bar that are "on" (lit up).
* Created a skeleton striker.conf file.
* Created the new scancore-database tool that will manage ScanCore databases.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-13 17:08:38 -04:00
Digimer
f948d7a762 * Updated Log->entry() to escape the finished string just prior to calling logger.
* Updated Template->get() to set the skin directory more cleanly.
* Updated Words->string() to check for a string with #!variable!x!# replacement keys and the 'variables' parameter wasn't passed and throws a useful error are returns '#!error!#'.
* Added top-right icons (see sources.txt for attributions).
* Created a new shared.html template file for shared templates, and added a template for the HTML header.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-13 11:09:21 -04:00
Digimer
e983f27de7 * Changed scancore-update-states to report link speeds > 100 Gbps as 0.
* Added polling to update the network state as needed.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-12 17:39:09 -04:00
Digimer
f7616e4bb6 * Fixed my fix to use data in the elements instead of divs, so the data doesn't show on the page.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-12 15:58:19 -04:00
Digimer
a8a98b431d * Updated the jquery to read in translated strings and to display the link speed.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-12 15:44:23 -04:00
Digimer
8c42b78e63 * Made some progress on displaying the network state on an HTML page using jquery. It's ugly as sin, but it works.
* Fixed a bug in Storage->write_file() where the parent directory wasn't created if it was missing. Also removed passing the mode to the parent directory creation as the file mode rarely applies to the directory (ie: 644 breaks directories but is common for files).
* Changed Template->skin to return just the skin name, not the path.
* Updated scancore-update-states to write the network state information to both xml (for ScanCore) and JSON (for jquery) files.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-12 14:39:20 -04:00
Digimer
bea6bc5e69 * Updated Tools->new() to check if it is being invoked in a browser and set the environment appropriately. It also sets the PWD environmental variable to the DOCUMENT_ROOT variable.
* Renamed 'defaults::languages' to 'defaults::language'.
* Created Storage->change_mode(), Storage->change_owner(), Storage->make_directory() and Storage->write_file() that does what their names imply, using the shell commands instead of the built-in commands (may switch to them later). The ->make_directory() method will create any needed parent directories.
* Moved System->read_file() to the Storage module as it made more sense there. For now, System is empty.
* Created Words->language to set or check the active output language.
* Fixed Template->get() to use Words->language.
* Updated Words->string() to take the new 'string' parameter which, when set, is used instead of the 'key' parameter and is treated as a pre-retrieved string, so replacement keys are directly injected.
* Updated Template->get() to take the 'variables' parameter and then uses Words->string({string => ...}) to process the replacement keys.
* Updated tools/scancore-update-states to write out the network interface states to the status.xml file.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-11 03:00:35 -04:00
Digimer
753d7a3ba6 * Created the new System.pm module with the initial read_file() method that reads files.
* Created Log->language that sets/returns the active log language.
* Created Log->variables that takes a hash reference and logs their variable: [$value] pairs.
* Created the new /usr/sbin/striker/ directory which is added to the list of search directories. We will store our tools here.
* Created the scancore-daemon and scancore-daemon.unit files which will handle all the things we used to use crontab for, minus ScanCore itself.
* Created the scancore-update-states that will eventually store some machine state information in a file that the web browser can read.
* Created the cgi-bin/home script that will be the main landing page for the Striker UI.
* Added some of the initial html files.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-10 02:38:04 -04:00
Digimer
0ee84cd31e * Created the new Templates module to handle reading and preparing templates.
* Added an index.html and favicon as well as a very basic 'home' cgi script which will allow the web development to start.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-06-09 04:29:25 -04:00