BOT_TOKEN : The telegram bot token that you get from @BotFather.
GDRIVE_FOLDER_ID : This is the folder ID of the Google Drive folder to which you want to upload all the mirrors.
DOWNLOAD_DIR : The path to the folder where the downloads will be downloaded locally, before uploading to Google Drive.
OWNER_ID : The Telegram user ID (not username) of the owner of the bot.
DOWNLOAD_STATUS_UPDATE_INTERVAL : A short interval of time in seconds after which the Mirror progress message is updated (5 seconds at least).
AUTO_DELETE_MESSAGE_DURATION : Interval of time (in seconds), after which the bot deletes its message (and command message) which is expected to be viewed instantly (set to '-1' to never automatically delete messages).
TELEGRAM_API : This is to authenticate to your telegram account for downloading Telegram files. You can get this from here.
TELEGRAM_HASH : This is to authenticate to your telegram account for downloading Telegram files. You can get this from here.
USE_TELEGRAPH : Set to "true" to use Telegra.ph for search results from '/list' bot command, or else set to "false".
IS_TEAM_DRIVE : Set to "true" if GDRIVE_FOLDER_ID is from a Team Drive, or else set to "false" or leave it empty.
USE_SERVICE_ACCOUNTS : Whether to use service accounts or not. For this to work see "Using service accounts" section below.
STOP_DUPLICATE_MIRROR : Set this to "true", if you want to check for duplicate files (using file name, and not file hash) in Google Drive matching the requested download and stop the download if found any.
INDEX_URL : Refer to GDIndex repo. The URL should not have any trailing '/'.
SHORTENER : URL of the Shortener.
SHORTENER_API : API Key of the Shortener.
Supported Shorteners:
> exe.io
> gplinks.io
> shrinkme.io
> urlshortx.com
> shortzon.com
Additionally, some other shorteners are also supported unofficially.
NOTE:
You can limit the maximum concurrent downloads by changing the value of 'MAX_CONCURRENT_DOWNLOADS' in 'aria.sh'. By default, it's set to '3'.
You can limit the maximum download speed by changing the value of 'MAX_DOWNLOAD_SPEED' in 'aria.sh'. By default, it's set to '0' (unlimited).
If you are running this setup script for the first time, enter the appropriate choice in the input prompt and continue to the next step.
Create a new folder in your personal Google Drive, irrespective of the folder you use for uploading files with this bot (no constraints at all).
Change the permissions of this newly created folder to 'Anyone on the Internet with this link can view'.
Enter the FolderId of the newly created folder in the input prompt, and continue with the setup.
For 'DL_WAIT_TIME' reference, see below:
DL_WAIT_TIME : Time to wait for aria2c to download the config files. By default it's set to '5' seconds, which is more than enough for deploying the bot to Heroku. If 'DL_WAIT_TIME' lapses, and the config files are not downloaded due to any reason, the bot exits with exit code (1).
The config files will be uploaded to Google Drive, and then deleted, except for 'dynamic.env'.
The setup script will exit with 'Setup Completed' message.
Now, the docker image can be deployed with 'dynamic.env' file.
NOTE: If you have already run this setup script and want to update the existing config files in drive, enter the appropriate choice in the input prompt. In the next step, enter the FileId of the existing 'dynamic.env' in the input prompt, and the updated files will be uploaded to Google Drive. Now, you can choose to keep the old config files or delete them.
Visit Heroku Dashboard and create a new app with any name (for our reference, your-mirror-bot) and with any region you prefer, for your app to be served from.
In the Deploy tab of your app dashboard, select 'Heroku Git' in Deployment Method.
Change the Stack for the App using Heroku CLI:
heroku stack:set container --app your-mirror-bot
Initialise the project files as a Git Repository, push the Repo to 'Heroku Git' and build the Docker Image:
If the Docker Image Build succeeds, then, your push to the remote repository will succeed, otherwise, your push to the remote repository is rejected as the Docker Image Build fails.