teddit/README.md

110 lines
3.3 KiB
Markdown
Raw Normal View History

2020-11-17 21:44:32 +01:00
# teddit
2020-11-17 22:02:20 +01:00
[teddit.net](https://teddit.net)
2020-11-17 21:44:32 +01:00
A free and open source alternative Reddit front-end focused on privacy.
Inspired by the [Nitter](https://github.com/zedeus/nitter) project.
* No JavaScript or ads
* All requests go through the backend, client never talks to Reddit
* Prevents Reddit from tracking your IP or JavaScript fingerprint
* Lightweight (teddit frontpage: ~30 HTTP requests with ~270 KB of data downloaded vs. Reddit frontpage: ~190 requests with ~24 MB)
XMR: 832ogRwuoSs2JGYg7wJTqshidK7dErgNdfpenQ9dzMghNXQTJRby1xGbqC3gW3GAifRM9E84J91VdMZRjoSJ32nkAZnaCEj
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
BTC: bc1qlcrmt2pvlh4eq69l3l4h6z5jg74z2m2q3pasan
## Installation
2020-11-17 22:42:41 +01:00
This is a quick guide how to run teddit on your own server. Change teddit.net to your own domain in the following steps. Tested on fresh install of Debian 10. Run as root:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# apt update && apt upgrade`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# curl -sL https://deb.nodesource.com/setup_14.x | bash -`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# apt install -y nodejs redis-server ffmpeg git curl certbot` *leave ffmpeg out if you don't want video support*
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# adduser teddit`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# mkdir -p /home/teddit/letsencrypt/`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# mkdir -p /home/teddit/letsencrypt/`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# mkdir -p /home/teddit/letsencrypt/logs/`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# mkdir -p /home/teddit/letsencrypt/lib/`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# chown teddit:teddit -R /home/teddit/letsencrypt/`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080` *route port 8080 to 80*
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8088` *route port 8088 to 443*
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# apt install iptables-persistent` *save iptables configuration to be persistent*
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Edit redis.conf file and set **maxmemory** value suitable for your server (e.g. 75% of your total RAM):
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# nano /etc/redis/redis.conf`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Add this to the end of the file:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`maxmemory 2gb`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Also add maxmemory-policy:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`maxmemory-policy volatile-ttl`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Save and exit the file.
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Restart redis:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# systemctl restart redis`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Let's log in for teddit user.
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`# su - teddit`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ git clone https://codeberg.org/teddit/teddit`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ cd teddit`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ npm install && npm update`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Let's obtain certificates. Run HTTP server:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ nohup node setup_server.js </dev/null &>/dev/null &`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Then run certbot. Change your email ("ADD_YOUR_EMAIL_ADDRESS@SOMETHING.ORG") and domain.
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ certbot certonly --webroot -w /home/teddit/teddit/dist/ -d teddit.net --agree-tos --no-eff-email --manual-public-ip-logging-ok --config-dir /home/teddit/letsencrypt/ --logs-dir /home/teddit/letsencrypt/logs/ --work-dir /home/teddit/letsencrypt/lib/ --email ADD_YOUR_EMAIL_ADDRESS@SOMETHING.ORG`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Kill the node HTTP server:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ ps aux | grep node`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ kill -9 [PID HERE]`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Change config variables in app.js, domain and Reddit app ID. Note: It's recommended that you get your own Reddit app ID. For testing purposes it's okay to use this project's default app ID. Create your Reddit app here: [https://old.reddit.com/prefs/apps/](https://old.reddit.com/prefs/apps/) and update its ID to the app.js. Make sure to create an "installed app" type of app.
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ nano app.js`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Save and exit.
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
Now let's start teddit:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ nohup node app.js > output.log &`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
If everything went okay, you should have teddit instance running on your domain with a valid SSL certificate.
If you see the output.log:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
`$ tail -f output.log`
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
You should see something like:
2020-11-17 21:57:40 +01:00
2020-11-17 21:44:32 +01:00
```
Teddit running on https://teddit.net
Teddit running on http://teddit.net
Successfully obtained a reddit API key.
```