Skip to content

Releases: fled-dev/CryptoDrain

Version 1.4

07 Feb 16:14
ca9457d

Choose a tag to compare

Key Enhancements

Modularization & Code Refactoring

  • Configuration Management: Introduced a dedicated Config class to load and manage configuration from config.json with support for environment variable overrides.
  • Wallet Operations: Created a WalletManager class that encapsulates wallet creation and sweeping operations, improving testability and separation of concerns.
  • Code Organization: Refactored functions into clearly defined sections and modules, adhering to PEP 8 and PEP 20 best practices.

Security Improvements

  • Sensitive Data Handling: Sensitive information such as wallet seed phrases is now masked in logs and notifications.
  • Environment Overrides: Sensitive configuration values (e.g., Telegram API key, channel ID, host IP/port) can now be provided via environment variables.
  • Input Validation: Enhanced input validation and sanitization to prevent XSS and ensure proper formatting of API keys, seed phrases, and addresses.

Performance & Scalability

  • IP Lookup Caching: Implemented caching of IP lookup details per request to reduce redundant external API calls.
  • Asynchronous Operations: Applied Gevent monkey patching to enable non-blocking I/O operations and improved concurrency.
  • Health-Check Endpoint: Added a /health endpoint to facilitate monitoring and load balancing.

Error Handling & Logging

  • Improved Exception Handling: Specific exceptions are now caught instead of using bare except: clauses, ensuring errors are logged with context and stack traces.
  • Structured Logging: Refined logging practices to clearly indicate when sensitive data is involved, without exposing it.

Documentation & Maintainability

  • Docstrings & Comments: Added comprehensive docstrings and inline comments across the codebase for better clarity.
  • PEP 8 Compliance: Reformatted code to adhere to Pythonic best practices and maintain consistency across the project.

Breaking Changes

  • Configuration File Updates: The JSON configuration file now includes additional fields: HOST_IP and HOST_PORT. Users must update their api/config.json or supply these values via environment variables.
  • Sensitive Logging: Sensitive information (e.g., wallet seed phrases) is now redacted in logs and notifications. Ensure that any downstream systems or alerts are adjusted accordingly.

Version 1.3.0

21 Oct 12:21
d586367

Choose a tag to compare

What's Changed

  • Logging setup: Added logging configuration using RotatingFileHandler.
  • Flask integration: Integrated Flask framework for handling API requests.
  • API Input validation: Implemented input validation for api_key, seed phrase, receiver address, and balance.
  • API Improvements: Enhanced error handling and added detailed logging.
  • Notifications: Added notifications for wallet operations.
  • Error Handling: Updated messages for clarity and improved response handling.

Full Changelog: v1.2.2...v1.3.0

Version 1.2.2

21 Dec 22:46
23bea4d

Choose a tag to compare

What's Changed

  • Detected Security Issue: The system audit has identified that there is binding to all network interfaces using hardcoded values. This practice can lead to potential security vulnerabilities as it exposes the system to unnecessary risks. Immediate attention and remediation are advised to enhance security.

Full Changelog: v1.2.1...v1.2.2

Version 1.2.1

21 Dec 22:41
76c9e98

Choose a tag to compare

What's Changed

  • refactor: remove unnecessary whitespace by @deepsource-autofix in #19
  • refactor: add newline at end of file by @deepsource-autofix in #20
  • refactor: refactor unnecessary else / elif when if block has a return statement by @deepsource-autofix in #21
  • refactor: use identity check for comparison to a singleton by @deepsource-autofix in #22
  • refactor: remove unnecessary parentheses after keyword by @deepsource-autofix in #25

Full Changelog: v1.2.0...v1.2.1

Version 1.2.0

21 Dec 22:31
44c6a69

Choose a tag to compare

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

Version 1.1.0

18 Dec 17:51
f862a08

Choose a tag to compare

What's Changed

  1. Enhanced Import Statements: Added imports for requests and urllib.request, expanding the functionality for network operations and external requests.

  2. Configuration Updates:

    • Introduced new variables valid_api_keys, api_key, and channel_id for API key validation and Telegram integration.
    • Automated host IP detection using urllib.request.urlopen.
  3. Telegram Notifications:

    • Implemented a tg_notify function for sending notifications to a specified Telegram channel using the Telegram Bot API.
    • Integrated Telegram notifications at various stages of the API process, including connection attempts, wallet creation, and sweeping outcomes.
  4. IP Location Tracking:

    • Added the ip_location function to determine the geographical location of the IP address making the API request.
    • Used requests.get to fetch location data from an external IP location service.
  5. Enhanced API Endpoint (/api) Functionality:

    • Improved error handling with redirection to http://www.blockchain.com for specific failure scenarios.
    • Introduced detailed logging of errors and critical events in logfile.txt.
    • Enhanced security checks for valid API keys and handling unauthorized access attempts.
  6. Sweep Function Improvements:

    • The sweep function now includes enhanced error handling and logging.
    • Added notifications for different stages of the wallet sweeping process, including wallet creation, success, and failure scenarios.
  7. Dynamic Host and Port Configuration for Flask App:

    • Flask app now automatically determines the host IP and sets the port to '5000'.
    • Error handling for Flask server startup issues with logging and Telegram notification.
  8. Overall Error Handling and Logging Enhancements:

    • Improved overall robustness with comprehensive error capturing and handling mechanisms.
    • Systematic logging of critical errors and operational information in logfile.txt and via Telegram notifications.
      Full Changelog: v1.0.0...v1.1.0

Version 1.0.0

22 Apr 23:57
cf54bc9

Choose a tag to compare

Version 1.0.0

This is the initial version. For more, please read the documentation.