mirror of
https://codeberg.org/SafeTwitch/safetwitch.git
synced 2024-12-22 13:22:58 -05:00
Add documentation
This commit is contained in:
parent
c1b214b0c9
commit
55dbfc4831
2 changed files with 184 additions and 28 deletions
138
README.md
138
README.md
|
@ -1,18 +1,22 @@
|
||||||
# SafeTwitch
|
# SafeTwitch
|
||||||
|
|
||||||
SafeTwitch is a privacy respecting frontend for [twitch.tv](https://twitch.tv/)
|
SafeTwitch is a privacy respecting frontend for [twitch.tv](https://twitch.tv/)
|
||||||
|
|
||||||
The main advantages of SafeTwitch are:
|
The main advantages of SafeTwitch are:
|
||||||
|
|
||||||
- Private: Every request is proxied through the server, and no logs are kept.
|
- Private: Every request is proxied through the server, and no logs are kept.
|
||||||
- Lightweight: Compared to twitch, SafeTwitch is optimized for speed and usability.
|
- Lightweight: Compared to twitch, SafeTwitch is optimized for speed and usability.
|
||||||
|
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
# Okay, but why?
|
# Okay, but why?
|
||||||
|
|
||||||
It is impossible to use Twitch without being bombarded with tons of ads, multiple trackers, and enourmous page sizes and loading times. This project aims to fix these issues, by removing all trackers, have much smaller page sizes, and very fast loading times.
|
It is impossible to use Twitch without being bombarded with tons of ads, multiple trackers, and enourmous page sizes and loading times. This project aims to fix these issues, by removing all trackers, have much smaller page sizes, and very fast loading times.
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
|
|
||||||
### User features
|
### User features
|
||||||
|
|
||||||
- [x] No connection to twitch/amazon
|
- [x] No connection to twitch/amazon
|
||||||
- [x] Lightweight on server and client
|
- [x] Lightweight on server and client
|
||||||
- [x] No Ads or tracking
|
- [x] No Ads or tracking
|
||||||
|
@ -24,14 +28,148 @@ The main advantages of SafeTwitch are:
|
||||||
- [x] Infinite scrolling
|
- [x] Infinite scrolling
|
||||||
|
|
||||||
### Technical features
|
### Technical features
|
||||||
|
|
||||||
- [x] Public API
|
- [x] Public API
|
||||||
- [x] No official APIs are used
|
- [x] No official APIs are used
|
||||||
- [x] No rate limiting
|
- [x] No rate limiting
|
||||||
- [x] Uses a custom Twitch webscraper
|
- [x] Uses a custom Twitch webscraper
|
||||||
|
|
||||||
# Donations
|
# Donations
|
||||||
|
|
||||||
Donations towards development are not accepted. I really thank you for feeling the need to donate, however the best things in life should be free.
|
Donations towards development are not accepted. I really thank you for feeling the need to donate, however the best things in life should be free.
|
||||||
|
|
||||||
Instead, please donate your money to one of these charities which mean a lot to me.
|
Instead, please donate your money to one of these charities which mean a lot to me.
|
||||||
|
|
||||||
- [American Foundation for Suicide Prevention](https://afsp.org/)
|
- [American Foundation for Suicide Prevention](https://afsp.org/)
|
||||||
- [Boys and Girls Club of America](https://www.bgca.org/ways-to-give)
|
- [Boys and Girls Club of America](https://www.bgca.org/ways-to-give)
|
||||||
|
|
||||||
|
# Getting Started
|
||||||
|
|
||||||
|
Would you like to host an instance? This section is for you.
|
||||||
|
|
||||||
|
## Docker
|
||||||
|
|
||||||
|
Using docker is the prefered way to host SafeTwitch
|
||||||
|
It can be easily setup in a few commands
|
||||||
|
|
||||||
|
### From codeberg's registry
|
||||||
|
|
||||||
|
First, clone the repository and cd into it
|
||||||
|
`git clone codeberg.org/dragongoose/safetwitch`
|
||||||
|
`cd safetwitch`
|
||||||
|
|
||||||
|
Now, change the environment variables in the docker-compose.yml
|
||||||
|
to fit your needs. An example is shown below
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
frontend:
|
||||||
|
image: codeberg.org/dragongoose/safetwitch
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- VITE_BACKEND_DOMAIN=localhost:7000
|
||||||
|
- VITE_INSTANCE_DOMAIN=localhost:80
|
||||||
|
- VITE_HTTPS=false
|
||||||
|
backend:
|
||||||
|
image: codeberg.org/dragongoose/safetwitch-backend
|
||||||
|
ports:
|
||||||
|
- "7000:7000"
|
||||||
|
environment:
|
||||||
|
- PORT=7000
|
||||||
|
- URL=http://localhost:7000
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, run docker-compose
|
||||||
|
`docker-compose up`
|
||||||
|
|
||||||
|
### From source
|
||||||
|
|
||||||
|
First, clone the repository and cd into it
|
||||||
|
`git clone https://codeberg.org/dragongoose/safetwitch`
|
||||||
|
`cd safetwitch`
|
||||||
|
|
||||||
|
cd into the docker directory
|
||||||
|
`cd docker`
|
||||||
|
|
||||||
|
Modify the environment variables in the docker-compose.yml file to fit your needs
|
||||||
|
|
||||||
|
Now, run docker-compose in the docker folder
|
||||||
|
`docker-compose up`
|
||||||
|
|
||||||
|
## Without docker
|
||||||
|
|
||||||
|
This method isn't prefered, but there's nothing wrong with doing it.
|
||||||
|
|
||||||
|
### Setting up the frontend
|
||||||
|
|
||||||
|
First, let's clone the repository and cd into it
|
||||||
|
`git clone https://codeberg.org/dragongoose/safetwitch`
|
||||||
|
`cd safetwitch`
|
||||||
|
|
||||||
|
Now, we have to build the frontend.
|
||||||
|
First, set the environment variables in the .env file to your needs. Here's an example:
|
||||||
|
**This step is important, once the frontend is built, the env variables become hard coded**
|
||||||
|
|
||||||
|
```env
|
||||||
|
VITE_BACKEND_DOMAIN=localhost:7000
|
||||||
|
VITE_INSTANCE_DOMAIN=localhost:5173
|
||||||
|
VITE_HTTPS=false
|
||||||
|
```
|
||||||
|
|
||||||
|
Perfect, now we can build the frontend by running this command
|
||||||
|
`npm run build`
|
||||||
|
|
||||||
|
Once this finished, a new `dist` folder will appear. Put the contents of this folder into wherever your http server is. For the tutorial's sake, we'll use nginx.
|
||||||
|
|
||||||
|
`cd dist`
|
||||||
|
`mv ./* /var/www/html`
|
||||||
|
|
||||||
|
To have nginx allow for the SPA aspect of vue to work, we need to set the config option try_files.
|
||||||
|
|
||||||
|
```conf
|
||||||
|
events {}
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
access_log off;
|
||||||
|
error_log off;
|
||||||
|
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /app;
|
||||||
|
index index.html;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
With that all set up, you can turn nginx on and start using SafeTwitch! (unless you need to setup the backend...)
|
||||||
|
|
||||||
|
### Setting up the backend
|
||||||
|
|
||||||
|
Setting up the backend is easier, first, let's clone it
|
||||||
|
`git clone https://codeberg.org/dragongoose/safetwitch-backend`
|
||||||
|
`cd safetwitch-backend`
|
||||||
|
|
||||||
|
Be sure to set the environment variables in the .env file. Here's an example:
|
||||||
|
|
||||||
|
```env
|
||||||
|
URL=http://localhost:7000
|
||||||
|
PORT:7000
|
||||||
|
```
|
||||||
|
|
||||||
|
Now we have to install dependencies
|
||||||
|
`npm i --production`
|
||||||
|
|
||||||
|
Finally, we can start the server
|
||||||
|
`node index`
|
||||||
|
|
||||||
|
## For instances
|
||||||
|
|
||||||
|
If you host a SafeTwitch instance and would like it to be listed in the readme, please make an issue or a pull request to add it in.
|
||||||
|
|
||||||
|
|
18
docker-compose.yml
Normal file
18
docker-compose.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
frontend:
|
||||||
|
image: codeberg.org/dragongoose/safetwitch
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- VITE_BACKEND_DOMAIN=localhost:7000
|
||||||
|
- VITE_INSTANCE_DOMAIN=localhost:80
|
||||||
|
- VITE_HTTPS=false
|
||||||
|
backend:
|
||||||
|
image: codeberg.org/dragongoose/safetwitch-backend
|
||||||
|
ports:
|
||||||
|
- "7000:7000"
|
||||||
|
environment:
|
||||||
|
- PORT=7000
|
||||||
|
- URL=http://localhost:7000
|
||||||
|
|
Loading…
Reference in a new issue