Setup Your Own TTRss
We need to protect our privacy currently in this big data world. We’re hardly to get we want. The information has exploded in our life. We need to filter the information we wanted now. Using RSS is a good choice to do that. And TTRss is a option to do that.
Docker Compose
We have a lot of options to setup TTRss. But the most convenient way is to use docker. We will expose four services. They are Postgres which is a database, TTRss, mercury which is plugin and nginx.
1 | version: "3" |
Note
The environment variable SELF_URL_PATH should be the site which you want to visit in your browser.
Nginx
Nginx is reverse proxy tool. Nginx will help to load balance, hide the real port and use https.
1 | user nginx; |
Note:
Nginx is a container or binary code. Nginx can communicate with other container directly if nginx is a container.
Small Enhancements
There is a limitation that 15 seconds will be timeout of TTRss.
Change code
1
2
3
4
5
6
7
8
9
10
11# Add following line
$function_path = '/var/www/include/functions.php';
$fetch_timeout = env('FETCH_TIMEOUT',60);
# At last of function if(dbcheckconn($config))
file_put_contents($confpath, $contents);
$contents = file_get_contents($function_path);
$contents = preg_replace('/(define_default\(\'FILE_FETCH_CONNECT_TIMEOUT\',\s*)(\d+)(\);)/','${1}'.$fetch_timeout.'${3}',$contents);
$contents = preg_replace('/(define_default\(\'FEED_FETCH_NO_CACHE_TIMEOUT\',\s*)(\d+)(\);)/','${1}'.$fetch_timeout.'${3}',$contents);
file_put_contents($function_path, $contents);change environment
1
export FETCH_TIMEOUT=60
restart container
Note:
This change can be updated in the docker image.
Plugins
You can install plugins.
How to install
You can follow the workflow:
1 | # Go to the plugins.local fold |
Note:
The fold name must be fit with the plugin name in the {plugin}/init.php and the fold name must be lowercase and _.
e.g:
The name of plugin is Af_Zz_NoAutoPlay. The fold name should be af_zz_noautoplay.
How to remove
There are two ways to remove the plugins:
- You can delete the plugin in the UI
- You can remove the files of plugin.
FAQ
There’re some normal issues. The solutions are as follows.
Using docker-compose
Run docker-compose to up services.
1 | docker run --rm \ |
Save docker-compose as an alias:
1 | echo alias docker-compose="'"'docker run --rm \ |
Dump SQL Data
Dump SQL Data from Postgres Database
1 | docker exec {Container_Name} pg_dumpall -c -U postgres > export.sql |
Note:
-u: username of the postgres database.
Restore SQL Data
Restore the SQL Data to Postgres Database
1 | cat export.sql | docker exec -i {Container_Name} psql -U postgres |
Upload File To VPS
using scp
1 | scp -i ~/.ssh/id_rsa file RemoteHostName@IP:PATH |
We also can use scp to download the file from VPS.
DNS ISSUE
add a nameserver to resolve the hostname
1 | vi /etc/resolv.conf |
This blog is under a CC BY-NC-SA 3.0 Unported License
Link to this article: https://younggod.netlify.app/2020/04/30/Practice/TTRss/