Commit Graph

21 Commits

Author SHA1 Message Date
VetheonGames
0203bc8ebd
Update issue templates 2023-06-05 15:50:55 -06:00
VetheonGames
6615a99317
Create SECURITY.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-05 15:48:41 -06:00
VetheonGames
5d313a7d5e
Create CONTRIBUTING.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-05 15:46:49 -06:00
VetheonGames
29d8c776c3
Create CODE_OF_CONDUCT.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-05 15:42:52 -06:00
VetheonGames
be2392cee6 Refactoring and Enhancing Database Management and System Information Gathering
In this commit, we've made substantial changes to the DatabaseManager and SystemInformationGather classes to improve the functionality, efficiency, and maintainability of the system.

    Refactoring DatabaseManager: The DatabaseManager class was refactored to improve the separation of concerns. Initially, the DatabaseManager was responsible for creating an instance of SystemInformationGather, which was not ideal as it violated the Single Responsibility Principle. The responsibility of creating an instance of SystemInformationGather was moved to the FirstRunInit class, which is more appropriate as it is responsible for the initial setup of the system. This change improves the maintainability of the code and makes it easier to understand and modify in the future.

    Adding Database Connection Test: A method test_db_connection was added to the DatabaseManager to test the database connection before attempting to interact with it. This method improves the robustness of the system by ensuring that a valid connection exists before proceeding. It also provides a better user experience by providing a clear error message if the connection fails.

    Refactoring SystemInformationGather: The SystemInformationGather class was refactored to improve its functionality and efficiency. The methods ask_for_uplink_speed and ask_for_downlink_speed were modified to convert the user's input to Mbps immediately, reducing the need for conversion later. This change improves the efficiency of the system by reducing unnecessary conversions.

    Adding Services Table: A new table for services was added to the database. This table stores the services that the system should be aware of, with each service represented as a boolean value. This change improves the flexibility of the system by allowing it to handle a variable number of services. It also improves the efficiency of the system by reducing the need to parse the services from a string each time they are needed.

    Storing Total Bandwidth: The total bandwidth (the sum of the uplink and downlink speeds) is now calculated and stored in the system_info table. This change improves the efficiency of the system by reducing the need to calculate the total bandwidth each time it is needed.

    Error Handling and Debugging: Throughout the process, various bugs and errors were encountered and fixed. These included issues with method arguments, missing method calls, and incorrect method usage. Fixing these issues improved the stability and reliability of the system.

In conclusion, this commit significantly improves the functionality, efficiency, and maintainability of the system. The changes made adhere to good software engineering principles, such as the Single Responsibility Principle, and make the system more robust and user-friendly.
2023-06-05 14:21:29 -06:00
VetheonGames
6319c9c238 Refactoring for Modularity, Code Reuse, and Security Considerations
In this commit, we have undertaken a significant refactoring of the codebase to improve modularity, promote code reuse, and consider security aspects.

    Modularity and Code Reuse: We introduced classes and modules to better organize the code and facilitate code reuse. Specifically, we created a new Utilities module to hold common methods that are used across different parts of the application. This module includes methods such as convert_speed_to_mbps, services_to_hash, and calculate_total_bandwidth. By placing these methods in a module, we can include this module in any class that needs these methods, thereby promoting code reuse and reducing duplication.

    We also created two new classes, SystemInformationGather and DatabaseManager. The SystemInformationGather class is responsible for gathering system information, such as uplink and downlink speed, and services. The DatabaseManager class handles database operations, including testing the database connection, creating the system information table, and storing system information in the database. By encapsulating these responsibilities within their respective classes, we have made the code more organized and easier to maintain.

    Database Connection Details: We made a decision to store the database connection details in a config file (config.yml) instead of the database itself. This decision was made for security reasons, as storing these details in the database could expose them to potential security risks. Storing these details in a config file allows us to better control access to these details.

    Database Encryption: We discussed the possibility of encrypting the database for additional security. While we have not implemented this feature in this commit, we have laid the groundwork for it by discussing potential libraries/gems that could be used for this purpose. This is an area that we will revisit in the future.

    System Information Gathering: We wrote methods to gather system information, such as uplink and downlink speed, and services, and store this information in the database. This information will be useful for monitoring system performance and for making decisions about resource allocation.

This refactoring effort has made the codebase more organized, easier to maintain, and more secure. It also aligns with our project goals and roadmap. However, it's important to note that with any refactoring effort, there may be potential issues or trade-offs. We will need to thoroughly test the refactored code to ensure that it works as expected and that there are no unintended side effects.
2023-06-04 14:41:12 -06:00
VetheonGames
0a4dcec56a Add in module TODOs 2023-06-03 14:48:16 -06:00
VetheonGames
8f73838c80
Update TODO.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:39:36 -06:00
VetheonGames
eb19a749d5
Update README.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:38:44 -06:00
VetheonGames
5be993e2bc Create TODO.md 2023-06-03 14:37:40 -06:00
VetheonGames
c50b0220a7
Update README.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:25:55 -06:00
VetheonGames
b7774fa2f4
Update README.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:23:53 -06:00
VetheonGames
c0601908bb
Update README.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:22:58 -06:00
VetheonGames
77d63d2302
Update README.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:18:58 -06:00
VetheonGames
44f34bb865
Update README.md
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 14:16:47 -06:00
VetheonGames
d968e17823 Enhance First Run Setup and User Interaction
1. Added a method to ask for the default mode (TUI, GUI, or WebApp) during the first run setup.
2. Implemented a method to validate the input mode.
3. Improved the database connection test method to handle exceptions and return a boolean value.
4. Added a method to ask for database details (username, password, and database name).
5. Enhanced the user interface by adding Curses.clear before each question to make the interface cleaner.
6. Improved the password input process by disabling echo to hide the input from the screen.
7. Added validation for uplink and downlink speeds.
8. Added a method to ask for services the system should be aware of.
2023-06-03 13:38:30 -06:00
VetheonGames
71a777d0bd Create First Run TUI skeleton 2023-06-03 12:35:00 -06:00
VetheonGames
87c3a0c65a Add Rubocop 2023-06-03 10:35:25 -06:00
VetheonGames
8f6ed94fc1 add .ruby-version for local interpreters to know
what version to use
2023-06-03 10:32:46 -06:00
VetheonGames
cfb9e923d8
Add files via upload
Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com>
2023-06-03 10:25:27 -06:00
VetheonGames
050104619f
Initial commit 2023-06-03 10:24:08 -06:00