Skip to content

Commit

Permalink
Docker in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Jun 8, 2020
1 parent 465ef8e commit 7be2257
Showing 1 changed file with 33 additions and 43 deletions.
76 changes: 33 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 7be2257

Please sign in to comment.