From 520c59a10c1e78740eb48d1b7ba61ae9744988e6 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 5 Apr 2017 14:43:41 +0200 Subject: Now using Heroku Python runtime 3.6.1. --- runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.txt b/runtime.txt index c0354eef..c91e43be 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.5.2 +python-3.6.1 -- cgit From de05845887181f949780f5627570713b4d3ca93b Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 07:49:12 +0200 Subject: Added a page which displays some information about the instance. --- src/web/__init__.py | 8 ++++++++ src/web/templates/about_more.html | 10 ++++++++++ src/web/views/views.py | 12 ++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/web/templates/about_more.html diff --git a/src/web/__init__.py b/src/web/__init__.py index e69de29b..cca2a501 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -0,0 +1,8 @@ +__author__ = "Cedric Bonhomme" +__version__ = "$Revision: 7.1.3 $" +__date__ = "$Date: 2016/11/14 $" +__revision__ = "$Date: 2016/11/14 $" +__copyright__ = "Copyright (c) Cedric Bonhomme" +__license__ = "GPLv3" + +__all__ = [__version__] diff --git a/src/web/templates/about_more.html b/src/web/templates/about_more.html new file mode 100644 index 00000000..0b934aab --- /dev/null +++ b/src/web/templates/about_more.html @@ -0,0 +1,10 @@ +{% extends "layout.html" %} +{% block content %} +
+
    +
  • Newspipe version: {{newspipe_version}}
  • +
  • Python version: {{python_version}}
  • +
  • Number of users: {{nb_users}}
  • +
+
+{% endblock %} diff --git a/src/web/views/views.py b/src/web/views/views.py index b8d9514f..d599143f 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -1,3 +1,4 @@ +import sys import logging import operator from datetime import datetime, timedelta @@ -6,8 +7,9 @@ from flask import (request, render_template, flash, from flask_babel import gettext from sqlalchemy import desc +from web import __version__ from conf import API_ROOT, ADMIN_EMAIL -from web.controllers import FeedController +from web.controllers import FeedController, UserController from web.lib.view_utils import etag_match logger = logging.getLogger(__name__) @@ -74,9 +76,15 @@ def popular(): @current_app.route('/about', methods=['GET']) @etag_match def about(): - print(ADMIN_EMAIL) return render_template('about.html', contact=ADMIN_EMAIL) +@current_app.route('/about/more', methods=['GET']) +@etag_match +def about_more(): + return render_template('about_more.html', + newspipe_version=__version__.split()[1], + python_version="{}.{}.{}".format(*sys.version_info[:3]), + nb_users=UserController().read().count()) @current_app.route('/.well-known/acme-challenge/MmwFRp_wOgBGHcIULSUGVFDjpryEw_uWz7UgD6rE4t4') def letsencrypt(): -- cgit From 9540d3341b6492b0c903b042288d3271988be4dd Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 07:51:11 +0200 Subject: Updated about page. --- src/web/templates/about.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/templates/about.html b/src/web/templates/about.html index c2d0ae4d..70ae0a5f 100644 --- a/src/web/templates/about.html +++ b/src/web/templates/about.html @@ -12,6 +12,7 @@ redistribute the source code according to the Affero GPL license.') }}

{{ _('Found a bug? Report it here.') }}

+

More information about this instance.

{{ _('Help') }}

-- cgit From 5673c95312d0661488c86b21dfb8653b6d249c43 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 07:51:53 +0200 Subject: Removed now useless endpoint. --- src/web/views/views.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/web/views/views.py b/src/web/views/views.py index d599143f..4dffdf37 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -85,10 +85,3 @@ def about_more(): newspipe_version=__version__.split()[1], python_version="{}.{}.{}".format(*sys.version_info[:3]), nb_users=UserController().read().count()) - -@current_app.route('/.well-known/acme-challenge/MmwFRp_wOgBGHcIULSUGVFDjpryEw_uWz7UgD6rE4t4') -def letsencrypt(): - """ - To validate the TLS certificate. - """ - return 'MmwFRp_wOgBGHcIULSUGVFDjpryEw_uWz7UgD6rE4t4.bUlx3NWj4YZ59CkBunuvzS0GnW5Kh9i4yehDEP4AEdU' -- cgit From bb71e242b67b8bf7baca1ca1c4f47624ffd77738 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 07:57:09 +0200 Subject: Displays if the the instance is running on Heroku. --- src/web/templates/about_more.html | 1 + src/web/views/views.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/web/templates/about_more.html b/src/web/templates/about_more.html index 0b934aab..47c321ca 100644 --- a/src/web/templates/about_more.html +++ b/src/web/templates/about_more.html @@ -3,6 +3,7 @@
  • Newspipe version: {{newspipe_version}}
  • +
  • Running on Heroku: {{on_heroku}}
  • Python version: {{python_version}}
  • Number of users: {{nb_users}}
