Skip to content

Latest commit

 

History

History
172 lines (120 loc) · 10.3 KB

deployment-guide.md

File metadata and controls

172 lines (120 loc) · 10.3 KB

Deployment Guide

Preparation

Tip

For more env variables and detailed information, read Advanced Settings.

  1. Turn to @BotFather, send /newbot create a new bot, then get its token (env variable: TOKEN). After that, send /setinline, select your bot, and reply with an inline placeholder you like to enable inline mode for your bot. For example, @RSStT_Bot is using Please input a command to continue....
  2. Turn to @userinfobot to get your user ID (env variable: MANAGER).
  3. Get Telegraph API access tokens (env variable: TELEGRAPH_TOKEN). Refresh the page every time you get a new token. If you have a lot of subscriptions, make sure to get at least 5 tokens.

Option 1: Docker Compose

dockeri.co
Build status (master) Build status (dev)

Tip

An x86_64 (amd64) or arm64v8 (aarch64) machine is required. If you need a VPS, Vultr (affiliate link, w/ 14-days-valid $100 trial credit) High Performance (Intel) NVMe SSD Cloud Servers (starting at $6/month) are recommended.

Deploy

mkdir rsstt
cd rsstt
wget https://raw.githubusercontent.com/Rongronggg9/RSS-to-Telegram-Bot/dev/docker-compose.yml.sample -O docker-compose.yml
vi docker-compose.yml  # fill in env variables
docker-compose up -d

Update

docker-compose down
docker-compose pull
docker-compose up -d

Option 2: Railway.app

Tip

Railway accounts without any verified payment method or prepaid balance can only consume 500 execution hours per month, which means that RSStT will be paused after 500 hours of uptime. To get rid of the execution time limit, either associate a credit/debit card to your account or prepaid $5 once. You will get $5 free credit each month without execution time limit, which is pretty enough for RSStT. Except the prepaid balance (if you don't want to associate a credit/debit card), hosting RSStT should be free of charge.
Railway no longer offers free plans. Deploying RSStT on Railway could cost you at least $5 per month (Hobby Plan).

Deploy

master dev (recommended)
Deploy on Railway (master) Deploy on Railway (dev)

After deployed, check the bot log to see if it is using PostgreSQL (postgre), otherwise, all the data will be lost when updating.

Please note that if you deploy RSStT without using the above buttons, you must manually add the PostgreSQL plug-in.

Update

https://railway.app/dashboard -> your RSStT project -> RSS-to-Telegram-Bot -> Settings -> Check for updates

Option 3: Heroku

Tip

Heroku accounts with no verified payment method have only 550 hours of credit per month (about 23 days), and up to 1,000 hours per month with any verified payment methods.
Heroku no longer offers free plans. Deploying RSStT on Heroku could cost you at least $16 per month ($7 for Heroku Dyno and $9 for Heroku Postgres). Railway.app offers lower price and better performance.

Deploy

master dev (recommended)
Deploy to Heroku (master) Deploy to Heroku (dev)

Update

  1. Fork RSStT to your GitHub account.
  2. Use the instant deploy buttons above to deploy RSStT to Heroku.
  3. Switch the Deployment method to GitHub (Deploy tab -> Deployment method) and connect the app to your fork.
  4. Enable Automatic deploys (Deploy tab -> Automatic deploys -> Enable Automatic Deploys).
  5. Each time upstream updates, turn to your fork and switch to the branch you've deployed, then click Fetch upstream and Fetch and merge.

Option 4: Install from PyPI / Dirty run from source

Important

It is highly recommended to set up a virtual environment (venv).

System requirements

Note

RSStT is tested only under the recommended system requirements.

Minimum Recommended
Operating system Linux, Windows, macOS Linux
Architecture x86_64, arm64 x86_64
Python (CPython) 3.9 3.12
Free memory 128MB > 384MB

Prerequisites

Note

These fonts are used for HTML table rendering (to enable it, set the environment variable TABLE_TO_IMAGE to 1). You may use WenQuanYi Zen Hei, WenQuanYI Micro Hei, Noto Sans CJK, Microsoft YaHei, or SimHei.

Debian / Ubuntu

sudo apt install -y fonts-wqy-microhei

Other Linux distributions / Windows / macOS

You know what to do. However, I cannot guarantee that the fonts can be recognized properly by matplotlib.

Option 4.1: Install from PyPI

PyPI TestPyPI PyPI - Implementation PyPI - Python Version
PyPI publish status TestPyPI publish status PyPI - Downloads

Note

The default config folder is ~/.rsstt.

Important

  • python3 -m pip install -U rsstt will install the latest stable version from PyPI, which may be outdated.
  • python3 -m pip install -U --extra-index-url https://test.pypi.org/simple rsstt will install the latest dev version from TestPyPI, which is always up-to-date.
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -U rsstt
# python3 -m pip install -U --extra-index-url https://test.pypi.org/simple rsstt
mkdir -p ~/.rsstt
wget https://raw.githubusercontent.com/Rongronggg9/RSS-to-Telegram-Bot/dev/.env.sample -O ~/.rsstt/.env
vi ~/.rsstt/.env  # fill in env variables
python3 -m rsstt

Option 4.2: Dirty run from source

GitHub repo size GitHub release (latest SemVer including pre-releases) GitHub commits since latest release (by SemVer including pre-releases) GitHub last commit (dev)

Note

The default config folder is ./config, default .env path is ./.env (placing it inside the config folder is also supported).

git clone https://github.com/Rongronggg9/RSS-to-Telegram-Bot.git
cd RSS-to-Telegram-Bot
python3 -m pip install -r requirements.txt
cp .env.sample .env
vi .env  # fill in env variables
python3 -u telegramRSSbot.py

* Advanced command line arguments

  • -h, --help: show the help message and exit
  • -c, --config: path to the config folder