From 7be2257d9e16a4095c6454cbba4a33f4ec5d9ab4 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Tue, 9 Jun 2020 01:09:13 +0300 Subject: [PATCH] Docker in readme --- README.md | 76 ++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 156b0b1..ec8ee02 100644 --- a/README.md +++ b/README.md @@ -3,43 +3,39 @@ RSS/JSON generator for telegram Get posts from my [TelegramApiServer](https://github.com/xtrime-ru/TelegramApiServer) and output them as RSS or JSON. -**Features** +## Features * Fast async Swoole server -* Use as micro-service to access telegram api +* Use as micro-service to access Telegram API * Get any public telegram posts from groups as json or RSS * fail2ban, RPM limits, IP blacklist * Full media support. Access any media from messages via direct links. -**Architecture Example** +## Architecture Example ![Architecture Example](https://hsto.org/webt/j-/ob/ky/j-obkye1dv68ngsrgi12qevutra.png) -**Installation** +## Installation -1. Swoole extension required: [Install swoole](https://github.com/swoole/swoole-src#%EF%B8%8F-installation) -1. Install and run [my telegram client](https://github.com/xtrime-ru/TelegramSwooleClient) -1. Clone this project -1. `composer install` +1. Install and start [Telegram Api Server](https://github.com/xtrime-ru/TelegramApiServer) +1. Clone this project: `git clone https://github.com/xtrime-ru/TelegramRSS.git TelegramRSS` + +Docker: +1. `docker pull docker pull xtrime/telegram-rss` +1. `docker-compose up -d` + +Manual: +1. [Install Swoole php extension](https://github.com/swoole/swoole-src#%EF%B8%8F-installation) +1. `composer install -o --no-dev` - _Optional:_ -1. Create .env from .env.example -1. Edit .env if needed -1. Use supervisor to monitor and restart swoole servers. Example of `/etc/supervisor/conf.d/telegram_rss.conf`: - ``` - [program:telegram_rss] - command=/usr/bin/php /home/admin/web/tg.i-c-a.su/TelegramRSS/server.php - numprocs=1 - directory=/home/admin/web/tg.i-c-a.su/TelegramRSS/ - autostart=true - autorestart=true - stdout_logfile=none - redirect_stderr=true - ``` -1. Nginx config +## Setup +1. Edit `.env` or `.env.docker` if needed. +1. Restart RSS server. +1. [Run in background](https://github.com/xtrime-ru/TelegramApiServer#run-in-background) +1. Example of Nginx config ``` server { listen %ip%:443 ssl; - server_name tg.i-c-a.su www.tg.i-c-a.su; + server_name tg.i-c-a.su; ssl_certificate /home/admin/conf/web/ssl.tg.i-c-a.su.pem; ssl_certificate_key /home/admin/conf/web/ssl.tg.i-c-a.su.key; @@ -59,28 +55,22 @@ Get posts from my [TelegramApiServer](https://github.com/xtrime-ru/TelegramApiSe } } - - ``` + ``` -**Usage** -1. Run [client](https://github.com/xtrime-ru/TelegramSwooleClient) -1. Check that address and port of client are correct in .env file -1. run rss server `php server.php` +## Examples +* https://tg.i-c-a.su/json/breakingmash +* https://tg.i-c-a.su/rss/breakingmash +* Custom limit: https://tg.i-c-a.su/rss/breakingmash?limit=50 + + Maximum: 100 posts + +* Pagination: https://tg.i-c-a.su/rss/breakingmash/2 +* https://tg.i-c-a.su/media/breakingmash/10738/preview +* https://tg.i-c-a.su/media/breakingmash/10738 - Examples: - - * https://tg.i-c-a.su/json/breakingmash - * https://tg.i-c-a.su/rss/breakingmash - * Custom limit: https://tg.i-c-a.su/rss/breakingmash?limit=50 - - Maximum - 100 posts - * Pagination: https://tg.i-c-a.su/rss/breakingmash/2 - * https://tg.i-c-a.su/media/breakingmash/10738/preview - * https://tg.i-c-a.su/media/breakingmash/10738 - - Default address of rss server is `http://127.0.0.1:9504/` +Default address of RSS server is `http://127.0.0.1:9504/` -**Contacts** +## Contacts * Telegram: [@xtrime](tg://resolve?domain=xtrime) * Email: alexander(at)i-c-a.su