diff --git a/src/web/views/views.py b/src/web/views/views.py index 4dffdf37..0a785ceb 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -7,6 +7,7 @@ from flask import (request, render_template, flash, from flask_babel import gettext from sqlalchemy import desc +import conf from web import __version__ from conf import API_ROOT, ADMIN_EMAIL from web.controllers import FeedController, UserController @@ -83,5 +84,6 @@ def about(): def about_more(): return render_template('about_more.html', newspipe_version=__version__.split()[1], + on_heroku=[conf.ON_HEROKU and 'Yes' or 'No'][0], python_version="{}.{}.{}".format(*sys.version_info[:3]), nb_users=UserController().read().count()) -- cgit From 7312031dbc8ab5e15c329ae97295cb4c0982fd5e Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 08:01:52 +0200 Subject: Added registration status. --- src/web/templates/about_more.html | 1 + src/web/views/views.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/web/templates/about_more.html b/src/web/templates/about_more.html index 47c321ca..dd7088a5 100644 --- a/src/web/templates/about_more.html +++ b/src/web/templates/about_more.html @@ -4,6 +4,7 @@
  • Newspipe version: {{newspipe_version}}
  • Running on Heroku: {{on_heroku}}
  • +
  • Registration: {{registration}}
  • Python version: {{python_version}}
  • Number of users: {{nb_users}}
diff --git a/src/web/views/views.py b/src/web/views/views.py index 0a785ceb..03d6501d 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -83,7 +83,8 @@ def about(): @etag_match def about_more(): return render_template('about_more.html', - newspipe_version=__version__.split()[1], - on_heroku=[conf.ON_HEROKU and 'Yes' or 'No'][0], - python_version="{}.{}.{}".format(*sys.version_info[:3]), - nb_users=UserController().read().count()) + newspipe_version=__version__.split()[1], + on_heroku=[conf.ON_HEROKU and 'Yes' or 'No'][0], + registration=[conf.SELF_REGISTRATION and 'Open' or 'Closed'][0], + python_version="{}.{}.{}".format(*sys.version_info[:3]), + nb_users=UserController().read().count()) -- cgit From d9068c069ad3b97a12f2158a78033682731ef9d6 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 11:42:32 +0200 Subject: validate and update app.json --- app.json | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/app.json b/app.json index 0648fe63..d0234cbc 100644 --- a/app.json +++ b/app.json @@ -1,16 +1,20 @@ { "name": "Newspipe", "description": "A news aggregator that can be deployed on Heroku.", - "keywords": ["aggregator", "news", "RSS"], + "keywords": [ + "aggregator", + "news", + "RSS" + ], "website": "https://github.com/newspipe/", "repository": "https://github.com/newspipe/newspipe", "logo": "https://raw.githubusercontent.com/newspipe/newspipe/master/src/web/static/img/newspipe.png", "scripts": { - "postdeploy": "python src/manager.py db_create" + "postdeploy": "python src/manager.py db_create, git submodule init; git submodule update" }, "env": { "PLATFORM_URL": { - "description": "Address of your instance (for example: https://your-application-name.herokuapp.com/)", + "description": "Address of your instance (for example: https://YOUR-APPLICATION-NAME.herokuapp.com/)", "required": true, "value": "" }, @@ -42,7 +46,7 @@ "TOKEN_VALIDITY_PERIOD": { "description": "Validity period (in seconds) of the account confirmation link sent by email.", "required": true, - "value": 3600 + "value": "3600" }, "HEROKU": "1", "CDN_ADDRESS": "https://cdn.cedricbonhomme.org/", @@ -54,25 +58,11 @@ }, "FEED_REFRESH_INTERVAL": { "description": "Feeds refresh interval (in minutes) for the crawler.", - "value": 120 + "value": "120" } }, "addons": [ "heroku-postgresql:hobby-dev", "scheduler:standard" - ], - "buildpacks": [ - { - "url": "heroku/python", - "index": 1 - }, - { - "url": "https://github.com/heroku/heroku-buildpack-nodejs", - "index": 2 - }, - { - "url": "https://github.com/ejholmes/heroku-buildpack-bower", - "index": 3 - } ] } -- cgit From 3ed42b9141fed1737f1a4bc8f94f3bc5a36dae1b Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 13:10:23 +0200 Subject: typo --- app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.json b/app.json index d0234cbc..eafb7f4f 100644 --- a/app.json +++ b/app.json @@ -10,7 +10,7 @@ "repository": "https://github.com/newspipe/newspipe", "logo": "https://raw.githubusercontent.com/newspipe/newspipe/master/src/web/static/img/newspipe.png", "scripts": { - "postdeploy": "python src/manager.py db_create, git submodule init; git submodule update" + "postdeploy": "python src/manager.py db_create; git submodule init; git submodule update" }, "env": { "PLATFORM_URL": { -- cgit From 33ef1a0e62ef4bef2eafe8e6c53118d0d5d43335 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 6 Apr 2017 13:19:16 +0200 Subject: fixed postdeploy script. --- app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.json b/app.json index eafb7f4f..e8bb2585 100644 --- a/app.json +++ b/app.json @@ -10,7 +10,7 @@ "repository": "https://github.com/newspipe/newspipe", "logo": "https://raw.githubusercontent.com/newspipe/newspipe/master/src/web/static/img/newspipe.png", "scripts": { - "postdeploy": "python src/manager.py db_create; git submodule init; git submodule update" + "postdeploy": "python src/manager.py db_create; cd submodules/bootstrap/; git clone https://github.com/twbs/bootstrap.git" }, "env": { "PLATFORM_URL": { -- cgit