Add tutorial deploying on Heroku with heroku-cli and Goorm IDE

By https://t.me/katarina_ox
This commit is contained in:
Hafitz Setya 2021-05-12 16:51:36 +07:00 committed by GitHub
parent 10d3221d90
commit 7dd2997586
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 44 deletions

View File

@ -99,6 +99,8 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **STOP_DUPLICATE_MIRROR**: (Optional field) (Leave empty if unsure) if this field is set to `True`, bot will check file in drive, if it is present in Drive, downloading will be stopped. (Note: File will be checked using filename, not using filehash, so this feature is not perfect yet)
- **ENABLE_FILESIZE_LIMIT**: Set it to `True` if you want to use `MAX_TORRENT_SIZE`.
- **MAX_TORRENT_SIZE**: To limit the Torrent mirror size, Fill The amount you want to limit, examples: if you fill `15` it will limit `15gb`.
- **HEROKU_API_KEY**: (Only if you deploying on Heroku) Your Heroku API key, get it from https://dashboard.heroku.com/account.
- **HEROKU_APP_NAME**: (Only if you deploying on Heroku) Your Heroku app name.
- **IMAGE_URL**: (Optional field) Show Image/Logo in /start message. Fill value of image your link image, use telegra.ph or any direct link image.
- **UPTOBOX_TOKEN**: Uptobox token to mirror uptobox links. Get it from [Uptobox Premium Account](https://uptobox.com/my_account).
- **SHORTENER_API**: Fill your Shortener api key if you are using Shortener.
@ -151,50 +153,8 @@ sudo docker run mirrorbot
**NOTE**: If you didn't upload **token.pickle**, uploading will not work. How to generate **token.pickle**? [Read here](https://github.com/breakdowns/slam-mirrorbot#getting-google-oauth-api-credential-file)
<p><a href="https://heroku.com/deploy"> <img src="https://img.shields.io/badge/Deploy%20To%20Heroku-blueviolet?style=for-the-badge&logo=heroku" width="200""/></a></p>
## Deploying on Heroku using heroku-cli
<details>
<summary><b>Click here for more details</b></summary>
- Install [heroku-cli](https://devcenter.heroku.com/articles/heroku-cli)
- Login into your Heroku account with command:
```
heroku login
```
- Create a new Heroku app:
```
heroku create appname
```
- Select This App in your Heroku-cli:
```
heroku git:remote -a appname
```
- Change Dyno Stack to a Docker Container:
```
heroku stack:set container -a appname
```
- Add Private Credentials and Config Stuff:
```
git add -f credentials.json token.pickle config.env heroku.yml
```
- Commit new changes:
```
git commit -m "Added Creds."
```
- Push Code to Heroku:
```
git push heroku master --force
```
- Restart Worker by these commands, You can Do it manually too in Heroku.
- For Turning off the Bot:
```
heroku ps:scale worker=0 -a appname
```
- For Turning on the Bot:
```
heroku ps:scale worker=1 -a appname
```
</details>
## Deploying on Heroku with heroku-cli and Goorm IDE
<p><a href="https://telegra.ph/How-to-Deploy-a-Mirror-Bot-to-Heroku-with-CLI-05-06"> <img src="https://img.shields.io/badge/see%20on%20telegraph-grey?style=for-the-badge" width="190""/></a></p>
## Bot commands to be set in [@BotFather](https://t.me/BotFather)

View File

@ -28,6 +28,9 @@ IMAGE_URL = "https://telegra.ph/file/db03910496f06094f1f7a.jpg"
# Change ENABLE_FILESIZE_LIMIT = True if you want to use MAX_TORRENT_SIZE
ENABLE_FILESIZE_LIMIT = false
MAX_TORRENT_SIZE = 15
# Fill only if you deploying on heroku-cli
HEROKU_API_KEY = ""
HEROKU_APP_NAME = ""
# Add more buttons (two buttons are already added of file link and index link, you can add extra buttons too, these are optional)
# If you don't know what are below entries, simply leave them, Don't fill anything in them.
BUTTON_THREE_NAME = ""