Skip to content

synzen/MonitoRSS

Repository files navigation

MonitoRSS (formerly Discord.RSS)

Delivers highly-customized news feeds to Discord!

Get Started

Use Public Instance

To use the publicly hosted instance for free, visit https://monitorss.xyz!

Self Host

Docker is required to easily coordinate and run multiple services at once.

Note

General knowledge of how Docker, Docker volumes, and docker compose works is highly recommended to avoid accidental data loss

Note

Request history and delivery logs stored in PostgreSQL are not meant to be persistent forever. They may be removed when PostgreSQL versions are upgraded.

  1. Install Docker Engine
  2. Install Docker Compose
  3. Clone this repo's main (the default) branch - git clone https://github.com/synzen/MonitoRSS.git
  4. Create a Discord application through Discord's developer portal if you do not already have one
  5. Create a copy of the existing .env.example file and rename it to .env
  6. Replace all relevant values in the .env file with your own values
    1. If you have your own MongoDB instance, set BACKEND_API_MONGODB_URI to your MongoDB URI
    2. Add your email at the end of FEED_REQUESTS_FEED_REQUEST_DEFAULT_USER_AGENT for feed hosts to be able to contact you if you violate their usage policies. For example, MonitoRSS [Self-Hosted]/1.0 [email protected].
    3. Replace all instances of "BOT_TOKEN_HERE" with your Discord bot application token
    4. Replace all instances of "BOT_CLIENT_ID_HERE" with your Discord bot application ID
    5. Replace all instances of "BOT_CLIENT_SECRET_HERE" with your Discord bot application secret
    6. Set BACKEND_API_SESSION_SECRET to a random 64-character string
    7. Set BACKEND_API_SESSION_SALT to a random 16-character string
    8. Add http://localhost:8000/api/v1/discord/callback-v2 to the list of redirect URIs in your Discord application in the OAuth2 page
  7. Run docker compose up -d. Make sure all containers, except those with "migration" in it, are running via docker ps.
    • If you run into issues with network timeouts, pass the parallel flag to only build 1 container at once: docker compose --parallel 1 up -d
    • Any containers ending in -migration do not need to be running
    • If any containers are failing to start, troubleshoot by getting the last few logs for the container with docker logs <container_name or ID> --tail 100
  8. Access the control panel via http://localhost:8000

Customize Site Domain

  1. Set up your domain to point to the server running the control panel on localhost
  2. Update all references to http://localhost:8000 in your .env to your desired domain. For example, https://mynewdomain.com.
  3. Add {DOMAIN_HERE}/api/v1/discord/callback-v2 to the list of redirect URIs in your Discord application in the OAuth2 page, replacing {DOMAIN_HERE} with the value you set in step 1

Enable Email Notifications

While email notifications are available so that you may get notified when feeds are disabled for various reasons (permission erorrs, request errors, etc), credentials must be set to be able to send them out. Set the three variables below with your email provider's SMTP settings in your env file:

  • BACKEND_API_SMTP_HOST
  • BACKEND_API_SMTP_USERNAME
  • BACKEND_API_SMTP_PASSWORD
  • BACKEND_API_SMTP_FROM

Make sure to opt into email notifications in the control panel's user settings page afterwards.

Enable Reddit Authorizations

  1. Create a Reddit application at https://www.reddit.com/prefs/apps as a "web app".
  2. Add {DOMAIN_HERE}/api/v1/reddit/callback to the list of redirect URIs in your Reddit application settings, replacing {DOMAIN_HERE} with your domain that you're using to access the control panel.
  3. Copy the redirect URI you just added and set it as BACKEND_API_REDDIT_REDIRECT_URI in your .env file.
  4. Copy the Reddit application's client ID (under "web app" label) and set it as BACKEND_API_REDDIT_CLIENT_ID in your .env file.
  5. Copy the Reddit application's secret and set it as BACKEND_API_REDDIT_CLIENT_SECRET in your .env file.
  6. Generate a random 64-digit hexadecimal string and set it as BACKEND_API_ENCRYPTION_KEY_HEX in your .env file. One option is to use an online generator such as this one.

Updating

Releases follow semantic versioning and are published on the Releases page. To update:

  1. Back up your MongoDB data as a precaution (regular backups are a good idea regardless)
  2. Stop containers with docker compose rm --stop -f
  3. Set your desired version in the .env file by updating MONITORSS_VERSION (e.g., MONITORSS_VERSION=7 for version 7)
  4. Pull latest images with docker compose pull
  5. Start containers with docker compose up -d
Major Version Updates

Breaking changes to either the application and Docker compose files may happen between major versions. Check the Releases page for instructons on upgrading major versions.

Migrating from v6

If you've been using MonitoRSS v6 (used by the repo https://github.com/synzen/MonitoRSS-Clone), then these are instructions to migrate off of that repo to use the latest changes.

It's recommended that you don't delete your v6 files until you've confirmed that all your feeds are working as expected post-migration.

  1. Follow the instructions above to self host. Be sure to clone this repo - the clone repo is no longer used or maintained.
  2. In your .env file, set BACKEND_API_MONGODB_URI to your MongoDB URI
  3. Run docker compose --parallel 1 up -d --build
    • If you run into issues with network timeouts, pass the parallel flag to only build 1 container at once: docker compose --parallel 1 up -d
  4. Convert legacy feeds to personal feeds using the migration script below. Legacy feed articles will not be fetched/delivered until they are converted.
  5. After verifying that all is working as expected, you may delete your v6 files.

Converting Legacy Feeds

Legacy feeds must be converted to personal feeds before they will deliver articles. After starting up all containers, run the migration script:

# Enter the monolith container
docker compose exec monolith sh

# Dry run first to preview (replace YOUR_DISCORD_USER_ID)
node dist/scripts/migrate-all-legacy-feeds.js --user YOUR_DISCORD_USER_ID --guild "*" --dry-run

# Run the actual migration
node dist/scripts/migrate-all-legacy-feeds.js --user YOUR_DISCORD_USER_ID --guild "*"
Option Required Description
--user <id> Yes Discord user ID to own all converted feeds
--guild <ids> Yes Comma-separated guild IDs, or * for all guilds
--dry-run No Preview without database changes