From 6865455e7c743241dfc06847a8f9cea036f215b6 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 07:42:01 +0200 Subject: [PATCH 01/28] Fix #18: Proxy images through Yotter --- app/routes.py | 15 ++++++++++----- app/templates/_video_item.html | 2 +- app/templates/base.html | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/routes.py b/app/routes.py index f514312..54bca41 100644 --- a/app/routes.py +++ b/app/routes.py @@ -372,6 +372,13 @@ def login(): return redirect(next_page) return render_template('login.html', title='Sign In', form=form) +#Proxy images through server +@app.route('/img/', methods=['GET', 'POST']) +@login_required +def img(url): + pic = requests.get(url.replace("~", "/")) + return Response(pic,mimetype="image/png") + @app.route('/logout') def logout(): logout_user() @@ -553,7 +560,7 @@ def getFeed(urls): for post in userFeed[:-1]: date_time_str = post.find('span', attrs={'class':'tweet-date'}).find('a')['title'].replace(",","") time = datetime.datetime.now() - datetime.datetime.strptime(date_time_str, '%d/%m/%Y %H:%M:%S') - if time.days >=8: + if time.days >=7: continue if post.find('div', attrs={'class':'pinned'}): @@ -608,8 +615,6 @@ def getPosts(account): for post in userFeed[:-1]: date_time_str = post.find('span', attrs={'class':'tweet-date'}).find('a')['title'].replace(",","") time = datetime.datetime.now() - datetime.datetime.strptime(date_time_str, '%d/%m/%Y %H:%M:%S') - if time.days >=8: - continue if post.find('div', attrs={'class':'pinned'}): if post.find('div', attrs={'class':'pinned'}).find('span', attrs={'icon-pin'}): @@ -660,7 +665,7 @@ def getYoutubePosts(ids): for vid in rssFeed.entries: time = datetime.datetime.now() - datetime.datetime(*vid.published_parsed[:6]) - if time.days >=8: + if time.days >=7: continue video = ytPost() @@ -671,7 +676,7 @@ def getYoutubePosts(ids): video.channelUrl = vid.author_detail.href video.id = vid.yt_videoid video.videoTitle = vid.title - video.videoThumb = vid.media_thumbnail[0]['url'] + video.videoThumb = vid.media_thumbnail[0]['url'].replace('/', '~') video.views = vid.media_statistics['views'] video.description = vid.summary_detail.value video.description = re.sub(r'^https?:\/\/.*[\r\n]*', '', video.description[0:120]+"...", flags=re.MULTILINE) diff --git a/app/templates/_video_item.html b/app/templates/_video_item.html index e53696b..a24b977 100644 --- a/app/templates/_video_item.html +++ b/app/templates/_video_item.html @@ -1,6 +1,6 @@
- Thumbnail + Thumbnail
{{video.videoTitle}} diff --git a/app/templates/base.html b/app/templates/base.html index fcc675b..d8a7afd 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -2,7 +2,7 @@ - + {% if title %} {{ title }} - Parassiter {% else %} From f7b0c3df4001292750c4b5479d113c08a2e36081 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 07:54:04 +0200 Subject: [PATCH 02/28] #18: Proxy more images --- app/templates/_video_item.html | 2 +- app/templates/channel.html | 2 +- app/templates/ytsearch.html | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/templates/_video_item.html b/app/templates/_video_item.html index a24b977..d48ef07 100644 --- a/app/templates/_video_item.html +++ b/app/templates/_video_item.html @@ -1,6 +1,6 @@
- Thumbnail + Thumbnail
{{video.videoTitle}} diff --git a/app/templates/channel.html b/app/templates/channel.html index 171880f..a4f3c5b 100644 --- a/app/templates/channel.html +++ b/app/templates/channel.html @@ -4,7 +4,7 @@
- Avatar + Avatar
diff --git a/app/templates/ytsearch.html b/app/templates/ytsearch.html index 8af14a0..a7f7e23 100644 --- a/app/templates/ytsearch.html +++ b/app/templates/ytsearch.html @@ -58,8 +58,6 @@ {% include '_video_item.html' %} {% endfor %}
- {% else %} - {% include '_empty_feed.html' %} {% endif %}
From 6153aa1b2a1b02d10abf073ce8634d8fb37e9f64 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:21:35 +0200 Subject: [PATCH 03/28] Add server config file --- app/routes.py | 15 ++++++++++++--- app/templates/_closed_registrations.html | 2 +- yotter-config.json | 6 ++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 yotter-config.json diff --git a/app/routes.py b/app/routes.py index 54bca41..227a2bc 100644 --- a/app/routes.py +++ b/app/routes.py @@ -22,13 +22,16 @@ import bleach import urllib import json import re - ########################## #### Config variables #### ########################## -NITTERINSTANCE = "https://nitter.net/" # Must be https://.../ +config = json.load(open('yotter-config.json')) +########################## +#### Config variables #### +########################## +NITTERINSTANCE = config['nitterInstance'] # Must be https://.../ YOUTUBERSS = "https://www.youtube.com/feeds/videos.xml?channel_id=" -REGISTRATIONS = True +REGISTRATIONS = config['registrations'] ########################## #### Global variables #### @@ -457,15 +460,21 @@ def allowed_file(filename): @app.route('/register', methods=['GET', 'POST']) def register(): + global REGISTRATIONS + count = db.session.query(User).count() if current_user.is_authenticated: return redirect(url_for('index')) + if count >= config['maxInstanceUsers']: + REGISTRATIONS = False + form = RegistrationForm() if form.validate_on_submit(): if User.query.filter_by(username=form.username.data).first(): flash("This username is taken! Try with another.") return redirect(request.referrer) + user = User(username=form.username.data) user.set_password(form.password.data) db.session.add(user) diff --git a/app/templates/_closed_registrations.html b/app/templates/_closed_registrations.html index b29d202..367d594 100644 --- a/app/templates/_closed_registrations.html +++ b/app/templates/_closed_registrations.html @@ -1,6 +1,6 @@
- Closed registrations image + Closed registrations image
diff --git a/yotter-config.json b/yotter-config.json new file mode 100644 index 0000000..1c0a6dd --- /dev/null +++ b/yotter-config.json @@ -0,0 +1,6 @@ +{ + "nitterInstance": "https://nitter.net/", + "registrations": true, + "maxInstanceUsers": 1, + "proxyAll": true +} \ No newline at end of file From 2cd36a7df87e068b6f0a0c1fc93a17ddc7abda02 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:26:36 +0200 Subject: [PATCH 04/28] Update readme --- README.md | 12 +++++++++++- yotter-config.json | 4 +--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a6078b..80ba550 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,12 @@ Yotter is possible thanks to several open-source projects that are listed on the * [Screenshots](#screenshots) * [Privacy and Security](#-privacy) * [Self hosting](#-self-hosting) - * [Install & Test](#-test) + * Install & Test + * [Normal installation](#-test) + * [Docker installation](#using-docker) * [Hosting on a server](#-hosting-on-a-server) * [Update](#-updating-to-newer-versions) + * [Configure server](#configure-the-server) * [Powered by](#-powered-by) * [Donate](#-donate) @@ -153,6 +156,13 @@ A quick deployment 6. Done! You are on latest version. > **See [CHANGELOG](CHANGELOG.md) for a list of changes.** +### 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. +* **maxInstanceUsers**: Max users on the instance. When set to `0` it closes registrations. + ### β›½ Powered by: * [Nitter](https://nitter.net/) * [youtube-dl](https://github.com/ytdl-org/youtube-dl) diff --git a/yotter-config.json b/yotter-config.json index 1c0a6dd..bf9d1d0 100644 --- a/yotter-config.json +++ b/yotter-config.json @@ -1,6 +1,4 @@ { "nitterInstance": "https://nitter.net/", - "registrations": true, - "maxInstanceUsers": 1, - "proxyAll": true + "maxInstanceUsers": 1 } \ No newline at end of file From 71e7fe9c97fba65321ee0ce76ec5da3d1a8a6153 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:28:28 +0200 Subject: [PATCH 05/28] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec019fb..70e3730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ - Play tweet videos from Parasitter. - Create following lists. +## [0.2.3] - 2020-09-04 +### Added +- [x] Youtube: Proxy all images through Yotter. +- [x] General: Add server config file. +- [x] General: @Sn0wed1 added a Docker file and Docker installation instructions. + ## [0.2.2] - 2020-08-27 ### Changed - [x] Twitter: Scrap nitter pages instead of using RSS. From fdf3824bddbc4c5b7f474a21e5bce3e9c5eee75c Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:29:52 +0200 Subject: [PATCH 06/28] Fix Readme formatting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 80ba550..f38ec3a 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Currently available config is: * **nitterInstance**: Nitter instance that will be used when fetching Twitter content. * **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/) @@ -174,7 +174,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. @@ -184,7 +184,7 @@ Funding will be used 100% for opening and mantaining an online public instance o #### Fiat: - Donate using Liberapay -## πŸ–ΌοΈ Screenshots +# πŸ–ΌοΈ Screenshots

From dc357f3af906ca177a9164b9f3b9f7d5dfbc5079 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:31:47 +0200 Subject: [PATCH 07/28] Fix Readme formatting --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f38ec3a..afe1a06 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ You can test this new version. 9. Go to "http://localhost:5000/" and enjoy. -### Using Docker: +### πŸ‹ Using Docker: A quick deployment 1. Install Docker: @@ -156,14 +156,14 @@ A quick deployment 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. * **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/) @@ -174,7 +174,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. @@ -184,7 +184,7 @@ Funding will be used 100% for opening and mantaining an online public instance o #### Fiat: - Donate using Liberapay -# πŸ–ΌοΈ Screenshots +## πŸ–ΌοΈ Screenshots

From b56bbf884e0196b829808557c440fd6277e08d88 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:33:01 +0200 Subject: [PATCH 08/28] Fix Readme typos --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index afe1a06..1e11119 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,15 @@ Yotter is possible thanks to several open-source projects that are listed on the ## Index: * [Why](#why) * [Features](#features) -* [Screenshots](#screenshots) +* [Screenshots](#-screenshots) * [Privacy and Security](#-privacy) * [Self hosting](#-self-hosting) * Install & Test * [Normal installation](#-test) - * [Docker installation](#using-docker) + * [Docker installation](#-using-docker) * [Hosting on a server](#-hosting-on-a-server) * [Update](#-updating-to-newer-versions) - * [Configure server](#configure-the-server) + * [Configure server](#-configure-the-server) * [Powered by](#-powered-by) * [Donate](#-donate) From c6d5bd1011b4e6fff2aee2f63da747d599c15895 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 08:35:21 +0200 Subject: [PATCH 09/28] Remove some emojis from readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1e11119..a8a93d9 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,15 @@ Yotter is possible thanks to several open-source projects that are listed on the ## Index: * [Why](#why) * [Features](#features) -* [Screenshots](#-screenshots) +* [Screenshots](#screenshots) * [Privacy and Security](#-privacy) * [Self hosting](#-self-hosting) * Install & Test - * [Normal installation](#-test) - * [Docker installation](#-using-docker) - * [Hosting on a server](#-hosting-on-a-server) - * [Update](#-updating-to-newer-versions) - * [Configure server](#-configure-the-server) + * [Normal installation](#test) + * [Docker installation](#using-docker) + * [Hosting on a server](#hosting-on-a-server) + * [Update](#updating-to-newer-versions) + * [Configure server](#configure-the-server) * [Powered by](#-powered-by) * [Donate](#-donate) From 05b40202c72e73723cea7c15fd390d6732cdd802 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 10:01:08 +0200 Subject: [PATCH 10/28] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a8a93d9..a0d8837 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Yotter is possible thanks to several open-source projects that are listed on the * [Privacy and Security](#-privacy) * [Self hosting](#-self-hosting) * Install & Test - * [Normal installation](#test) - * [Docker installation](#using-docker) + * [Normal installation](#-test) + * [Docker installation](#-using-docker) * [Hosting on a server](#hosting-on-a-server) * [Update](#updating-to-newer-versions) * [Configure server](#configure-the-server) From e73833f2a6f7f0fb430031b7521b2476d53a743f Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 10:09:39 +0200 Subject: [PATCH 11/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0d8837..8bc8b1c 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ A quick deployment 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. +* **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: From e5407d2e4e2fc129a7764c34513b8358ba7e6b6b Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 10:13:38 +0200 Subject: [PATCH 12/28] Update README.md --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8bc8b1c..bbbc17d 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,16 @@ Yotter is possible thanks to several open-source projects that are listed on the * [Why](#why) * [Features](#features) * [Screenshots](#screenshots) -* [Privacy and Security](#-privacy) -* [Self hosting](#-self-hosting) +* [Privacy and Security](#privacy) +* [Self hosting](#self-hosting) * Install & Test - * [Normal installation](#-test) - * [Docker installation](#-using-docker) + * [Normal installation](#test) + * [Docker installation](#using-docker) * [Hosting on a server](#hosting-on-a-server) * [Update](#updating-to-newer-versions) - * [Configure server](#configure-the-server) -* [Powered by](#-powered-by) -* [Donate](#-donate) + * [Configure server](configure-the-server) +* [Powered by](#powered-by) +* [Donate](#donate) ## 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. @@ -45,15 +45,15 @@ I hope that this project can prosperate, gain contributors, new instances and cr > And many more to come! -## 🎭 Privacy -#### 🌐 Connections +## 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. The Yotter server connects to Google (Youtube) and Nitter in order to gather all the necessary data. Then it serves it (proxyed through itself) to the client. This means that as a client, you will never connect to Google - the Yotter server will do it for you. So if you want to set up a Yotter server for privacy reasons I recommend you to set it up on a remote VPS so you don't share your IP with Google or use a VPN on the server. If you don't mind exposing your IP making requests to Google then you can set it up wherever you want. Even with this method you will **avoid all trackers, ads, heavy-loaded pages, etc**. - Even with this method, you can stay safe if you use a VPN to hide your IP. -#### πŸ›‘οΈ Your data +#### Your data The only things the database stores are: * Hash of the password * Username @@ -63,7 +63,7 @@ The only things the database stores are: This data will never be used for any other purpose than offering the service to the user. It's not sent anywhere, never. -#### πŸ” Security +#### Security Only the hash of your password is stored on the database. Also, no personal information of any kind is required nor kept, if a hacker gets access to the database the only thing they could do would be to follow/unfollow some accounts. So there's no motivation in 'hacking' Yotter. I always recommend self-hosting, as you will be the only person with access to the data. @@ -73,9 +73,9 @@ I always recommend self-hosting, as you will be the only person with access to t #### Others If you want to use a specific Nitter instance you can replace it on the file `app/routes.py`. -## 🏠 Self hosting +## Self hosting -### 🐣 Test +### Test You can test this new version. ##### 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. @@ -113,7 +113,7 @@ You can test this new version. 9. Go to "http://localhost:5000/" and enjoy. -### πŸ‹ Using Docker: +### Using Docker: A quick deployment 1. Install Docker: @@ -133,10 +133,10 @@ A quick deployment 6. Go to "http://localhost:5000/" and enjoy. -### πŸ”— Hosting on a server: +### Hosting on a server: `SOON` -### πŸ“ 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). @@ -156,14 +156,14 @@ A quick deployment 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/) @@ -174,7 +174,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. @@ -184,7 +184,7 @@ Funding will be used 100% for opening and mantaining an online public instance o #### Fiat: - Donate using Liberapay -## πŸ–ΌοΈ Screenshots +## Screenshots

From 3424b26f9b142f25d9ffcf8cea32828c05cd0a00 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 12:07:29 +0200 Subject: [PATCH 13/28] Add instructions for self-hosting on a server --- README.md | 4 ++- SELF-HOSTING.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 SELF-HOSTING.md diff --git a/README.md b/README.md index a8a93d9..37444aa 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,9 @@ A quick deployment 6. Go to "http://localhost:5000/" and enjoy. ### πŸ”— Hosting on a server: -`SOON` + +#### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/SELF-HOSTING.md) + ### πŸ“ 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)!** diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md new file mode 100644 index 0000000..109189e --- /dev/null +++ b/SELF-HOSTING.md @@ -0,0 +1,94 @@ +#### Step 1: Base setup +1. Connect to your server via SSH or direct access. + * (Recommended) Set up password-less login with ssh-keys. + +2. Install base dependencies: +* `sudo apt-get -y update` + +* `sudo apt-get -y install python3 python3-venv python3-dev` + +* `sudo apt-get -y install mysql-server postfix 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! + +3. Clone this repository and acccess folder: +* `git clone https://github.com/pluja/Yotter` + +* `cd Yotter` + +4. Create a Python virtual environment and populate it with dependencies: +* `python3 -m venv venv` +* `source venv/bin/activate` + +* `pip install -r requirements.txt` + +5. Install gunicorn (production web server for Python apps) and pymysql: +`pip install gunicorn pymysql` + +6. Set up `.env` + 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= + DATABASE_URL=mysql+pymysql://yotter:@localhost:3306/yotter + ``` + +#### Step 2: Setting up the MySQL Database: +* Open the MySQL prompt line (Use the previously set MySQL root password!) + `mysql -u root -p` + +Now you should be on the MySQL prompt line (`mysql>`). So let's create the databases: + +> 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 for the **yotter** user needs to match the password that you included in the `DATABASE_URL` variable in the `.env` file. If you didn't change it, you can change it now. + +``` +mysql> create database yotter character set utf8 collate utf8_bin; +mysql> create user 'yotter'@'localhost' identified by ''; +mysql> grant all privileges on yotter.* to 'yotter'@'localhost'; +mysql> flush privileges; +mysql> quit; +``` + +If your set up was correct, you should now be able to run: + +`flask db upgrade` + +#### 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: + +`gunicorn -b localhost:8000 -w 4 yotter:app` + +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/`: + +> You can run `nano /etc/supervisor/conf.d/yotter.conf` and paste the text below: + +> Make sure to fit any path and user to your system. + +``` +[program:yotter] +command=/home/ubuntu/yotter/venv/bin/gunicorn -b localhost:8000 -w 4 yotter:app +directory=/home/ubuntu/yotter +user=ubuntu +autostart=true +autorestart=true +stopasgroup=true +killasgroup=true +``` + +After you write this configuration file, you have to reload the supervisor service for it to be imported: +`sudo supervisorctl reload` + +#### Step 4: Set up Nginx +The Yotter application server powered by gunicorn is now running privately port 8000. Now we need to expose the application to the outside world by enabling public facing web server on ports 80 and 443, the two ports too need to be opened on the firewall to handle the web traffic of the application. I want this to be a secure deployment, so I'm going to configure port 80 to forward all traffic to port 443, which is going to be encrypted. [ref](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux). + +* `sudo rm /etc/nginx/sites-enabled/default` + +Create a new Nginx site, you can run `sudo nano /etc/nginx/sites-enabled/yotter` \ No newline at end of file From fb66834c011549aefa667fa41efd65e29b534cce Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 4 Sep 2020 12:12:23 +0200 Subject: [PATCH 14/28] ADD readme --- README.md | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7cf7ac8 --- /dev/null +++ b/README.md @@ -0,0 +1,195 @@ +

+

+ License: GPL v3 + Development state + Pull Requests Welcome + Formerly named Parasitter +

+ + +Yotter allows you to follow and gather all the content from your favorite Twitter and YouTube accounts in a *beautiful* feed so you can stay up to date without compromising your privacy at all. Yotter is written with Python and Flask and uses Semantic-UI as its CSS framework. + +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: +* [Why](#why) +* [Features](#features) +* [Screenshots](#screenshots) +* [Privacy and Security](#privacy) +* [Self hosting](#self-hosting) + * Install & Test + * [Normal installation](#test) + * [Docker installation](#using-docker) + * [Hosting on a server](#hosting-on-a-server) + * [Update](#updating-to-newer-versions) + * [Configure server](configure-the-server) +* [Powered by](#powered-by) +* [Donate](#donate) + +## 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: +- [x] No Ads. +- [x] No JavaScript. +- [x] Minimalist. +- [x] Search on Twitter and Youtube. +- [x] Zero connections to Google/Twitter on the client. +- [x] Follow Twitter accounts. +- [x] Follow Youtube accounts. +- [x] Save your favourite Tweets. +- [x] Tor-friendly. +- [x] Terminal-browser friendly. + +> And many more to come! + +## 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. + +The Yotter server connects to Google (Youtube) and Nitter in order to gather all the necessary data. Then it serves it (proxyed through itself) to the client. This means that as a client, you will never connect to Google - the Yotter server will do it for you. So if you want to set up a Yotter server for privacy reasons I recommend you to set it up on a remote VPS so you don't share your IP with Google or use a VPN on the server. + +If you don't mind exposing your IP making requests to Google then you can set it up wherever you want. Even with this method you will **avoid all trackers, ads, heavy-loaded pages, etc**. - Even with this method, you can stay safe if you use a VPN to hide your IP. + +#### Your data +The only things the database stores are: +* Hash of the password +* Username +* List of followed users +* List of saved posts +* Some user configurations (Dark theme, etc) + +This data will never be used for any other purpose than offering the service to the user. It's not sent anywhere, never. + +#### Security +Only the hash of your password is stored on the database. Also, no personal information of any kind is required nor kept, if a hacker gets access to the database the only thing they could do would be to follow/unfollow some accounts. So there's no motivation in 'hacking' Yotter. + +I always recommend self-hosting, as you will be the only person with access to the data. + +> 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`. + +## Self hosting + +### Test +You can test this new version. + +##### 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. + +1. Install `python3`, `pip3`, `python3-venv` (optional) and `git`. + +2. Clone this repository: + - `git clone https://github.com/pluja/Yotter.git` + +3. Navigate to the project folder: + - `cd Yotter` + +4. Prepare a virtual environment and activate it: + > Python lets you create virtual environments. This allows you to avoid installing all the `pip` packages on your system. + - `python3 -m venv venv` + - `source venv/bin/activate` + > Now you are inside of the virtual environment for python. All instructions wiht [env] indicate that must be done inside the env if you decided to create one. From now on, you will always need to start the application from within the virtual env. + +5. [env] Update pip + - `python3 pip install --upgrade pip` + +6. [env] Install the required libraries: + - `python3 pip install -r requirements.txt` + > If you get errors, try running `source venv/bin/activate` again of use `--user` option. + +7. [env] Initialize and prepare the database. + - `flask db init` + - `flask db migrate` + - `flask db upgrade` + > If you get *`"No such command db"`*, try running `source venv/bin/activate` again. + +8. [env] Run the application. + - `flask run` + > You can optionally use `flask run --host 0.0.0.0` so you can use Yotter from other devices from the same network using the host device's IP address and port. Β‘Test it from a smartphone! + +9. Go to "http://localhost:5000/" and enjoy. + +### Using Docker: +A quick deployment + +1. Install Docker: + - `https://docs.docker.com/engine/install/` + +2. Clone this repository: + - `git clone https://github.com/pluja/Yotter.git` + +3. Navigate to the project folder: + - `cd Yotter` + +4. Build the docker image: + - `docker build -t yotter .` + +5. Run the container: + - `docker run -p 5000:5000 yotter` + +6. Go to "http://localhost:5000/" and enjoy. + +<<<<<<< HEAD +### πŸ”— Hosting on a server: + +#### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/SELF-HOSTING.md) + +### 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). + +2. Pull new changes: + - `git pull` + +4. Install new packages (if any): + - `pip install -r requirements.txt` + > It may be that there are no new packages to install. In that case, all requirements will be satisfied. + +5. Update the database: + - `flask db migrate` + - `flask db upgrade` +> If you experience any error in this step, it might be that there were big changes on the database structure. You can solve it by exporting your data, then deleting and resetting the database. Run `rm -rf app.db migrations` and then `flask db init`. Then run step 5 normally. + +6. Done! You are on latest version. +> **See [CHANGELOG](CHANGELOG.md) for a list of changes.** + +### 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: +* [Nitter](https://nitter.net/) +* [youtube-dl](https://github.com/ytdl-org/youtube-dl) +* [Flask](https://flask.palletsprojects.com/) +* [SQLAlchemy](https://docs.sqlalchemy.org/en/13/) +* [Semantic-UI](https://semantic-ui.com) +* [requests-futures](https://github.com/ross/requests-futures) +* [microblog](https://github.com/miguelgrinberg/microblog) +* [Video.js](https://videojs.com/) +* [My fork of youtube_search](https://github.com/pluja/youtube_search-fork) + +## 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. +#### Crypto (preferred): +- **Bitcoin**: `3EjaWjtsHz4WpbVL5Wx8Xg6MfyRRnKYj4e` +- **Monero**: `83hinYmUkMH2ANgdhxRupmakzLwN26ddePrLQvZv4E3Q1CWjq7MDzsKRcPqLPQwTvG3DdujyaxbKbMsf9VKVAmphMhsfndc` +#### Fiat: +- Donate using Liberapay + +## Screenshots +

+

+

+

+

+

From 2c03c982cee4ba000652a1d23159128eb36a2003 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 12:16:16 +0200 Subject: [PATCH 15/28] 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 109189e..505bb42 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -1,3 +1,5 @@ +

UNDER CONSTRUCTION

+ #### Step 1: Base setup 1. Connect to your server via SSH or direct access. * (Recommended) Set up password-less login with ssh-keys. @@ -91,4 +93,4 @@ The Yotter application server powered by gunicorn is now running privately port * `sudo rm /etc/nginx/sites-enabled/default` -Create a new Nginx site, you can run `sudo nano /etc/nginx/sites-enabled/yotter` \ No newline at end of file +Create a new Nginx site, you can run `sudo nano /etc/nginx/sites-enabled/yotter` From e3c1f000b97fc550b8c4fb44b71a10262046423f Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 12:16:39 +0200 Subject: [PATCH 16/28] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cf7ac8..68b7625 100644 --- a/README.md +++ b/README.md @@ -133,10 +133,9 @@ A quick deployment 6. Go to "http://localhost:5000/" and enjoy. -<<<<<<< HEAD ### πŸ”— Hosting on a server: -#### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/SELF-HOSTING.md) +#### [VISIT THIS FILE FOR INSTRUCTIONS](https://github.com/pluja/Yotter/blob/dev-indep/SELF-HOSTING.md) ### 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)!** From f07c74919dd3c0d798d8fddf122cb31928d2adda Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 12:40:59 +0200 Subject: [PATCH 17/28] 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 505bb42..5a89423 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -9,7 +9,7 @@ * `sudo apt-get -y install python3 python3-venv python3-dev` -* `sudo apt-get -y install mysql-server postfix 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! From 9b5f7cae0a94bc95e12b3850494789cb1e470402 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 13:54:44 +0200 Subject: [PATCH 18/28] Update SELF-HOSTING.md --- SELF-HOSTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 5a89423..6ff5208 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -24,6 +24,8 @@ * `pip install -r requirements.txt` +> You can edit the `yotter-config` file + 5. Install gunicorn (production web server for Python apps) and pymysql: `pip install gunicorn pymysql` From b4a3326ce47216c720686dd2d7a7a4122d6f382b Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 14:01:55 +0200 Subject: [PATCH 19/28] 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 6ff5208..e02acc3 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -9,7 +9,7 @@ * `sudo apt-get -y install python3 python3-venv python3-dev` -* `sudo apt-get -y install mysql-server supervisor nginx git` +* `sudo apt-get -y install mysql-server supervisor nginx git make` > 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! From 214500e707d84420ec3a7953fd0241671ed65648 Mon Sep 17 00:00:00 2001 From: 0ihgk1uVBLlTBzVo7F9B <0ihgk1uVBLlTBzVo7F9B@protonmail.com> Date: Fri, 4 Sep 2020 14:26:27 +0200 Subject: [PATCH 20/28] set registrations to true because there is no key in the config file --- app/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index 227a2bc..060af16 100644 --- a/app/routes.py +++ b/app/routes.py @@ -31,7 +31,7 @@ config = json.load(open('yotter-config.json')) ########################## NITTERINSTANCE = config['nitterInstance'] # Must be https://.../ YOUTUBERSS = "https://www.youtube.com/feeds/videos.xml?channel_id=" -REGISTRATIONS = config['registrations'] +REGISTRATIONS = True ########################## #### Global variables #### From c572662112294f5653f57cc4552d929c314897be Mon Sep 17 00:00:00 2001 From: 0ihgk1uVBLlTBzVo7F9B <0ihgk1uVBLlTBzVo7F9B@protonmail.com> Date: Fri, 4 Sep 2020 14:42:35 +0200 Subject: [PATCH 21/28] add option to import newpipe subscriptions --- app/routes.py | 14 ++++++++++++-- app/templates/settings.html | 9 ++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/routes.py b/app/routes.py index 060af16..b496d88 100644 --- a/app/routes.py +++ b/app/routes.py @@ -441,12 +441,16 @@ def importdata(): flash('No selected file') return redirect(request.referrer) if file and allowed_file(file.filename): - importAccounts(file) + option = request.form['import_format'] + if option == 'yotter': + importYotterSubscriptions(file) + elif option == 'newpipe': + importNewPipeSubscriptions(file) return redirect(request.referrer) return redirect(request.referrer) -def importAccounts(file): +def importYotterSubscriptions(file): filename = secure_filename(file.filename) data = json.load(file) for acc in data['twitter']: @@ -455,6 +459,12 @@ def importAccounts(file): for acc in data['youtube']: r = followYoutubeChannel(acc['channelId']) +def importNewPipeSubscriptions(file): + filename = secure_filename(file.filename) + data = json.load(file) + for acc in data['subscriptions']: + r = followYoutubeChannel(re.search('(UC[a-zA-Z0-9_-]{22})|(?<=user\/)[a-zA-Z0-9_-]+', acc['url']).group()) + def allowed_file(filename): return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS diff --git a/app/templates/settings.html b/app/templates/settings.html index 70e02b3..d3d542f 100644 --- a/app/templates/settings.html +++ b/app/templates/settings.html @@ -40,7 +40,14 @@
-
+
+ + +
Import from JSON export.
From ae7aefb5c202133267e644d294944776b36a42ec Mon Sep 17 00:00:00 2001 From: 0ihgk1uVBLlTBzVo7F9B <0ihgk1uVBLlTBzVo7F9B@protonmail.com> Date: Fri, 4 Sep 2020 14:57:45 +0200 Subject: [PATCH 22/28] add option to import youtube subscriptions --- app/routes.py | 11 ++++++++++- app/templates/settings.html | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index b496d88..cdfde74 100644 --- a/app/routes.py +++ b/app/routes.py @@ -12,6 +12,7 @@ from werkzeug.urls import url_parse from youtube_dl import YoutubeDL from numerize import numerize from bs4 import BeautifulSoup +from xml.dom import minidom from app import app, db from re import findall import random, string @@ -440,12 +441,14 @@ def importdata(): if file.filename == '': flash('No selected file') return redirect(request.referrer) - if file and allowed_file(file.filename): + if file and allowed_file(file.filename) or 'subscription_manager' in file.filename: option = request.form['import_format'] if option == 'yotter': importYotterSubscriptions(file) elif option == 'newpipe': importNewPipeSubscriptions(file) + elif option == 'youtube': + importYoutubeSubscriptions(file) return redirect(request.referrer) return redirect(request.referrer) @@ -465,6 +468,12 @@ def importNewPipeSubscriptions(file): for acc in data['subscriptions']: r = followYoutubeChannel(re.search('(UC[a-zA-Z0-9_-]{22})|(?<=user\/)[a-zA-Z0-9_-]+', acc['url']).group()) +def importYoutubeSubscriptions(file): + filename = secure_filename(file.filename) + itemlist = minidom.parse(file).getElementsByTagName('outline') + for item in itemlist[1:]: + r = followYoutubeChannel(re.search('UC[a-zA-Z0-9_-]{22}', item.attributes['xmlUrl'].value).group()) + def allowed_file(filename): return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS diff --git a/app/templates/settings.html b/app/templates/settings.html index d3d542f..db821b5 100644 --- a/app/templates/settings.html +++ b/app/templates/settings.html @@ -47,8 +47,11 @@ + -
Import from JSON export.
+
Import subscription data.
From bf600c1a16fe5411a2d78c90881ad23616e164e4 Mon Sep 17 00:00:00 2001 From: 0ihgk1uVBLlTBzVo7F9B <0ihgk1uVBLlTBzVo7F9B@protonmail.com> Date: Fri, 4 Sep 2020 15:05:32 +0200 Subject: [PATCH 23/28] add option to import freetube subscriptions --- app/routes.py | 10 +++++++++- app/templates/settings.html | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index cdfde74..fbbd5c2 100644 --- a/app/routes.py +++ b/app/routes.py @@ -37,7 +37,7 @@ REGISTRATIONS = True ########################## #### Global variables #### ########################## -ALLOWED_EXTENSIONS = {'json'} +ALLOWED_EXTENSIONS = {'json', 'db'} ######################### #### Twitter Logic ###### @@ -449,6 +449,8 @@ def importdata(): importNewPipeSubscriptions(file) elif option == 'youtube': importYoutubeSubscriptions(file) + elif option == 'freetube': + importFreeTubeSubscriptions(file) return redirect(request.referrer) return redirect(request.referrer) @@ -474,6 +476,12 @@ def importYoutubeSubscriptions(file): for item in itemlist[1:]: r = followYoutubeChannel(re.search('UC[a-zA-Z0-9_-]{22}', item.attributes['xmlUrl'].value).group()) +def importFreeTubeSubscriptions(file): + filename = secure_filename(file.filename) + data = re.findall('UC[a-zA-Z0-9_-]{22}', file.read().decode('utf-8')) + for acc in data: + r = followYoutubeChannel(acc) + def allowed_file(filename): return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS diff --git a/app/templates/settings.html b/app/templates/settings.html index db821b5..bac76a0 100644 --- a/app/templates/settings.html +++ b/app/templates/settings.html @@ -50,6 +50,9 @@ +
Import subscription data.
From 61ecd5bdee40e8e0c33215883be3a7b05868d0fd Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 15:28:17 +0200 Subject: [PATCH 24/28] Update SELF-HOSTING.md --- SELF-HOSTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index e02acc3..4e4a3a8 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -1,4 +1,5 @@

UNDER CONSTRUCTION

+Formerly named Parasitter #### Step 1: Base setup 1. Connect to your server via SSH or direct access. From ea1aa6e9f871c74e5938945cae6d940249bea11e Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 15:29:11 +0200 Subject: [PATCH 25/28] 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 4e4a3a8..0669539 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -1,5 +1,7 @@

UNDER CONSTRUCTION

-Formerly named Parasitter +Installation Working +
+Tested on Ubuntu #### Step 1: Base setup 1. Connect to your server via SSH or direct access. From 4fb8e0ae77eb09f042e27502242d2742ab375f2c Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 15:59:16 +0200 Subject: [PATCH 26/28] Update routes.py --- app/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index fbbd5c2..0f249ac 100644 --- a/app/routes.py +++ b/app/routes.py @@ -32,7 +32,7 @@ config = json.load(open('yotter-config.json')) ########################## NITTERINSTANCE = config['nitterInstance'] # Must be https://.../ YOUTUBERSS = "https://www.youtube.com/feeds/videos.xml?channel_id=" -REGISTRATIONS = True +REGISTRATIONS = config['registrations'] ########################## #### Global variables #### @@ -717,4 +717,4 @@ def getYoutubePosts(ids): video.description = vid.summary_detail.value video.description = re.sub(r'^https?:\/\/.*[\r\n]*', '', video.description[0:120]+"...", flags=re.MULTILINE) videos.append(video) - return videos \ No newline at end of file + return videos From c428cc765805a4a50c97a3deec60e2dca7f41ba8 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 16:02:49 +0200 Subject: [PATCH 27/28] 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 0669539..baa0356 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -1,7 +1,7 @@

UNDER CONSTRUCTION

Installation Working
-Tested on Ubuntu +Tested on Ubuntu #### Step 1: Base setup 1. Connect to your server via SSH or direct access. From 7be48e3f4ac4b26583eea80e8568498b55435471 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Fri, 4 Sep 2020 16:26:44 +0200 Subject: [PATCH 28/28] Update SELF-HOSTING.md --- SELF-HOSTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index baa0356..2a43c9f 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -62,7 +62,8 @@ mysql> quit; If your set up was correct, you should now be able to run: -`flask db upgrade` +`flask db init` +`flask db migrate` #### 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)