Merge branch 'dev-indep' of https://github.com/pluja/Parasitter into dev-indep

This commit is contained in:
pluja 2020-09-07 15:22:56 +02:00
commit 550a5055d3
2 changed files with 28 additions and 12 deletions

View File

@ -9,10 +9,12 @@
- Play tweet videos from Parasitter. - Play tweet videos from Parasitter.
- Create following lists. - Create following lists.
## [0.2.4] - 2020.09.06 ## [0.2.4] - 2020.09.07
### Changed ### Changed
- [x] Remove non implemented settings from settings page. - [x] Remove non implemented settings from settings page.
- [x] Changed video streaming chunk size. - [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 ### Added
- [x] Add instance info on settings page. - [x] Add instance info on settings page.

View File

@ -8,22 +8,28 @@ When you self-host you make internet stronger and more censorship resistant. If
## Pre-Installation ## 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.
Everything that appears between `</>` needs to be changed by you. So for example if you see `<password>` 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. 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: 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 # adduser --gecos "" ubuntu
$ usermod -aG sudo ubuntu # usermod -aG sudo ubuntu
$ su ubuntu # su ubuntu
$ cd
``` ```
If you now type `pwd` and hit enter, you shuould see that the current path is `/home/<user>/`
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. 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 ### Step 1: Base setup
1. Connect to your server via SSH or direct access. 1. Connect to your server via SSH or direct access.
- `ssh ubuntu@<ipaddress>`
- [x] (Recommended) Set up password-less login with ssh-keys. - [x] (Recommended) Set up password-less login with ssh-keys.
2. Install base dependencies: 2. Install base dependencies:
@ -33,9 +39,9 @@ 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` * `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 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: 3. Clone this repository and acccess folder:
* `git clone https://github.com/pluja/Yotter` * `git clone https://github.com/pluja/Yotter`
@ -69,13 +75,15 @@ Now you should be logged in. Make sure to set up a good password. It is recommen
SECRET_KEY=<RandomString> SECRET_KEY=<RandomString>
DATABASE_URL=mysql+pymysql://yotter:<db-password>@localhost:3306/yotter DATABASE_URL=mysql+pymysql://yotter:<db-password>@localhost:3306/yotter
``` ```
Make sure you change `<RandomString>` and `>db-password>`. `<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 `<RandomString>` for the previously generated random string. You can paste it as is, without any `"" or ''`. Also change `<db-password>`. `<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: #### Step 2: Setting up the MySQL Database:
* Open the MySQL prompt line (Use the previously set MySQL root password!) * Open the MySQL prompt line (Use the previously set MySQL root password!)
`mysql -u root -p` `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` > 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 '<YOUR_PASSWORD>';`. This changes the password for the MySQL user `root` by `<YOUR_PASSWORD>`
Now you should be on the MySQL prompt line (`mysql>`). So let's create the databases: Now you should be on the MySQL prompt line (`mysql>`). So let's create the databases:
@ -144,18 +152,24 @@ server {
location /static { location /static {
# handle static files directly, without forwarding to the application # handle static files directly, without forwarding to the application
alias /home/ubuntu/Yotter/app/static; alias </path/to>/Yotter/app/static;
expires 30d; expires 30d;
} }
} }
``` ```
Make sure to replace `<yourdomain>` 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 `</path/to>` 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) [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
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 (venv) $ git pull