-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MonitoRSS Heroku manual deploy guide #95
Comments
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 |
How i can deploy manually discord rss bot without web dashboard? |
@Anonymyous678 skip step 4, and on step 5 skip adding |
I'm having a similar problem. I have never used Heroku before, so a preexisting app shouldn't be the cause, at least for me. |
Are you using an existing bot application from Discord? |
I'm using a new one, created just for this purpose. |
Mine does work most of the time, but sometimes it just breaks and I have to restart it a few times to get it working again. And even when it's working normally, I still get the Cannot read property 'data' of null warning. |
This line is confusing me a bit: DRSS_DATABASE_URI - Your MongoDB connection string (replace with your MongoDB password you created earlier and also replace with test) Remember the password and endpoint details from your redislabs account? Add them in the format given above. What exactly does that mean? Am I adding another line of DRSS_DATABASE_URI with those credentials? |
Sorry that was for DRSSWEB_DATABASE_REDIS. I have updated the guide. |
I'm trying to deploy my bot but whenever I do the manual deploy it ends with an error and the dashboard isn't online either. nevermind. I figured out I got my timezone settings wrong. Didn't realize I had to use the tz name instead of the time |
@siphyshu fixed, thanks |
How can I use freshping to ping MongoDB instead? |
@MicaelJarniac Have you solved this problem? I still fail sometimes, as you said. And it hasn't worked recently and some data has been lost. |
I haven't used MonitoRSS in quite a while, and honestly don't even remember how I've set it up. |
@tecaspt you don't need to ping the MongoDB database. It only pauses if you don't use the bot for several weeks |
There's something wrong. I tried to install the bot in the same way, but it failed. I think there was a problem as MongoDB was updated. |
Sadly Heroku will be terminating their free services this year on Nov 28… |
Is there any easy way for me to move the current bot within 10 dollars? If you have, please share it with me. |
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.
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.
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.
Once you have logged in, click the Create your subscription button.
Select Essentials, and then the Standard 30 MB free option.
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 commandsDRSS_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>
withtest
)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 intervalDRSS_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-webDRSSWEB_BOT_TOKEN
- Same asDRSS_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.
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 asDRSS_DATABASE_URI
DRSSWEB_DATABASE_REDIS
- redis://password@endpoint:portRemember 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.
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
.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.
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.
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.
The text was updated successfully, but these errors were encountered: