Commit Graph

37 Commits

Author SHA1 Message Date
Zakhar Izmaylov 83870a2022 Refactor and improve security with cryptographically secure random generation
- Replace `random` module with `secrets` for cryptographically secure random choices
- Update type hints for async API methods in client.py
- Optimize file reading with aiofiles in multiple handlers
- Improve error handling and logging in various modules
- Update Python target version to 3.12 in pyproject.toml
- Remove unused imports and improve code quality
2025-01-30 22:35:09 +03:00
Zakhar Izmaylov 7327a96730 Improve type hinting for database backup function
Update return type annotation for `_create_database_backup()` to use explicit tuple type syntax, enhancing type clarity and compatibility with modern Python type hinting practices.
2025-01-29 07:16:21 +03:00
Zakhar Izmaylov 8ce7ee0ce0 Optimize import statements and remove unused imports across multiple files
This commit focuses on cleaning up import statements by:
- Removing unused imports
- Organizing import order
- Removing redundant imports
- Ensuring consistent import style across different modules
2025-01-29 07:15:20 +03:00
GitHub Actions 5f2b40b2d2 Auto-format code with Ruff using pyproject.toml 2025-01-29 04:01:20 +00:00
Zakhar Izmaylov a757852598 Merge branch 'main' of https://github.com/izzzzzi/Solo_bot 2025-01-29 07:01:01 +03:00
Zakhar Izmaylov ca2a720bfc Enhance error handling in backup cleanup process. Added a generic exception handler to log errors during the removal of old backups, improving robustness and maintainability of the backup functionality. 2025-01-23 12:10:08 +03:00
Zakhar Izmaylov a9d1c0b75a Refactor backup sending logic in backup.py to remove redundant document sending for admin IDs. Streamlined the process by ensuring only the necessary admin IDs receive the backup document, enhancing code clarity and reducing potential errors in the backup notification process. 2025-01-23 08:54:22 +03:00
Zakhar Izmaylov 311c48edcd Refactor code to utilize aiofiles for asynchronous file handling across multiple modules. Added a new function to remove blocked users from the database and updated user blocking/unblocking logic to use this new function. Improved database interaction in admin panel handlers by passing session objects instead of creating new connections. This enhances performance and maintains consistency in file operations. 2025-01-23 06:34:45 +03:00
Zakhar Izmaylov c87ec273e5 Add directory creation for database backups in backup.py 2025-01-22 10:31:03 +03:00
Zakhar Izmaylov 8667ae3a23 Refactor file handling to use aiofiles for asynchronous operations
- Replaced synchronous file reading with asynchronous file handling using aiofiles in multiple handlers and the backup module.
- Improved performance and responsiveness when sending images and backups by utilizing async file operations.
- Ensured consistent use of BufferedInputFile across all relevant functions for better code maintainability.
2025-01-21 12:03:56 +03:00
Zakhar Izmaylov acb73101c0 Refactor and clean up code formatting across multiple files
- Consolidated and simplified code formatting by removing unnecessary line breaks and improving readability in various functions.
- Updated the handling of backup file sending in backup.py for better clarity.
- Streamlined error handling and logging messages in several handlers to enhance consistency.
- Adjusted the Makefile to exclude specific files during Ruff checks and formatting.
- Made minor adjustments to function signatures and parameter handling for improved clarity and consistency.

This commit enhances code maintainability and readability without altering functionality.
2025-01-21 08:57:12 +03:00
hteppl 381f3e0b67 Changes from upstream 2025-01-17 21:50:35 +03:00
hteppl 4556c01635 Reorganise backups creation 2025-01-16 11:00:38 +03:00
Vladless 26ef2c4e5a backup_update 2025-01-16 04:15:17 +03:00
Vladless 0391bd90e9 FlowPayRenew/fixNotify/pay_history/custom/statistic/minorFixes 2025-01-14 04:06:55 +03:00
Zakhar Izmaylov a018a42f2c Add antiflood and lint 2025-01-10 14:51:13 +03:00
Vladless 97091f4875 fix_refferal/GIFTS/redirect/name_sub and more 2024-12-19 20:37:41 +03:00
Zakhar Izmaylov 142c1c15e7 Migrate to ruff 2024-12-13 12:09:20 +03:00
Vladless f0b2c40a8a Revert "Merge pull request #112 from Vladless/hteppl-optimize-sources"
This reverts commit fa681fac92, reversing
changes made to b31c9d2e10.
2024-12-10 03:53:07 +03:00
hteppl 7a11c51e1f Move util-related files into separated folder + refactor imports 2024-12-08 04:57:20 +03:00
Vladless 3e6aa31e17 backup for 3x-ui 2024-12-05 23:31:48 +03:00
Zakhar Izmaylov 30efc7a1c7 Refactoring 2024-11-24 01:18:42 +03:00
Zakhar Izmaylov d1b7a01b4f Update config 2024-11-22 21:24:55 +03:00
Zakhar Izmaylov 39db3e2e64 Update Middleware 2024-11-17 23:42:09 +03:00
Zakhar Izmaylov 4dba5736e1 Fix send backup 2024-11-17 15:29:56 +03:00
Zakhar Izmaylov fb28a0881c Add dry logging 2024-11-16 18:01:28 +03:00
Vladless 9f8a366aa3 small fix 2024-11-13 05:41:49 +03:00
Zakhar Izmaylov 7b9e5914c0 isort and black 2024-11-09 11:44:15 +03:00
Zakhar Izmaylov 76dd0fd1f6 Migrate logging for loguru 2024-11-09 11:41:48 +03:00
Zakhar Izmaylov ff2c66784d Fix logging 2024-11-09 11:33:17 +03:00
Zakhar Izmaylov c68a5794af Refactoring and fix 2024-11-09 10:36:16 +03:00
Vladless 53a56e00cb v3. Полноценные подписки 2024-11-07 07:53:29 +03:00
Vladless ed55459e37 правки 2024-10-30 00:00:18 +03:00
Vladless 42395ac414 Логи. Уведомления. Тексты 2024-10-25 20:45:12 +03:00
Vladless e0b14d60a2 основной текст в отдельном файле 2024-10-22 01:53:50 +03:00
Vladless 3a12586954 автоввод паролей 2024-10-22 00:30:30 +03:00
Vladless e48cb2c714 Бэкапы. Отправка админу 2024-10-21 23:59:26 +03:00