Important
This release is just made to get the last year of changes out of the door and work on the refactor.
While it is technically better and more stable than 7.0.0a (even given that other tag releases have been made), still consider it beta territory.
Development will start again, starting today ! I will probably change my mind again regarding to the versioning but overall you should expect changes of v7-rework-part-1 to land in a v7.4 soon and future work will happen directly on v7.
Once the refactor is feature-complete, all of this will be merged into master for a v8 release.
GitHub releases will be used more extensively to document changes of the code. Older releases might be "back-created" if possible.
The changelog file will be updated later.
BREAKING CHANGES
⚠️ Security fix : The bot is no longer vulnerable to user attacks, see GHSA-34cg-7f8c-fm5h / CVE-2024-53992 for more info (this fix have been present sincev7.0.3a)- Uses
asyncio.create_subprocess_shell()instead of the hackish way that was present before - Uses
shlexto sanitize user input for shell commands (file paths and archive passwords)
- Uses
- The start of the bot is finally
async, although it hasn't been fully tested. This might cause issues. So far I had none but the implementation might be flaky. To be continued... - Use a
pyproject.tomlfile - All function calls now use named arguments, as far as Pylance reported them
- Strings processing is entirely redone
- ALL strings are in JSON files, which will help with future translation
- Only English supported for now
- Deleted unused strings, moved plain text to the JSON, fixed grammar mistakes
- Split buttons and messages processing
- Added a default language that gets used for non-user tied strings and logs
- Untranslated strings fall back to English (or default language)
- String keys aren't definitives, hence why I haven't already started a French translation
- Implemented a memory limit on ran commands to avoid
R14andR15errors on Heroku (first usingresourcethenulimit) (this might potentially cause poorer performance. furthermore,psutilseems a bit broken on Heroku)- Set a manual limit of RAM in Heroku (80% of 512 MB, can be manually changed) to avoid getting the limit being pulled from system info (wrong data as it gets it from the entire host)
- Limit CPU usage too using
cpulimit- Gets maxed at 80% of the current amount of cores for shell tasks
- Ensures enough room is left to the bot process
- Migrate from
pyrogramtopyroblack, nokurigram, nopyrofork(v8 will be good enough to probably settle onpyroblack, we'll see) - Creates a lock file on start
- Deletes it in case of errors/shutting down
- Restricts users from processing archives when the bot hasn't started yet
- Reduces the number of FloodWaits by reducing the number of messages sent/edited and not displaying an upload progressbar for files under 50 Mb, also handles FloodPremiumWait
- Let pyrogram handle floodwaits up to 2h
Features
- Split RAR archives are finally supported 🥳
- Added
MONGODB_DBNAMEas an option for Heroku deployment - More commands that were restricted to the Bot Owner can now be run outside of DM, ex in the logs group (if they're not anonymous)
- Users can finally cancel a task (see #28), however it doesn't work perfectly for split archives download for example
- The canceled task list is cleared at each restart and every 5 min
/restartand/gitpullnow sends logs to the logs channel- Cleans the download dir on startup (especially helps when the bot is running with a volume attached)
- Already present thumbnails aren't downloaded on a start (useful when they are stored in a volume)
Bug fixes
- Simplifies the way we pass data to the
Messages.get()i18n function, allows to use named arguments - Remove null and temp values for the thumbs db
- Download the thumbs only after removing any previous tasks
7zipis now installed from theedgerepository to fix an issue with volumes creation- During the split of a file, it is now moved to a temp location to avoid filename clash
- The bot now stops properly when sent
SIGKILL - Fixed an oversight where
ffmpegcommands were thread blocking - Stop using
return awaitin async functions - Shell commands are no longer using
shlex.jointo avoid several issues with path interpretation - Video duration is properly parsed now, and the logic to catch non generated thumbnail is simplified
- Fixed
/execnot being able to run properly - Removed an infinite loop that caused the bot to never go idle
- Assume yes on all
unrarcommands - Correctly escapes non-Unicode characters in shell output and buttons filenames
Other
- Reworked the GitHub files
- Unquote example env vars
- Bump python (3.12.7 => 3.12.10)
- Add VS Code configs
- Use uv
- Use ruff instead of Black
- Added labels to the Docker image
- Removed copyright mentions in files, added MIT notice in the start script
- Shell commands now uses
bashinstead ofsh - Bump all deps
- Private functions have a more coherent naming
- Removal of duplicate logic
- Correctly display the unrar version on the build script (to be replaced with
EDM115/unrar-alpine) - Changed a bit the versioning scheme, see #296 (comment)
What's Changed
- chore(dependencies): update dependency pillow to v10.2.0 - autoclosed by @renovate[bot] in #259
- Apply Black code style by @github-actions[bot] in #273
- chore(dependencies): update dependency aiohttp to v3.9.2 [security] by @renovate[bot] in #277
- chore(dependencies): update dependency aiohttp to v3.9.3 by @renovate[bot] in #278
- chore(dependencies): update peter-evans/create-pull-request action to v6 by @renovate[bot] in #279
- chore(dependencies): update dependency gitpython to v3.1.42 by @renovate[bot] in #280
- chore(dependencies): update dependency dnspython to v2.6.0 by @renovate[bot] in #281
- chore(dependencies): update dependency dnspython to v2.6.1 by @renovate[bot] in #283
- Create tech stack docs (techstack.yml and techstack.md) by @stack-file[bot] in #284
- chore(dependencies): update dependency motor to v3.4.0 by @renovate[bot] in #293
- chore(dependencies): update dependency gitpython to v3.1.43 by @renovate[bot] in #292
- chore(dependencies): update dependency pillow to v10.3.0 by @renovate[bot] in #294
- [dependabot/pip] (deps): Bump aiohttp from 3.9.3 to 3.9.4 by @dependabot[bot] in #299
- chore(dependencies): update dependency aiohttp to v3.9.5 by @renovate[bot] in #297
- refactor: merge collapsible
withstatements by @deepsource-autofix[bot] in #300 - chore(dependencies): update dependency requests to v2.32.0 by @renovate[bot] in #301
- chore(dependencies): update dependency requests to v2.32.1 by @renovate[bot] in #302
- chore(dependencies): update dependency requests to v2.32.2 by @renovate[bot] in #303
- chore(dependencies): update dependency requests to v2.32.3 by @renovate[bot] in #305
- chore(dependencies): update docker/build-push-action action to v6 by @renovate[bot] in #307
- chore(dependencies): update dependency motor to v3.5.0 by @renovate[bot] in #312
- chore(dependencies): update dependency pillow to v10.4.0 by @renovate[bot] in #315
- chore(dependencies): update dependency motor to v3.5.1 by @renovate[bot] in #319
- chore(dependencies): update dependency aiohttp to v3.10.0 by @renovate[bot] in #327
- Apply Black code style by @github-actions[bot] in #328
- chore(dependencies): update dependency psutil to v6 by @renovate[bot] in #308
- chore(dependencies): update dependency aiofiles to v24 by @renovate[bot] in #311
- chore(dependencies): update dependency unzip-http to v0.6 by @renovate[bot] in #317
- chore(dependencies): update dependency aiohttp to v3.10.1 by @renovate[bot] in #331
- Apply Black code style by @github-actions[bot] in #332
- chore(dependencies): update dependency aiohttp to v3.10.2 by @renovate[bot] in #334
- chore(dependencies): update dependency aiohttp to v3.10.3 by @renovate[bot] in #335
- chore(dependencies): update dependency aiohttp to v3.10.4 by @renovate[bot] in #338
- chore(dependencies): update dependency aiohttp to v3.10.5 by @renovate[bot] in #339
- chore(dependencies): update peter-evans/create-pull-request action to v7 by @renovate[bot] in #340
- Apply Black code style by @github-actions[bot] in #341
- chore(dependencies): update dependency motor to v3.6.0 by @renovate[bot] in #343
- chore(dependencies): update dependency aiohttp to v3.10.6 by @renovate[bot] in #344
- chore(dependencies): update dependency aiohttp to v3.10.7 by @renovate[bot] in #346
- chore(dependencies): update dependency aiohttp to v3.10.8 by @renovate[bot] in #347
- chore(dependencies): update dependency aiohttp to v3.10.9 by @renovate[bot] in #348
- chore(dependencies): update dependency dnspython to v2.7.0 by @renovate[bot] in #349
- chore(dependencies): update dependency aiohttp to v3.10.10 by @renovate[bot] in #350
- chore(dependencies): update actions/checkout action to v4 by @renovate[bot] in #351
- chore(dependencies): update dependency pillow to v11 by @renovate[bot] in #353
- chore(dependencies): update dependency psutil to v6.1.0 by @renovate[bot] in #354
- chore(dependencies): update dependency aiohttp to v3.11.14 by @renovate[bot] in #403
- chore(dependencies): update dependency pyrofork to v2.3.60 by @renovate[bot] in #404
- chore(dependencies): update dependency aiohttp to v3.11.15 by @renovate[bot] in #406
- chore(dependencies): update dependency pillow to v11.2.0 by @renovate[bot] in #407
- chore(dependencies): update dependency aiohttp to v3.11.16 by @renovate[bot] in #408
- chore: update config files [skip ci] by @EDM115 in #409
- chore(dependencies): update dependency pyrofork to v2.3.61 by @renovate[bot] in #410
- fix(dependencies): update dependency wheel to v0.46.1 by @renovate[bot] in #411
- fix(dependencies): update dependency pillow to v11.2.1 by @renovate[bot] in #412
- fix(dependencies): update dependency setuptools to v78.1.1 by @renovate[bot] in #414
- fix(dependencies): update dependency aiohttp to v3.11.17 by @renovate[bot] in #415
- fix(dependencies): update dependency setuptools to v79 by @renovate[bot] in #416
- fix(dependencies): update dependency aiohttp to v3.11.18 by @renovate[bot] in #417
- fix(dependencies): update dependency setuptools to v79.0.1 by @renovate[bot] in #418
- fix(dependencies): update dependency setuptools to v80 by @renovate[bot] in #419
- fix(dependencies): update dependency setuptools to v80.1.0 by @renovate[bot] in #420
New Contributors
- @github-actions[bot] made their first contribution in #273
Full Changelog: 6.3.3...7.3.0