From 79ce184ca833fa0249a05d026ac6ed34f00d5312 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:10:32 +0200 Subject: [PATCH 1/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index a7b9d64..88fb2b6 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -31,7 +31,7 @@ * `pip install cryptography` * `pip install -r requirements.txt` -> You can edit the `yotter-config` file +> You can edit the `yotter-config.json` file 5. Install gunicorn (production web server for Python apps) and pymysql: `pip install gunicorn pymysql` @@ -130,4 +130,15 @@ server { * Run `sudo service nginx reload` -[Follow this instructions to install certbot and generate an ssl certificate](https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx) +[Follow this instructions to install certbot and generate an ssl certificate so your server can use HTTPS](https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx) + +## Updating the server +Updating the server should always be pretty easy: + +``` +(venv) $ git pull +(venv) $ sudo supervisorctl stop yotter +(venv) $ flask db upgrade +(venv) $ pip install -r requirements.txt +(venv) $ sudo supervisorctl start yotter +``` From 0a47f932c7fb6aae19657812e5c3126fb47ee1f9 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:11:25 +0200 Subject: [PATCH 2/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fc53f91..6d3741d 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ You can test this new version. 3. Go to "http://localhost:5000/" and enjoy. -### 🔗 Hosting on a server: +### Hosting on a server: #### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/blob/dev-indep/SELF-HOSTING.md) From f6f177b39a791ad2b23675c4a684bc06eceb9699 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:14:19 +0200 Subject: [PATCH 3/8] Format readme --- README.md | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6d3741d..64e675c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Yotter allows you to follow and gather all the content from your favorite Twitte Yotter is possible thanks to several open-source projects that are listed on the [Powered by](#powered-by) section. Make sure to check out those awesome projects! -## Index: +# Index: * [Why](#why) * [Features](#features) * [Screenshots](#screenshots) @@ -27,12 +27,12 @@ Yotter is possible thanks to several open-source projects that are listed on the * [Powered by](#powered-by) * [Donate](#donate) -## Why +# Why At first I started working on this project as a solution for following Twitter accounts (a thing that can't be done with Nitter) and getting a Twitter-like feed. Weeks later the leader of Invidious, Omar Roth, announced that he was stepping away from the project. As an Invidious active user, this made me think that a new alternative was needed for the community and also an alternative with an easier language for most people (as Invidious is written in Crystal). So I started developing a 'written-in-python Invidious alternative' and it went quite well. I hope that this project can prosperate, gain contributors, new instances and create a good community around it. -## Features: +# Features: - [x] No Ads. - [x] No JavaScript. - [x] Minimalist. @@ -46,7 +46,7 @@ I hope that this project can prosperate, gain contributors, new instances and cr > And many more to come! -## Privacy +# Privacy #### Connections Yotter cares about your privacy, and for this it will never make any connection to Twitter or Youtube on the client. Every request is proxied through the Yotter server; video streaming, photos, data gathering, scrapping, etc. @@ -71,20 +71,16 @@ I always recommend self-hosting, as you will be the only person with access to t > Important note: The **client** never connects to Google / Youtube however, the server does in order to gather all the necessary things! -#### Others -If you want to use a specific Nitter instance you can replace it on the file `app/routes.py`. - -## Public Instances +# Public Instances | name |server location|registrations?| | ------------ | ------------ | ------------ | | [yotter.xyz](https://yotter.xyz/) |Germany|Open| -## Self hosting +# Self hosting -### Test -You can test this new version. +## Local -##### IMPORTANT: Connections to googlevideo will be made to stream the videos. It is recommended to use a VPS server or a VPN to preserve your privacy. This version is intended for a remote server. +##### IMPORTANT: Connections from the server to googlevideo will be made to stream the videos. It is recommended to use a VPN to preserve your privacy. Understand that the best way of using Yotter is [running on a remote server](#hosting-on-a-server). 1. Install `python3`, `pip3`, `python3-venv` (optional) and `git`. @@ -119,7 +115,7 @@ You can test this new version. 9. Go to "http://localhost:5000/" and enjoy. -### Using Docker: +## Using Docker: ##### Building using the Dockerfile > (May not work on Windows) @@ -149,11 +145,11 @@ You can test this new version. 3. Go to "http://localhost:5000/" and enjoy. -### Hosting on a server: +## Hosting on a server: #### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/blob/dev-indep/SELF-HOSTING.md) -### Updating to newer versions: +## Updating to newer versions: **IMPORTANT: Before updating to newer versions, always export your data on `Settings>Export Data`. A major version update could have changes on the whole database and you may be forced to remove and reset the database (only when running locally)!** 1. Navigate to the git repository (the one you cloned when installing). @@ -173,14 +169,14 @@ You can test this new version. 6. Done! You are on latest version. > **See [CHANGELOG](CHANGELOG.md) for a list of changes.** -### Configure the server +## Configure the server You will find in the root folder of the project a file named `yotter-config.json`. This is the global config file for the Yotter server. Currently available config is: * **nitterInstance**: Nitter instance that will be used when fetching Twitter content. Format must be `**https://****/**` * **maxInstanceUsers**: Max users on the instance. When set to `0` it closes registrations. -## Powered by: +# Powered by: * [Nitter](https://nitter.net/) * [youtube-dl](https://github.com/ytdl-org/youtube-dl) * [Flask](https://flask.palletsprojects.com/) @@ -191,7 +187,7 @@ Currently available config is: * [Video.js](https://videojs.com/) * [My fork of youtube_search](https://github.com/pluja/youtube_search-fork) -## Donate +# Donate This project is completely free and Open Source and will always be. Funding will be used 100% for opening and mantaining an online public instance of Yotter, this will be hosted on Netcup and will (at first) be the *VPS 500 G8*. I mention all of this in case you want to check the prices. From 2dd668705245c8718afae1f3da31ad5f2a952f46 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:23:46 +0200 Subject: [PATCH 4/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64e675c..480144a 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ I always recommend self-hosting, as you will be the only person with access to t # Public Instances | name |server location|registrations?| | ------------ | ------------ | ------------ | -| [yotter.xyz](https://yotter.xyz/) |Germany|Open| +| - |Germany|Open| # Self hosting From de01997392ba23bc4eb3825290fcf2bf813bed5a Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:37:28 +0200 Subject: [PATCH 5/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 88fb2b6..ae7ae2e 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -1,11 +1,30 @@ Installation Working Tested on Ubuntu -> Using the `root` user is not recommended for this installation. +# Why should I self host? +Self-hosting gives you the whole power over the service and the data. You can set up a server for your own personal use or share it with friends and family. Or, why not go further and share it with the whole world? -#### Step 1: Base setup +When you self-host you make internet stronger and more censorship resistant. If one Yotter instance goes down for any reason, there will be all other instances online and ready to host new users. + +## Pre-Installation + +You will need a server of your own, or you can rent a VPS server on any service you like. Minimum requirements for up to 5 users are 2GB of RAM and a Linux Server. It is better if the server is dedicated as whole to Yotter as it will improve performance and security. + +First of all, you will need to set up a new user on the server. For security reasons you should never use a `root` user to set up a service. If you already have a non-root server you can use that one and skip the following steps. + +We will create a user named `ubuntu` as I will be setting this up on an ubuntu machine. So, if you choose a different username make sure you replace it on future commands. We will create and login to the user as follows: + +``` +$ adduser --gecos "" ubuntu +$ usermod -aG sudo ubuntu +$ su ubuntu +``` + +Now you should be logged in. Make sure to set up a good password. It is recommended to use ssh keys to log-in remotelly and disable the password login on all users. + +### Step 1: Base setup 1. Connect to your server via SSH or direct access. - * (Recommended) Set up password-less login with ssh-keys. + - [x] (Recommended) Set up password-less login with ssh-keys. 2. Install base dependencies: * `sudo apt-get -y update` From 1e11f86b91f5347f3a5b1d8fb96c477f48373695 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:37:57 +0200 Subject: [PATCH 6/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index ae7ae2e..bf2cbee 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -8,7 +8,7 @@ When you self-host you make internet stronger and more censorship resistant. If ## Pre-Installation -You will need a server of your own, or you can rent a VPS server on any service you like. Minimum requirements for up to 5 users are 2GB of RAM and a Linux Server. It is better if the server is dedicated as whole to Yotter as it will improve performance and security. +You will need a server of your own, or you can rent a VPS server on any service you like. Minimum requirements for up to 15 users are 2GB of RAM and a Linux Server. It is better if the server is dedicated as whole to Yotter as it will improve performance and security. First of all, you will need to set up a new user on the server. For security reasons you should never use a `root` user to set up a service. If you already have a non-root server you can use that one and skip the following steps. From 719b1232331d247eeb543ad7e594d69c30ec1540 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 09:43:13 +0200 Subject: [PATCH 7/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index bf2cbee..6c18559 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -61,14 +61,15 @@ Now you should be logged in. Make sure to set up a good password. It is recommen * `flask db upgrade` 7. Set up `.env` - 1. (PRE) Generate a random string and copy it to clipboard: + 1. (PRE) Generate a **random string** and copy it to clipboard: `python3 -c "import uuid; print(uuid.uuid4().hex)"` 2. Create a `.env` file on the root folder of the project (`/home/ubuntu/Yotter/.env`): ``` - SECRET_KEY= + SECRET_KEY= DATABASE_URL=mysql+pymysql://yotter:@localhost:3306/yotter ``` +Make sure you change `` and `>db-password>`. `` should be different from the password of the database root user (the one you set up on step 1.2). This password will be needed later. #### Step 2: Setting up the MySQL Database: * Open the MySQL prompt line (Use the previously set MySQL root password!) @@ -80,7 +81,7 @@ Now you should be on the MySQL prompt line (`mysql>`). So let's create the datab > Change `` for a password of your like. It will be the password for the dabase user `yotter`. Don't choose the same password as the root user of MySQL for security. -> The password ` The password `` for the **yotter** user needs to match the password that you included in the `DATABASE_URL` variable in the `.env` file. If you want to change it, you can change it now. ``` mysql> create database yotter character set utf8 collate utf8_bin; @@ -97,10 +98,12 @@ If your set up was correct, you should now be able to run: #### Step 3: Setting up Gunicorn and Supervisor When you run the server with flask run, you are using a web server that comes with Flask. This server is very useful during development, but it isn't a good choice to use for a production server because it wasn't built with performance and robustness in mind. Instead of the Flask development server, for this deployment I decided to use gunicorn, which is also a pure Python web server, but unlike Flask's, it is a robust production server that is used by a lot of people, while at the same time it is very easy to use. [ref](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux) -* Start yotter under Gunicorn: +* Start yotter under Gunicorn and check it has no errors: `gunicorn -b localhost:8000 -w 4 yotter:app` +Once you see that no errors appear, you can stop gunicorn by pressing `Ctrl+C`. + The supervisor utility uses configuration files that tell it what programs to monitor and how to restart them when necessary. Configuration files must be stored in /etc/supervisor/conf.d. Here is a configuration file for Yotter, which I'm going to call yotter.conf [ref](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux). * Create a yotter.conf file on `/etc/supervisor/conf.d/`: From 12304469b23d7e4ad49e28f6d342aa90fafa71ba Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sat, 5 Sep 2020 10:01:10 +0200 Subject: [PATCH 8/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 480144a..3e85acd 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ I hope that this project can prosperate, gain contributors, new instances and cr - [x] Zero connections to Google/Twitter on the client. - [x] Follow Twitter accounts. - [x] Follow Youtube accounts. +- [x] Play Youtube videos on background on Android. - [x] Save your favourite Tweets. - [x] Tor-friendly. - [x] Terminal-browser friendly.