-
Notifications
You must be signed in to change notification settings - Fork 11
Recovery System
The Recovery System is a special service by HyperUBot. It should help the user to be able to recover the userbot from backups or generating new backups to be on the safe side. It's also responsible to apply new updates for HyperUBot. This page will explain the usage and the options the Recovery System does offer.
Do not delete the Recovery System. This will break the update mechanism of HyperUBot!
To start into the Recovery System, locate to HyperUBot's directory and run the following command:
-
Docker: Run docker image/container then select
Recovery System
-
POSIX systems:
python3 recovery.py
(if it fails, try it by python version e.g.python3.8 recovery.py
) -
Windows:
python recovery.py
There are some options such as start options to HyperUBot, applying updates manually or reinstall the whole userbot.
This option will open a submenu which allow the user to decide to start the userbot in normal or special mode
Starts the userbot in normal mode without any special argument
Starts the userbot in a special mode with the following restrictions:
- Disabled user modules
- Only
UBOT_LANG
config will be loaded from optional configurations (if available)
This is useful to remove broken/faulty modules without getting spammed with errors.
Similar to Safe mode
but with additional restrictions:
- Includes everything from safe mode
- Only core built-in modules
Core built-in modules are:
- Feauture Manager
- Modules Utils
- Package Manager
- System Tools
- Updater
Starts the userbot in an emergency mode with the following restrictions:
- Includes everything from advanced safe mode
- Disabled all modules
- Optional configs will not be loaded at all
This option is very unlikely to need but useful to check if crashes are caused by built-in modules and/or optional configs.
Note:
Start HyperUBot
is not available on Windows
Clears the generated CPython caches in HyperUBot. Useful to remove leftovers from deleted modules.
The Recovery System also offers an option to apply bot updates manually. To do so, you need to get update.zip
, it's rules.py
and create the required directory manually before you start the recovery.
Locate to HyperUBot's directory and run the following commands one by one in your terminal:
mkdir releases
get_release=$(curl -H "Accept: application/json" "https://api.github.com/repos/prototype74/HyperUBot/releases/latest")
zip_pkg=$(grep '"zipball_url"' <<< "$get_release" | cut -d '"' -f4)
rul_py=$(grep '"browser_download_url"' <<< "$get_release" | cut -d '"' -f4)
curl -L "$zip_pkg" --output ./releases/update.zip
curl -L "$rul_py" --output ./releases/rules.py
Check in releases directory if update.zip
and rules.py
exists or if the file sizes are not zero. Simply check it by executing ls -l releases
in your terminal.
Locate to HyperUBot's directory and run the following commands one by one in PowerShell:
New-Item -Path . -Name "releases" -ItemType "directory"
$get_release = Invoke-WebRequest -Uri "https://api.github.com/repos/prototype74/HyperUBot/releases/latest"
$json_obj = ConvertFrom-Json $([String]::new($get_release.Content))
$zip_pkg = $json_obj.zipball_url
$rul_py = $json_obj.assets.browser_download_url
Invoke-WebRequest $zip_pkg -OutFile .\releases\update.zip
Invoke-WebRequest $rul_py -OutFile .\releases\rules.py
Check in releases directory if update.zip
and rules.py
exists or if the file sizes are not zero. Simply check it by executing Get-ChildItem -Path releases
in PowerShell.
Go to the Releases section of HyperUBot's repository. To the left side bar (mobile version: on top) there is the commit ID below (mobile version: it's next to) the tag version e.g. c2c04f6
(v6.3.1 release) with a green check mark. Copy the ID, you will need it to apply the recently downloaded update.
- Start the Recovery System now
- Select
Apply update
option - Input the commit ID
- Wait for the Recovery to finish the update
That's it! It's definitely more complex than the automatic way, the Updater module usually do. So apply update manually only if it's actually necessary.
This will backup the current installed version. Generated backups are stored in a backup
folder in HyperUBot's directory. If a backup with the same version does exist already, the Recovery System will overwrite the old backup archive.
Lists generated backups and restores the selected backup archive.
Warning: performing a restore CANNOT be undone!
This option will delete all downloaded user modules, the configurations including the string session and any other data in HyperUBot's directory. At last, the latest release will be installed automatically and you have to setup everything again
Warning: this process CANNOT be undone!
It may be possible that the Recovery System does display information on top of the Main menu (colored).
Some options will be colored to yellow, it's just a warning that these options can break the git history of your git repository. If you take changes in the source then you shouldn't ignore this warning.
Similar to Directory is a local git repository
the only difference is the Recovery System wasn't able to detect the actually git history but detected an initialized .git
folder.
Displays the current installed version. If it's Unknown
it could be possible that HyperUBot isn't installed at all, installed but broken or an older version is installed.
This means as it is mentioned above, the userbot isn't installed and many options will be disabled. This could happen after a failed update or due to other reasons that made the userbot
directory unusable. The possible options are to restore a backup or in worst case reinstalling the userbot.
HyperUBot - A customizable, modular Telegram userbot, with innovative components.
Copyright © 2020-2023 nunopenim & prototype74, licensed under PEL