Commit Graph

6 Commits

Author SHA1 Message Date
VetheonGames
281d5f6ebf Implement Encryption for Sensitive Data and Switch to .env for Configuration Storage
This commit introduces several significant changes to improve the security and configuration management of the application.

    Encryption of Sensitive Data: We've introduced encryption for sensitive data such as database passwords. This is done using the Blowfish algorithm. The encryption and decryption methods are added to the Utilities module. The encryption is applied when the user enters their database password during the first run setup. The encrypted password is then stored in the .env file. When the application needs to use the password, it is decrypted using the key that was generated during encryption.

    Switch from YAML to .env for Configuration Storage: The application now uses a .env file for storing configuration data instead of a YAML file. This change was made to take advantage of the .env file's ability to store environment variables, which can be easily accessed by the application. The .env file stores the database username, encrypted password, encryption key, and database name.

    First Run Setup Changes: The FirstRunInit class has been updated to ask the user for their database details, encrypt the password, and store these details in the .env file. It also checks if any of the necessary details are missing and runs the first run setup if they are.

    Database Connection Testing: The DatabaseManager class now decrypts the password before using it to test the database connection. It also checks if the password or key are nil before attempting to decrypt the password.

    Logging: A new LoggMan class has been added to handle logging. This class provides a simple method for logging messages, which can be used throughout the application to log errors or other important information.

    Bug Fixes and Error Handling: Several bugs were fixed and error handling was improved. For example, a bug that caused the application to crash if the .env file was missing has been fixed. Also, the application now checks if the .env file exists and creates it if it doesn't.

These changes significantly improve the security, reliability, and usability of the application.
2023-06-11 15:46:53 -06:00
VetheonGames
abc256bb42 update .gitignore 2023-06-09 19:48:52 -06:00
VetheonGames
5c98ae6028 update .gitignore 2023-06-09 19:44:37 -06:00
VetheonGames
d694c19d6f update gitignore 2023-06-09 19:44:04 -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
050104619f
Initial commit 2023-06-03 10:24:08 -06:00