From 8ee3de6bc4c3838c927609bb9d00908cfdac91fc Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 12:31:39 +0200 Subject: [PATCH 1/8] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b32a80..3ce3664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ### Changed - [x] Remove non implemented settings from settings page. - [x] Changed video streaming chunk size. +- [x] Video streaming now has a smaller load for the server. +- [x] Video streaming is (a bit) more efficient - YoutubeDL executed on /watch instead. ### Added - [x] Add instance info on settings page. From 657805a7a0f5b8ee4de06427c1b11da5ce6db829 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 12:31:50 +0200 Subject: [PATCH 2/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ce3664..2f87682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Play tweet videos from Parasitter. - Create following lists. -## [0.2.4] - 2020.09.06 +## [0.2.4] - 2020.09.07 ### Changed - [x] Remove non implemented settings from settings page. - [x] Changed video streaming chunk size. From 90f18bcb58840c15900da20155b18e5ababd614a Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 12:55:56 +0200 Subject: [PATCH 3/8] Clarifications --- SELF-HOSTING.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 0241896..c7fa94f 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -8,22 +8,23 @@ 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 about 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. +You will need a server of your own, or you can rent a VPS server on any service you like. Minimum requirements for about 20 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 user 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 +# 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. + - `ssh ubuntu@` - [x] (Recommended) Set up password-less login with ssh-keys. 2. Install base dependencies: @@ -35,7 +36,7 @@ Now you should be logged in. Make sure to set up a good password. It is recommen > When installing MySQL-server it will prompt for a root password. Set up a password of your like, this will be the MySQL databases master password and will be required later, so don't forget it! -> If after the MySQL-server installation you have not been prompted a password for the `root` user, run `sudo mysql_secure_installation` +If after the MySQL-server installation you have not been prompted to create a password for the `root` user, run `sudo mysql_secure_installation` 3. Clone this repository and acccess folder: * `git clone https://github.com/pluja/Yotter` @@ -144,18 +145,24 @@ server { location /static { # handle static files directly, without forwarding to the application - alias /home/ubuntu/Yotter/app/static; + alias /Yotter/app/static; expires 30d; } } ``` +Make sure to replace `` by the domain you are willing to use for your instance (i.e example.com). -* Run `sudo service nginx reload` +You will also need to change the `` after `alias` to fit your system. You have to point to the Yotter folder, in this set up it would be `/home/ubuntu` as it is the location where we cloned the Yotter app. This alias is created to handle static files directly, without forwarding to the application. +Once done, you can run `sudo service nginx reload` + +Now you need to install an SSL certificate on your server so you can use HTTPS: [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) +> Note that you will have to create an 'A Record' on the DNS of your domain to point to the IP of your server. + ## Updating the server -Updating the server should always be pretty easy: +Updating the server should always be pretty easy. These steps need to be run on the Yotter folder and with the python virtual env activated. ``` (venv) $ git pull From a797e712121d7014d2a8267aca2f79625aa2d949 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 13:20:48 +0200 Subject: [PATCH 4/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index c7fa94f..76355d8 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -14,10 +14,13 @@ First of all, you will need to set up a new user on the server. For security rea 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: +> The user needs to have a personal folder (i.e /home/ubuntu). + ``` # adduser --gecos "" ubuntu # usermod -aG sudo ubuntu # su ubuntu +$ cd ``` 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. From 8830dbe5fa4b250d253feb1cfba3754ad63f1111 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 13:21:46 +0200 Subject: [PATCH 5/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 76355d8..67608d4 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -14,8 +14,6 @@ First of all, you will need to set up a new user on the server. For security rea 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: -> The user needs to have a personal folder (i.e /home/ubuntu). - ``` # adduser --gecos "" ubuntu # usermod -aG sudo ubuntu @@ -23,6 +21,8 @@ We will create a user named `ubuntu` as I will be setting this up on an ubuntu m $ cd ``` +If you now type `pwd` and hit enter, you shuould see that the current path is `/home//` + 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 From ced9f87d605431ee5fbc0bf3dd9c6ef454b91ae0 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 13:34:30 +0200 Subject: [PATCH 6/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 67608d4..1967918 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -10,6 +10,8 @@ When you self-host you make internet stronger and more censorship resistant. If You will need a server of your own, or you can rent a VPS server on any service you like. Minimum requirements for about 20 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. +Everything that appears between `` needs to be changed by you. So for example if you see `` you should change it for `weakDummyPassword` without keeping the ``. + 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 user 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: @@ -73,7 +75,7 @@ If after the MySQL-server installation you have not been prompted to create a pa 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. +Make sure you change `` for the previously generated random string. You can paste it as is, without any `"" or ''`. Also change ``. `` 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!) From 6b5555a46e55942265a077a86ef9cf8618f1a4c3 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 13:37:15 +0200 Subject: [PATCH 7/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 1967918..9e3a36b 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -81,7 +81,7 @@ Make sure you change `` for the previously generated random string * Open the MySQL prompt line (Use the previously set MySQL root password!) `mysql -u root -p` -> If you have problems with the root password try running `sudo mysql` and then run this query: `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD';`. This changes the password for the user `root` by `YOUR_PASSWORD` +> If you have problems with the root password try running `sudo mysql` and then run this query: `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD';`. This changes the password for the user `root` by `` Now you should be on the MySQL prompt line (`mysql>`). So let's create the databases: From 37a00839ebecf9d315bf0d3c7bd243673437b74b Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Mon, 7 Sep 2020 13:44:20 +0200 Subject: [PATCH 8/8] Update SELF-HOSTING.md --- SELF-HOSTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 9e3a36b..7c324bc 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -39,7 +39,7 @@ Now you should be logged in. Make sure to set up a good password. It is recommen * `sudo apt-get -y install mysql-server supervisor nginx git` -> When installing MySQL-server it will prompt for a root password. Set up a password of your like, this will be the MySQL databases master password and will be required later, so don't forget it! +> When installing MySQL-server it will prompt for a root password. This is the password for the root user of MySQL. Set up a password of your like, this will be the MySQL databases master password and will be required later, so don't forget it! If after the MySQL-server installation you have not been prompted to create a password for the `root` user, run `sudo mysql_secure_installation` @@ -81,7 +81,9 @@ Make sure you change `` for the previously generated random string * Open the MySQL prompt line (Use the previously set MySQL root password!) `mysql -u root -p` -> If you have problems with the root password try running `sudo mysql` and then run this query: `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD';`. This changes the password for the user `root` by `` +> Note that you are being prompted for the password of the MySQL root user, the one you set up on step 1.2, not the password you wrote on the `.env` file. The password on the `.env` is the password for the MySQL Yotter database. + +> If you still have problems with the root user password try running `sudo mysql` and then run this query: `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';`. This changes the password for the MySQL user `root` by `` Now you should be on the MySQL prompt line (`mysql>`). So let's create the databases: