Commit Graph

73 Commits

Author SHA1 Message Date
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