Skip to content

Version 1.2.0

Choose a tag to compare

@fled-dev fled-dev released this 21 Dec 22:31
· 46 commits to main since this release
44c6a69

What's Changed

  1. Additional Imports: The script now includes imports for json, os, pyfiglet, time, and gevent.pywsgi.

  2. Boot Screen Functionality: There is a new function boot_screen that seems to be designed for displaying a startup screen or banner when the application is launched. It uses pyfiglet for ASCII art and includes code for clearing the screen and printing in a specific color (orange).

  3. WSGIServer from gevent: The import of WSGIServer from gevent.pywsgi suggests that there might be a change in how the Flask app is served, potentially for improved performance or concurrency handling.

  4. Version Information and Banner Customization: The boot_screen function includes code for displaying version information ("Version 1.2.0") and a custom banner with the developer's handle (@fled-dev). This addition enhances the user interface and provides immediate visibility of the application version.

  5. Enhanced Logging Functionality: A new function log has been introduced. It appears to handle logging messages with timestamps. This function is likely used to create or append to a logfile.txt, providing a detailed and time-stamped record of events and operations.

  6. Use of datetime for Timestamps: The script now involves the use of datetime (presumably imported) for generating current date and time, which is then formatted and included in log entries.

  7. Config File Handling: The new version includes a get_config function to manage the application's configuration settings. This function reads a config.json file, presumably containing key settings like API keys, server configuration, etc.

  8. Improved Log Management: Before reading the config.json file, the script checks for an existing logfile.txt and deletes it if present. This step ensures that each session starts with a fresh log file, making it easier to track current session activities without confusion from previous logs.

  9. Enhanced Error Handling and Logging in Config Management: The script includes error handling for cases where the logfile.txt does not exist and logs relevant messages, ensuring smoother operation and better traceability of events.

  10. Global Variable Definition from Configuration: The get_config function now sets global variables based on the contents of the config.json file. Variables such as FLASK_API_KEYS, TG_API_KEY, TG_CHANNEL_ID, and TG_NOTIFICATIONS are being initialized, suggesting a more dynamic and configurable approach to managing API keys and Telegram integration settings.

  11. Enhanced Configuration Management: The script logs the process of assigning configuration values to global variables, enhancing traceability and debugging capabilities. This approach indicates a move towards a more modular and configurable application design.

  12. Refined Telegram Notification Function (tg_notify):

    • The updated tg_notify function includes checks to ensure Telegram notifications are enabled (TG_NOTIFICATIONS).
    • The function now verifies the presence of the Telegram API key (TG_API_KEY) and channel ID (TG_CHANNEL_ID) before proceeding with sending notifications.
    • If either the API key or the channel ID is missing, the function logs an error and returns without attempting to send a notification.
  13. Enhanced Telegram Notification Sending Logic:

    • The tg_notify function now logs a message before sending a notification, improving transparency in the notification process.
    • The Telegram API URL is constructed using the TG_API_KEY, and the notification is sent using a POST request.
    • After sending the notification, the script logs a confirmation message, ensuring that notification delivery attempts are tracked.
    • Exception handling is included to capture and log any failures in sending Telegram notifications, enhancing the robustness and reliability of this feature.
  14. IP Location and Current IP Functions:

    • The script includes enhanced IP location and current IP retrieval functions with improved logging. This will help in tracking and logging the IP addresses of API users.
  15. Updated API Endpoint Implementation:

    • The /api route now includes additional logging for actions like reading the API key, checking its validity, and obtaining the seed phrase and receiver.
    • Enhanced Telegram notification integration within the API route, providing detailed status updates for various stages of API interaction.
  16. Execution Flow in Main Function:

    • The script now starts with a boot screen and reads the configuration using get_config.
    • It defines the host IP and port for the Flask server (set to '0.0.0.0' and 8080 respectively).
    • Implements a WSGI server using gevent for running the Flask app, which can offer better performance and handle concurrent requests more efficiently.
  17. WSGIServer for Flask App:

    • The use of WSGIServer from gevent.pywsgi for running the Flask app suggests a move towards a more production-ready setup. This server can handle multiple simultaneous requests, making it more suitable for real-world deployment than the default Flask server.
  18. Comprehensive Error Handling and Logging:

    • The main function includes comprehensive error handling and logging, ensuring robustness in the application's execution and startup process.

Full Changelog: v1.1.0...v1.2.0