Commit Graph

73 Commits (96d2797ec3dd4e37b668c58c43dce26ce24968d6)

Author SHA1 Message Date
Jose M. Guisado 95b28c9403 Add setup modif part scheme param and autofill partition_setup
A new parameter for the setup/ was added: type. Regarding the disk
partition scheme. It must be either "MSDOS" or "GPT".

ogServer expects a 4 partition setup in order to succesfully execute a
setup/ command. Ogcp is currently getting the partition to modify
one partition at a time. This patch enables ogcp to "autofill" with
empty partitions the partition_setup payload parameter.

TODO: In the future, the setup/ logic should not need to query the
database once again in order to create the 'partition_setup' payload
parameter with the form modifications.
2021-02-10 10:48:01 +00:00
Jose M. Guisado b708047d28 config: use from_json to read ogserver config
This patch introduces the usage of Flask.Config class so the config can
be read at startup (__init__) only once. Config keys must be uppercase
so that from_json method does take it into account.

 dormousehole.readthedocs.io/en/stable/api.html#flask.Config.from_json

Prior to this patch each request required opening and closing the
ogserver.json file via load_config in views.py.

In the future the decorated load_config function inside views.py
may be removed to avoid creating multiple instances of the OGServer
class.
2020-11-06 09:27:03 +00:00
Jose M. Guisado c08aca9219 Add software action
This action lists every piece of software installed in an OS from a
client.

This action can handle listing the software from the DB as well as
updating that DB with the latest client information.
2020-10-29 15:03:35 +01:00
Roberto Hueso Gómez a8d7494ab9 Add image create action
This action handles the creation of the image in the DB as well as the
'.img' file.
2020-10-29 14:43:23 +01:00
Roberto Hueso Gómez 904989b175 Add image restore action
This action provides the image restoring functionality on a specific
client.
2020-10-23 15:10:29 +02:00
Roberto Hueso Gómez c5a4ccff55 Add session action
This action provides the functionality to run one of the installed OSs
in a client.
2020-10-22 11:04:57 +02:00
Roberto Hueso Gómez e978c30b9f Add client hardware action
This action lists all the hardware items in a client.
2020-10-21 14:38:44 +02:00
Roberto Hueso Gómez 93ffa115fe Add create client action
This action provides the functionality to add a new client to an
ogServer.
2020-09-28 15:04:00 +02:00
Roberto Hueso Gómez 664d032884 Add client details action
This action is used to visualize the specific details of a client, such
as its IP, Name, MAC, etc.
2020-09-28 15:02:16 +02:00
Roberto Hueso Gómez ea5b22c35e Add delete partition view
This view deletes and formats a partition from the selected machine.
2020-09-15 13:42:28 +02:00
Roberto Hueso Gómez 1ce9c8a95b Fix setup partitions filesystem codes to string
Partition filesystem are encoded with integers in the DB. We need to
send the type string instead of the encoded integer, so this patch
parses the encoded integer to string.
2020-09-15 13:39:05 +02:00
Roberto Hueso Gómez 7815d1fac7 Add partitions setup forms
This provides a menu to setup the internal partitions setup of each
machine. Delete partitions is still just a placeholder.
2020-09-14 10:56:58 +02:00
Roberto Hueso Gómez 9df3c538f3 Fix parse_ips(...) function to avoid parsing CSFR
This avoids trying to parse CSFT token as an IP.
2020-09-14 10:54:46 +02:00
Roberto Hueso Gómez 19be0f87de Fix internal server error code 2020-09-14 10:54:01 +02:00
Roberto Hueso Gómez b7e980f946 Add 500 default error handler
This handles HTTP 500 internal server errors.
2020-09-04 13:21:36 +02:00
Roberto Hueso Gómez 31d2808a43 Add 404 default error handler.
This handles HTTP 404 page does not exist errors.
2020-09-04 13:20:11 +02:00
Roberto Hueso Gómez bb7e201991 Add refresh action
This action can be applied on single or multiple scopes.
2020-09-04 13:18:26 +02:00
Roberto Hueso Gómez d5eaf699a7 Add WoL action
This action can be applied on one or multiple scopes. This
implementation use Flask-WTF as a way to build and valdiate forms. As a
side effect, this adds CSRF protection to all forms.
2020-09-04 11:09:44 +02:00
Roberto Hueso Gómez 73a6e07b83 Add reboot action
This action handles reboot on one or multiple scopes.
2020-09-03 11:50:58 +02:00
Roberto Hueso Gómez ef609cf52a Rename add_state_to_scopes() function
This function is renamed to add_state_and_ips() which is more accurate.
2020-09-02 14:50:52 +02:00
Roberto Hueso Gómez c12ff832c7 Add action_poweroff() view function
This function handles a poweroff request to one or multiple scopes.
2020-09-02 14:46:20 +02:00
Roberto Hueso Gómez 30c5173aea Implement scopes() view function
This function provides the data needed to render the scopes.html
template.
2020-09-02 14:45:02 +02:00
Roberto Hueso Gómez df2e425b34 Add basic backend structure
This adds views functions and ogServer config loading.
2020-08-31 11:58:27 +02:00