question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MonitoRSS Heroku manual deploy guide

See original GitHub issue

HEROKU IS ENDING THEIR FREE SERVICES ON NOVEMBER 28 2022

This tutorial will guide you through deploying MonitoRSS (previously called Discord.RSS) on Heroku manually (without using the deploy button).

The deploy button method would require you to verify your Heroku account using your credit card despite it being free. So if you want to try out the bot and see if you like it for example you can follow this guide. Do note that Heroku gives you 550 free hours every month if you don’t verify with a credit card. So if you want the bot to run 24/7 you will need to verify with your credit card to increase your hours to 1000, enough to run the bot for a whole month provided you don’t have any other applications running on your Heroku account.

This guide is based on v6 and the information/screenshots are accurate at the time of this writing.

1. Create Discord bot application

Go to https://discord.com/developers/applications/, create a new application and name it. Then go to the Bot tab, select Add Bot, confirm then name your bot and upload an avatar. This is what your bot will look like in Discord.

If you don’t want others to be able to add your bot turn off the Public Bot setting.

On that same page you will find your Token. You will need this later. Do not share this token with anyone else!!!

2. Invite the bot

Use one of the below URLs replacing the INSERTHERE with the Client ID from the Discord developer portal to invite the bot to your server.

With Role: https://discord.com/oauth2/authorize?client_id=INSERTHERE&scope=bot&permissions=19456 Without Role: https://discord.com/oauth2/authorize?client_id=INSERTHERE&scope=bot

3. Create MongoDB Atlas Database

Go to https://www.mongodb.com/cloud/atlas and create an account if you don’t already have one. Once you’re logged in follow the instructions to create a cluster. Select Shared Clusters, then choose a server region (I suggest on AWS). Make sure the Cluster Tier is M0 and press Create Cluster.

Cluster selection

Server selection

Your cluster will take a few minutes to get ready. During this time go to the Database Access located at the left, press Add New Database User. Choose a username and a password (you will need the password later), check that the User Privileges are set to “Read and Write to any database” and press Add User.

Next you want to go to Network Access, add IP and select Allow Access from Anywhere. Click Confirm.

After your cluster is ready click Connect found in the Overview screen.

image

Select Connect Your Application, set Driver to Node.js and Version 3.6 or later. You will need the connection string later on in this tutorial.

4. Set up Redis database (required for web dashboard)

Next, you will need to set up your free redislabs account. You need to do this if you want the web dashboard. If you are not going to use the web dashboard you can skip this.

First, create an account at https://app.redislabs.com. Select Cloud as your deployment option.

image

Once you have logged in, click the Create your subscription button.

image

Select Essentials, and then the Standard 30 MB free option.

image

On the next screen, ensure the protocol is set to Redis, and that Redis password is enabled (you will need the password later). Set Data Eviction Policy to no eviction.

On the screen you see after this, you will find your connection details. Take note of the endpoint, you will need it later. At the end of the endpoint also includes the port number. You will need that also.

5. Configure config vars

Go to https://dashboard.heroku.com/apps and create a new App. Call it whatever you want. Then select the settings tab.

Add the following config vars:

DRSS_BOT_OWNERIDS - Your Discord User ID (check here if you’re unsure)

DRSS_BOT_PREFIX - Type the prefix you want to use for commands

DRSS_BOT_TOKEN - Your bot token from Discord developer portal.

DRSS_DATABASE_URI - Your MongoDB connection string (replace <password> with your MongoDB password you created earlier and also replace <dbname> with test)

DRSS_FEEDS_REFRESHRATEMINUTES - Set an interval (in minutes) how often you want the bot to check for new content. I suggest 15 mins, some websites may have a rate limit if it’s set to a faster interval

DRSS_FEEDS_TIMEZONE - Set the bot’s default timezone. Use a timezone from this list.

If you want to enable the web dashboard you will have to add the below config vars.

DRSS_START - bot-web

DRSSWEB_BOT_TOKEN - Same as DRSS_BOT_TOKEN

DRSSWEB_BOT_REDIRECTURI - https://herokuappname.herokuapp.com/authorize (replace herokuappname with the name you set your Heroku app)

You will also need to add the above URL under OAuth2 redirect settings in the Discord Developer Portal. If you don’t do this, you will get an error when logging into the web portal.

image

DRSSWEB_BOT_CLIENTID - Your Discord application Client ID, found in developer portal.

DRSSWEB_BOT_CLIENTSECRET - Your Discord application Client Secret, found in developer portal.

DRSSWEB_DATABASE_URI - Same as DRSS_DATABASE_URI

DRSSWEB_DATABASE_REDIS - redis://password@endpoint:port

Remember the password and endpoint details from your redislabs account? Add them in the format given above.

6. Deploy Bot to Heroku

Fork the MonitoRSS-Clone repo by clicking the Fork button at the top right of the page.

image

Go to your bot application on https://dashboard.heroku.com/apps.

Then go to the Deploy tab, select GitHub and connect your account. Search for the repo by typing MonitoRSS then pressing Search. Connect the repo named yourusername/MonitoRSS-Clone.

image

Once you’ve connected your fork, scroll down to manual deploy and deploy the master branch. Once the entire deploy operation has completed, refresh the page.

image

7. Use Freshping to keep the bot running

To prevent your bot from going to sleep by Heroku, create a Freshping account and click Add Check at the top right of the dashboard. Set the check type to HTTP/HTTPS and paste the URL of your Heroku app on the Check URL field. Set the interval to every 5 mins and press Add Check.

image

If you followed all these steps correctly, your bot should be up and running!

If enabled, you can now log into the web UI at https://herokuappname.herokuapp.com and configure your feeds.

Advanced Configuration

You can add additional config vars by following this page. The configuration page lists all the possible configs available.

NEVER LEAVE YOUR TOKEN AND DATABASE URIS ON THE CONFIG.JSON, SOMEONE MAY USE IT AND “HIJACK” THE BOT. If you accidentally gave your token out, regenerate a new token via the Discord developer portal and update the relevant config var in Heroku. For the MongoDB and Redis databases, you can generate a new password via their control panels.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
synzencommented, Mar 18, 2019

Thanks for the writeup and contribution! I’ve added it to the Setup page. I am a bit concerned about the use of images since they can be easily outdated if they decide to update their UI, but it is better than nothing

1reaction
infinitepower18commented, Aug 26, 2022

Sadly Heroku will be terminating their free services this year on Nov 28…

https://blog.heroku.com/next-chapter

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying with Git - Heroku Dev Center
Heroku manages app deployments with Git, the popular version control system. You don't need to be a Git expert to deploy code to...
Read more >
Deploying A Server To Heroku - DEV Community ‍ ‍
After reading this guide, you will learn how to: Deploy servers to Heroku; Manage Environment variables when deploying to Heroku. Getting ...
Read more >
Automate your Deployment on Heroku | by Ankit Jain
Here, we have deployed our project completely on Heroku but it is all done manually and in this way, we have to run...
Read more >
Heroku MongoDB Issue
I was using the Discord Bot service through the Heroku button. It originally worked well. ... MonitoRSS Heroku manual deploy guide.
Read more >
Bot - MonitoRSS
If you're using FreeBSD, more specific instructions can be found here, provided by Ultima. If you're using Heroku, see ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found