From 0c6003065dfdcbc6a8de0ec7ef3cfce604da90df Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sun, 6 Sep 2020 18:24:32 +0200 Subject: [PATCH 1/4] Clarifications with self-hosting. --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 659ce83..d464f99 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,12 @@ I always recommend self-hosting, as you will be the only person with access to t # Self hosting +If you want to set up a public server you should follow the instructions [HERE](#hosting-on-a-server) + ## Local +You can run Yotter locally on your machine for personal use. You should use a VPN in order to cloak your IP. + ##### 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,6 +123,9 @@ I always recommend self-hosting, as you will be the only person with access to t 9. Go to "http://localhost:5000/" and enjoy. ## Using Docker: + +Note: Not for a production server. + ##### Building using the Dockerfile > (May not work on Windows) @@ -148,8 +155,9 @@ I always recommend self-hosting, as you will be the only person with access to t 3. Go to "http://localhost:5000/" and enjoy. -## Hosting on a server: +# Hosting on a server: +If you want to set up a Yotter public instance, follow this instructions. #### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/blob/dev-indep/SELF-HOSTING.md) ## Updating to newer versions: From f38541cf96bd45fd4010b87e65a5ea4aa3c8190c Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sun, 6 Sep 2020 18:25:30 +0200 Subject: [PATCH 2/4] Clarifications on self-hosting. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d464f99..e57b4b7 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ I always recommend self-hosting, as you will be the only person with access to t # Self hosting -If you want to set up a public server you should follow the instructions [HERE](#hosting-on-a-server) +If you want to set up a public server you should follow the instructions [HERE](#hosting-on-a-server). The following instructions are for personal use only. ## Local From 1c89bd90936d5fa97ce5cd8c506e5f410fa4f35c Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sun, 6 Sep 2020 18:32:00 +0200 Subject: [PATCH 3/4] Update SELF-HOSTING.md --- SELF-HOSTING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 818a38c..cefc239 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -165,3 +165,14 @@ Updating the server should always be pretty easy: (venv) $ pip install -r requirements.txt (venv) $ sudo supervisorctl start yotter ``` + +## Other configurations + +### Removing log-in restrictions +> (NOT TESTED - COULD CRASH THE APP) Note that some routes make usage of the `current_user` variable to look if the current user is following some user or not, if you remove the restriction for such routes the app will crash. This will be solved on future releases. + +If you want to remove the log-in restriction for any app route (i.e `/watch?v=`) so anyone can access without needing an account, you need to delete some lines from the `routes.py` file. + +Open the `app/routes.py` file with your favourite editor and find the route you want to remove the restriction. Say we want to allow any user to watch a video through our Yotter instance, so we want to remove the restriction for the `/watch...` route. Find the `@app.route('/watch')` on the `routes.py` file. You will see that right below the definition of the route there si a `@login_required` line. If you delete that line, no restriction will now be applied to that route. + + From 58da1a045975631ccec93182927de65f798b3028 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Sun, 6 Sep 2020 22:31:01 +0200 Subject: [PATCH 4/4] How to: Removing log-in restrictions --- SELF-HOSTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index cefc239..d3147ed 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -171,8 +171,12 @@ Updating the server should always be pretty easy: ### Removing log-in restrictions > (NOT TESTED - COULD CRASH THE APP) Note that some routes make usage of the `current_user` variable to look if the current user is following some user or not, if you remove the restriction for such routes the app will crash. This will be solved on future releases. -If you want to remove the log-in restriction for any app route (i.e `/watch?v=`) so anyone can access without needing an account, you need to delete some lines from the `routes.py` file. +For the example, let's allow for anyone to watch a video on our instance. Even if they aren't registered users. First we need to find the route that we want to allow, you can do it by navigating to the page and taking a look at the URL. Anything after the first `/` is the app route. When we're watching a video, the route is `/watch?v=`. -Open the `app/routes.py` file with your favourite editor and find the route you want to remove the restriction. Say we want to allow any user to watch a video through our Yotter instance, so we want to remove the restriction for the `/watch...` route. Find the `@app.route('/watch')` on the `routes.py` file. You will see that right below the definition of the route there si a `@login_required` line. If you delete that line, no restriction will now be applied to that route. +Now on the file `routes.py` we will search for the code that the server runs when we navigate to that route. You can use the Find function on your text editor and search for `/watch`. Now, you will see that right below the definition of the route, `@app.route('/watch')`, there is a `@login_required` line. If you delete that line, no restriction will now be applied to that route. + +But you must know that videos and images are proxied through the instance. So we will need to allow another route. For video streaming, the route is `/stream` and for images it is `/img`. So you just need to delete the `login_required` from those two other routes. + +You can now reload the server and you will see that, without logging in, you can now watch videos.